opendkim 和 postfix centos 的问题

opendkim 和 postfix centos 的问题

嗨,我在使用 opendkim 签名邮件时遇到了问题。检查我的日志。我通过更改该文件的所有者解决了权限问题。但电子邮件仍然没有被签名。有什么线索吗?在 centos5 上运行 postfix/opendkim、dovecot

Jul 22 05:25:03 veepiz postfix/smtpd[3837]: > localhost[127.0.0.1]: 354 End data with <CR><LF>.<CR><LF>
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: public/cleanup socket: wanted attribute: status
Jul 22 05:25:03 veepiz postfix/cleanup[3846]: 72B3E16400B: message-id=<[email protected]>
Jul 22 05:25:03 veepiz opendkim[2681]: can't load key from /etc/mail/dkim/keys/veepiz.com/default: Permission denied
Jul 22 05:25:03 veepiz opendkim[2681]: (unknown-jobid): error loading key 'default._domainkey.veepiz.com'
Jul 22 05:25:03 veepiz postfix/cleanup[3846]: 72B3E16400B: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 4.7.1 Service unavailable - try again later; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<veepiz.com>
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: input attribute name: status
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: input attribute value: 256
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: public/cleanup socket: wanted attribute: reason
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: input attribute name: reason
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: input attribute value: 4.7.1 Service unavailable - try again later
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: public/cleanup socket: wanted attribute: (list terminator)
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: input attribute name: (end)
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: > localhost[127.0.0.1]: 451 4.7.1 Service unavailable - try again later
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: abort all milters
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: milter8_abort: abort milter inet:127.0.0.1:20209
Jul 22 05:25:03 veepiz sendmail[3833]: p6M5P2l4003833: to=apache, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30429, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 451 4.7.1 Service unavailable - try again later
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: < localhost[127.0.0.1]: QUIT
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: > localhost[127.0.0.1]: 221 2.0.0 Bye
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: match_hostname: localhost ~? 198.168.0.0/24
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: match_hostaddr: 127.0.0.1 ~? 198.168.0.0/24
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: match_hostname: localhost ~? 127.0.0.0/8
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: abort all milters
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: milter8_abort: abort milter inet:127.0.0.1:20209
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: disconnect event to all milters
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: milter8_disc_event: quit milter inet:127.0.0.1:20209
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: disconnect from localhost[127.0.0.1]
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: master_notify: status 1
Jul 22 05:25:03 veepiz postfix/smtpd[3837]: connection closed

以下是 postconf -n 的输出

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
milter_default_action = accept
milter_protocol = 2
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = mail.veepiz.com
mynetworks = 198.168.0.0/24, 127.0.0.0/8
myorigin = veepiz.com
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = inet:127.0.0.1:20209
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relay_domains =
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_milters = inet:127.0.0.1:20209
unknown_local_recipient_reject_code = 550

答案1

看来您的密钥文件权限可能仍然不正确。仅更改权限是不够的,还必须将其修改为 700。

以下是在 CentOS 系统上使用 Postfix 设置 OpenDKIM 的分步指南:

http://stevejenkins.com/blog/2010/09/how-to-get-dkim-domainkeys-identified-mail-working-on-centos-5-5-and-postfix-using-opendkim/

严格按照这些步骤操作,您很快就能签署邮件。

答案2

我知道这个问题已经发布了一段时间了...但这个回复可能会对其他人有帮助...

我遇到了同样的问题,并通过更改文件的权限解决了这个问题。

ls -l /etc/mail/dkim/keys/veepiz.com/default
-rw------- 1 root     root     887 Dec 10 19:07 default

如果该文件属于 root,则必须对其进行 chown。

chown opendkim:opendkim /etc/mail/dkim/keys/veepiz.com/default
-rw------- 1 opendkim opendkim 887 Dec 10 19:07 default

重新启动 opendkim,然后重新启动 postfix。

相关内容