BCCでのみ外部アドレスに転送されるPostfixルートメール

BCCでのみ外部アドレスに転送されるPostfixルートメール

私のGmailアカウントを介してproxmoxメッセージを配信し、エイリアスを使用してすべてのルートメールを外部アドレスに転送するようにpostfixを設定しました。 sendmail コマンドを使用すると、Gmail の送信したフォルダにメールを表示できます。ここで、「受信者:」フィールドは空で、「隠し参照:」は私の外部アドレスです。 mail -s を使用すると、メールが Gmail の送信フォルダに表示されます。ここで、「受信者:」フィールドは元のルートメールであり、「隠し参照:」は私の外部アドレスです。

配送先住所を変更しないでください。[Eメール保護]「隠し参照:」の代わりに「受信者:」フィールドに転送を停止してください。[Eメール保護]一般的な?

ルート電子メールをテストするコマンド

# echo -e "Subject:Hello World \n\n Testing email\n" | sendmail root
# echo "testing" | mail -s "test message" root

ログファイル

Dec 29 12:56:13 pve postfix/pickup[32080]: DB1E662DFA: uid=0 from=<root>
Dec 29 12:56:13 pve postfix/cleanup[32097]: DB1E662DFA: message-id=<[email protected]>
Dec 29 12:56:13 pve postfix/qmgr[32081]: DB1E662DFA: from=<[email protected]>, size=390, nrcpt=1 (queue active)
Dec 29 12:56:13 pve postfix/cleanup[32097]: E13A162DF8: message-id=<[email protected]>
Dec 29 12:56:13 pve postfix/local[32099]: DB1E662DFA: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (forwarded as E13A162DF8)
Dec 29 12:56:13 pve postfix/qmgr[32081]: E13A162DF8: from=<[email protected]>, size=515, nrcpt=1 (queue active)
Dec 29 12:56:13 pve postfix/qmgr[32081]: DB1E662DFA: removed
Dec 29 12:56:13 pve postfix/smtp[32100]: connect to smtp.gmail.com[2607:f8b0:4001:c1d::6c]:587: Network is unreachable
Dec 29 12:56:14 pve postfix/smtp[32100]: E13A162DF8: to=<[email protected]>, orig_to=<root>, relay=smtp.gmail.com[74.125.126.109]:587, delay=0.85, delays=0/0.03/0.37/0.45, dsn=2.0.0, status=sent (250 2.0.0 OK 1514570174 f126sm11045770ioa.84 - gsmtp)
Dec 29 12:56:14 pve postfix/qmgr[32081]: E13A162DF8: removed

Dec 29 12:59:40 pve postfix/pickup[32080]: D6C9362DFA: uid=0 from=<root>
Dec 29 12:59:40 pve postfix/cleanup[32429]: D6C9362DFA: message-id=<[email protected]>
Dec 29 12:59:40 pve postfix/qmgr[32081]: D6C9362DFA: from=<[email protected]>, size=280, nrcpt=1 (queue active)
Dec 29 12:59:40 pve postfix/cleanup[32429]: DDD4D62DF8: message-id=<[email protected]>
Dec 29 12:59:40 pve postfix/local[32431]: D6C9362DFA: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.05, delays=0.03/0.01/0/0.01, dsn=2.0.0, status=sent (forwarded as DDD4D62DF8)
Dec 29 12:59:40 pve postfix/qmgr[32081]: DDD4D62DF8: from=<[email protected]>, size=405, nrcpt=1 (queue active)
Dec 29 12:59:40 pve postfix/qmgr[32081]: D6C9362DFA: removed
Dec 29 12:59:41 pve postfix/smtp[32432]: connect to smtp.gmail.com[2607:f8b0:4001:c1d::6c]:587: Network is unreachable
Dec 29 12:59:41 pve postfix/smtp[32432]: DDD4D62DF8: to=<[email protected]>, orig_to=<root>, relay=smtp.gmail.com[74.125.126.109]:587, delay=0.93, delays=0.01/0.02/0.52/0.38, dsn=2.0.0, status=sent (250 2.0.0 OK 1514570381 a69sm13573861itc.18 - gsmtp)
Dec 29 12:59:41 pve postfix/qmgr[32081]: DDD4D62DF8: removed

ニックネーム

root: [email protected]

postmaster: root
nobody: root
hostmaster: root
webmaster: root
www:root

マスターファイル

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

myhostname=pve.home.com

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
#relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
inet_interfaces = loopback-only
recipient_delimiter = +

# sets gmail as relay
relayhost = [smtp.gmail.com]:587

#  use tls
smtp_use_tls=yes

# use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes

# path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# list of CAs to trust when verifying server certificate
smtp_tls_CAfile = /etc/ssl/certs/Equifax_Secure_CA.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s

# eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options =

所有者

127.0.0.1 localhost.localdomain localhost
127.0.1.1 pve.home.com pve pvelocalhost

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

メール名

pve.home.com

ベストアンサー1

アドレスはデフォルトでは書き換えられません。genericstablePostfixはSendmail関数を呼び出します。generic(5)だから理論的に追加

smtp_generic_maps = hash:/etc/postfix/generic

あなたの項目に次のmain.cf項目を追加してください。/etc/postfix/generic

[email protected] [email protected]

その後、Postfixを実行してpostmap /etc/postfix/generic再起動すると、アドレスが再作成されます。 (これは、メール転送エージェントが使用するエンベロープアドレス(Postfixなど)とメッセージ自体の本文アドレスの違いによって複雑になる可能性があります...)

この場合、適切なアドレスヘッダーを提供する| sendmailか、メールユーザーエージェント(たとえば)を使用してこれらの詳細を処理する必要があります。ToSubjectmail

おすすめ記事