Postfix

後綴 - telnet 命令沒有問候語

  • September 4, 2014

我正在嘗試在 CentOS 5 上安裝帶有 Dovecot 和 MySQL 的 Postfix。我對此很陌生,我為此苦苦掙扎了兩個多星期。我按照這個說明https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql-on-centos-5

但是我的 telnet 命令沒有 220 行。

這是我的 main.cf

sendmail_path = /usr/sbin/sendmail.postfix    
newaliases_path = /usr/bin/newaliases.postfix    
mailq_path = /usr/bin/mailq.postfix    
setgid_group = postdrop    
html_directory = no    
manpage_directory = /usr/share/man    
sample_directory = /usr/share/doc/postfix-2.3.3/samples

readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
myhostname = mail.mobz.ca
mynetworks = 127.0.0.0/8
message_size_limit = 30720000
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

/var/log/maillog 不包含任何錯誤。

網路統計-plnt | grep 主輸出

tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      5505/master

我不知道從這裡搬到哪裡。請對此有任何提示嗎?

提前致謝。

更新:

我在郵件日誌中發現錯誤:

Sep  3 19:31:40 vps postfix/smtpd[5512]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:31:40 vps postfix/cleanup[5509]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:31:40 vps postfix/smtpd[5512]: warning: private/proxymap socket: service dict_proxy_open: Success
Sep  3 19:31:40 vps postfix/cleanup[5509]: warning: private/proxymap socket: service dict_proxy_open: Connection reset by peer
Sep  3 19:31:40 vps postfix/master[5505]: warning: process /usr/libexec/postfix/proxymap pid 10871 exit status 1
Sep  3 19:31:40 vps postfix/master[5505]: warning: /usr/libexec/postfix/proxymap: bad command startup -- throttling
Sep  3 19:32:40 vps postfix/proxymap[10872]: fatal: /etc/postfix/mysql-virtual_forwardings.cf: bad string length 0 < 1: dbname =
Sep  3 19:32:41 vps postfix/smtpd[5512]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:32:41 vps postfix/cleanup[5509]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:32:41 vps postfix/cleanup[5509]: warning: private/proxymap socket: service dict_proxy_open: Connection reset by peer
Sep  3 19:32:41 vps postfix/smtpd[5512]: warning: private/proxymap socket: service dict_proxy_open: Success
Sep  3 19:32:41 vps postfix/master[5505]: warning: process /usr/libexec/postfix/proxymap pid 10872 exit status 1
Sep  3 19:32:41 vps postfix/master[5505]: warning: /usr/libexec/postfix/proxymap: bad command startup -- throttling

這裡的關鍵是郵件日誌中的致命錯誤消息。錯誤資訊

fatal: /etc/postfix/mysql-virtual_forwardings.cf: bad string length 0 < 1: dbname =

表明你/etc/postfix/mysql-virtual_forwardings.cf搞砸了。當我查看您遵循的教程(linode web)時,已確認。

mysql中的maps格式/etc/postfix/mysql-virtual_forwardings.cf非常非常錯誤。您不能將多個參數放在一行中。看起來 linode 中的格式化引擎弄亂了教程,或者作者忘記檢查語法是否正常。

user = mail_admin password = mail_admin_password dbname = mail query = SELECT destination FROM forwardings WHERE source=’%s’ hosts = 127.0.0.1

要檢查正確的格式,請查閱官方文件。您必須將單獨的配置放在單獨的行中

user = mail_admin 
password = mail_admin_password 
dbname = mail 
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1

並且不要忘記檢查所有 mysql 映射的語法是否正確。

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