Email

帶有郵遞員的後綴

  • August 28, 2012

應該發生的是 user@dur.bounceme.net 應該被發送到本地主機上的使用者收件箱 user@localhost。Thunderbird 可以很好地讀取 user@localhost。

我只是在 Ubuntu mailman 中使用了一小部分postfix - dovecot。如何讓 postfix 辨識 FQDN 並將它們發送到 localhost 收件箱?

root@dur:~# 
root@dur:~# tail /var/log/mail.err;tail /var/log/mailman/subscribe;postconf -n
Aug 27 18:59:16 dur dovecot: lda(root): Error: chdir(/root) failed: Permission denied
Aug 27 18:59:16 dur dovecot: lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
Aug 27 18:59:16 dur dovecot: lda(root): Fatal: Invalid user settings. Refer to server log for more information.
Aug 27 20:09:16 dur postfix/trivial-rewrite[15896]: error: open database /etc/postfix/transport.db: No such file or directory
Aug 27 21:19:17 dur postfix/trivial-rewrite[16569]: error: open database /etc/postfix/transport.db: No such file or directory
Aug 27 22:27:00 dur postfix[17042]: fatal: usage: postfix [-c config_dir] [-Dv] command
Aug 27 22:29:19 dur postfix/trivial-rewrite[17062]: error: open database /etc/postfix/transport.db: No such file or directory
Aug 27 22:59:07 dur postfix/postfix-script[17459]: error: unknown command: 'restart'
Aug 27 22:59:07 dur postfix/postfix-script[17460]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: error: open database /etc/postfix/transport.db: No such file or directory
Aug 27 21:39:03 2012 (16734) cola: pending "hawat.thufir@gmail.com" <thufir@dur.bounceme.net>  127.0.0.1
Aug 27 21:40:37 2012 (16749) cola: pending "hawat.thufir@gmail.com" <thufir@dur.bounceme.net>  127.0.0.1
Aug 27 22:45:31 2012 (17288) gmane.mail.mailman.user.1: pending thufir@dur.bounceme.net  127.0.0.1
Aug 27 22:45:46 2012 (17293) gmane.mail.mailman.user.1: pending HAWAT.THUFIR@gmail.com  127.0.0.1
Aug 27 23:02:01 2012 (17588) test3: pending hawat.thufir@gmail.com  127.0.0.1
Aug 27 23:05:41 2012 (17652) test4: pending thufir@dur.bounceme.net  127.0.0.1
Aug 27 23:56:20 2012 (17985) test5: pending thufir@dur.bounceme.net  127.0.0.1
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_transport = smtp
home_mailbox = Maildir/
inet_interfaces = loopback-only
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m "${EXTENSION}"
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mydestination = dur, dur.bounceme.net, localhost.bounceme.net, localhost
myhostname = dur.bounceme.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relay_domains = lists.dur.bounceme.net
relay_transport = relay
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
root@dur:~# 

肯定有運輸問題:

root@dur:~# 
root@dur:~# 
root@dur:~# grep transport /var/log/mail.log | tail
Aug 27 22:29:19 dur postfix/trivial-rewrite[17062]: warning: hash:/etc/postfix/transport lookup error for "root@dur.bounceme.net"
Aug 27 22:29:19 dur postfix/trivial-rewrite[17062]: warning: transport_maps lookup failure
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: error: open database /etc/postfix/transport.db: No such file or directory
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport is unavailable. open database /etc/postfix/transport.db: No such file or directory
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport lookup error for "*"
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport is unavailable. open database /etc/postfix/transport.db: No such file or directory
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport lookup error for "*"
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport is unavailable. open database /etc/postfix/transport.db: No such file or directory
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: hash:/etc/postfix/transport lookup error for "root@dur.bounceme.net"
Aug 27 23:39:17 dur postfix/trivial-rewrite[17794]: warning: transport_maps lookup failure
root@dur:~# 

嘗試添加傳輸文件:

編輯

root@dur:~# 
root@dur:~# touch /etc/postfix/transport 
root@dur:~# ll /etc/postfix/transport 
-rw-r--r-- 1 root root 0 Aug 28 00:16 /etc/postfix/transport
root@dur:~# 
root@dur:~# cd /etc/postfix/
root@dur:/etc/postfix# 
root@dur:/etc/postfix# postmap transport
root@dur:/etc/postfix# 
root@dur:/etc/postfix# cat transport
default_transport=error 

只允許本地傳遞。嘗試將其更改為

default_transport=smtp

還要檢查relay_transport。

引用自:https://serverfault.com/questions/421869