【问题标题】:postfix with zeyple - Relay access denied带有zeyple的后缀 - 中继访问被拒绝
【发布时间】:2017-12-05 04:34:35
【问题描述】:

我想使用 zeyple 加密我的服务器发送的外发邮件。

“Zeyple 是一个 Postfix 过滤器/挂钩,可以使用 GPG/PGP 自动加密外发电子邮件。”

https://github.com/infertux/zeyple

我安装并设置 postfix 只发送邮件:

$ sudo apt-get install postfix

General type of mail configuration: Internet Site

System mail name: <hostname>

在 /etc/postfix/main.cf 中

#inet_interfaces = all
inet_interfaces = loopback-only

此时发送未加密的邮件可以正常工作。

使用教程安装 zeyple 后 https://github.com/infertux/zeyple/blob/master/INSTALL.md 和设置

content_filter = zeyple

在 main.cf 中我得到一个“中继访问被拒绝”

$ 日期 | mail -s testmail user@somemail.com

<user@somemail.com>: Command died with status 1: "/usr/local/bin/zeyple.py".
    Command output: Traceback (most recent call last):   File
    "/usr/local/bin/zeyple.py", line 274, in <module>
    zeyple.process_message(message, recipients)   File
    "/usr/local/bin/zeyple.py", line 126, in process_message
    self._send_message(out_message, recipient)   File
    "/usr/local/bin/zeyple.py", line 260, in _send_message
    smtp.sendmail(message['From'], recipient, message.as_string())   File
    "/usr/lib/python2.7/smtplib.py", line 747, in sendmail     raise
    SMTPRecipientsRefused(senderrs) smtplib.SMTPRecipientsRefused:
    {'user@somemail.com': (454, '4.7.1 <user@somemail.com>: Relay access
    denied')}

$ cat /var/log/zeyple.log

2017-07-01 11:43:17,019 29616 INFO Zeyple ready to encrypt outgoing emails
2017-07-01 11:43:17,020 29616 INFO Processing outgoing message <20170701094316.EED64817E4@<hostname>.dedicated.hosteurope.de>
2017-07-01 11:43:17,020 29616 INFO Recipient: user@somemail.com
2017-07-01 11:43:17,020 29616 INFO Trying to encrypt for user@somemail.com
2017-07-01 11:43:17,034 29616 INFO Key ID: <some-key>
2017-07-01 11:43:17,054 29616 INFO Sending message <20170701094316.EED64817E4@<hostname>.dedicated.hosteurope.de>

$ postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = zeyple
inet_interfaces = loopback-only
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = <hostname>.dedicated.hosteurope.de, localhost.dedicated.hosteurope.de, , localhost
myhostname = <hostname>.dedicated.hosteurope.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

感谢您的帮助。

【问题讨论】:

    标签: email postfix


    【解决方案1】:

    通过检查 /var/log/mail.log 我发现以下消息

    Jul  2 11:22:07 hostname postfix/smtpd[8984]: NOQUEUE: reject: RCPT from localhost[::1]: 454 4.7.1 <user@somemail.com>: Relay access denied; from=<user@hostname.dedicated.hosteurope.de> to=<user@somemail.com> proto=ESMTP helo=<hostname.dedicated.hosteurope.de>
    Jul  2 11:22:07 hostname postfix/smtpd[8984]: lost connection after RSET from localhost[::1]
    

    解决方案是编辑从以下文件中的 zeyple 安装指令添加的部分:

    /etc/postfix/master.cf

    (将 127.0.0.0/8 替换为 [::1]/128 )

    #  -o mynetworks=127.0.0.0/8
      -o mynetworks=[::1]/128
    #  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
      -o smtpd_authorized_xforward_hosts=[::1]/128
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-24
      • 1970-01-01
      • 2013-02-16
      • 1970-01-01
      • 1970-01-01
      • 2013-08-21
      • 2015-06-23
      • 1970-01-01
      相关资源
      最近更新 更多