情况:我有两个域:domain.pl和domain.com。 我configuration了两个电子邮件[email protected]和[email protected]。 我也只有在ssl.domain.com有效的SSL证书。
问题:我想设置所有的邮件从[email protected] => [email protected](或理想情况下,所有的东西从@ domain.com到domain.pl)转发。
我做了什么:我使用了虚拟别名,并且这两封邮件都正确传递,但转发不起作用。 我也尝试了recipient_bcc_maps技巧,但没有运气。 我使用的是后缀2.9.6。 这是我的configuration文件:
main.cf
# /etc/mailname => domain.com myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/postfix/keys/domain.crt smtpd_tls_key_file=/etc/postfix/keys/domain.key smtpd_tls_CAfile=/etc/postfix/keys/startssl.ca smtpd_use_tls=yes smtpd_tls_security_level=may #smtpd_tls_auth_only=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_delay_reject = yes smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, permit smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, permit smtpd_recipient_restrictions = reject_unauth_pipelining, permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, reject_unknown_sender_domain, check_policy_service unix:private/policy-spf smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes dovecot_destination_recipient_limit = 1 local_recipient_maps = myhostname = ssl.domain.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = localhost.localdomain, localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 message_size_limit = 102400000 recipient_delimiter = + inet_interfaces = all # trick try, forwards contained: # [email protected] [email protected] #recipient_bcc_maps = hash:/etc/postfix/forwards #DKIM milter_default_action = accept milter_protocol = 6 smtpd_milters = inet:localhost:12345 non_smtpd_milters = inet:localhost:12345 #VIRTUAL virtual_transport = dovecot-spamass virtual_mailbox_domains = domain.pl, domain.com virtual_mailbox_maps = hash:/etc/postfix/vmailbox virtual_alias_maps = hash:/etc/postfix/virtual
master.cf
smtp inet n - - - - smtpd -o receive_override_options=no_address_mappings submission inet n - - - - smtpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp -o smtp_fallback_relay= showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${user}@${domain} ${extension} ${recipient} ${user} ${nexthop} uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - nn - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - nn - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} dovecot unix - nn - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} dovecot-spamass unix - nn - - pipe flags=DRhu user=vmail:vmail argv=/usr/bin/spamc -u ${recipient} -e /usr/lib/dovecot/deliver -f ${sender} -d ${recipient} policy-spf unix - nn - - spawn user=nobody argv=/usr/bin/policyd-spf
vmailbox
[email protected] whatever [email protected] whatever
虚拟
@domain.com [email protected] @domain.pl [email protected]
别名
mailer-daemon: postmaster postmaster: root nobody: root hostmaster: root usenet: root news: root webmaster: root www: root ftp: root abuse: root noc: root security: root root: tom
这里是sendmail -bv [email protected]的输出
This is the mail system at host ssl.domain.com. Enclosed is the mail delivery report that you requested. The mail system <[email protected]> (expanded from <[email protected]>): delivery via dovecot-spamass: delivers to command: /usr/bin/spamc Reporting-MTA: dns; ssl.domain.com X-Postfix-Queue-ID: D23E242559 X-Postfix-Sender: rfc822; [email protected] Arrival-Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC) Final-Recipient: rfc822; [email protected] Original-Recipient: rfc822; [email protected] Action: deliverable Status: 2.0.0 Diagnostic-Code: X-Postfix; delivery via dovecot-spamass: delivers to command: /usr/bin/spamc Return-Path: <[email protected]> Received: by ssl.domain.com (Postfix, from userid 0) id D23E242559; Tue, 11 Feb 2014 02:54:16 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 ssl.domain.com D23E242559 DKIM-Signature: ...... From: [email protected] Subject: probe To: [email protected] Message-Id: <[email protected]> Date: Tue, 11 Feb 2014 02:54:16 +0000 (UTC)
我真的没有想法在这一点上,任何帮助将不胜感激。 我有这种难看的感觉,我错过了一些超级简单的东西。
你可以插入/ etc / aliases
jerry: [email protected],[email protected] tom: [email protected],[email protected]
你会得到所有的电子邮件。