我正在尝试在我的服务器上配置 postfix。问题是,使用外部中继主机 (gmail) 我实际上可以从我的机器发送电子邮件,但如果我尝试使用我的本地机器(没有中继主机),则不会收到任何邮件,即使我尝试将电子邮件发送到我自己的本地机器。
日志没有说发生任何错误,所以我不确定会发生什么...有什么想法吗?
如果有用的话,我使用 Debian Lenny
这是我的 main.cf 文件:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
myorigin = servername.net
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
readme_directory = /usr/share/doc/postfix
# TLS parameters
smtp_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtp_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_use_tls=yes
smtp_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#smtp_tls_CAfile = /etc/postfix/cacert.pem
#smtp_sasl_auth_enable = yes
#smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
#smtp_sasl_security_options = noanonymous
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
mydomain = $myorigin
myhostname = hostname.$mydomain
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
mynetworks_style = host
# relayhost = [smtp.gmail.com]:587
relayhost =
notify_classes = 2bounce, delay, policy, protocol, resource, software
inet_interfaces = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
html_directory = /usr/share/doc/postfix/html
以下是日志中的输出:
Aug 3 14:36:02 hostname postfix/pickup[22767]: F16E31A3F: uid=1000 from=<jstitch>
Aug 3 14:36:03 hostname postfix/cleanup[22959]: F16E31A3F: message-id=<[email protected]>
Aug 3 14:36:03 hostname postfix/qmgr[22768]: F16E31A3F: from=<[email protected]>, size=1596, nrcpt=1 (queue active)
Aug 3 14:36:03 hostname procmail[22962]: Error while writing to "/var/log/procmail"
Aug 3 14:36:03 hostname postfix/local[22961]: F16E31A3F: to=<[email protected]>, orig_to=<jstitch>, relay=local, delay=1.5, delays=1.5/0.02/0/0.03, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Aug 3 14:36:03 hostname postfix/qmgr[22768]: F16E31A3F: removed
也许写入 var/log/procmail 时出现的错误表明 procmail 存在问题?
实际上 /var/log/procmail 是一个空文件,具有 640 个权限,所有者为 root,组为 adm(所有其他 syslog 文件都具有相同的特征)
在我的 ~/.procmailrc 中有这个:
SHELL=/bin/sh
MAILDIR=$HOME/Mail
DEFAULT=$HOME/Mail/
CAUGHT_SPAM=$MAILDIR/.CaughtSpam/
UNSURE=$MAILDIR/.Unsure/
VERBOSE=on
LOGFILE=/var/log/procmail
#Spambayes process
:0fw:hamlock
| /usr/local/bin/sb_filter.py -d ~/.hammie.db
:0
* ^X-Spambayes-Classification: spam
${CAUGHT_SPAM}
:0
* ^X-Spambayes-Classification: unsure
${UNSURE}
# Catches everything else.
# Anything left over goes into the DEFAULT folder
:0:
${DEFAULT}
但是没有 /etc/procmailrc 文件...
答案1
您有 /etc/procmailrc 文件吗?和 ~jstitch/.procmailrc 吗?
检查用户 jstitch 的主目录:可能创建了 procmail.log...