主题: iRedmail取消发送邮件时的用户认证

iRedmail中的postfix在发送邮件时,必须进行用户认证后,方可发送邮件到外网(比如发送到qq邮箱)。
如果我想取消用户认证,并且能发送到外网,该如何设置?
我改了main.cf文件中的一些参数,取消了用户认证功能,但是这时不能发送邮件到外网了,只能发送到本服务器上的邮箱账户。
只是内部使用,不担心垃圾邮件的问题。

求大牛解答,谢谢!

回复: iRedmail取消发送邮件时的用户认证

如果只是取消用户验证,只需要注释掉 main.cf 里的 smtpd_sender_login_maps 参数即可。

警告:如果去掉用户验证,则所有人都可以通过您的服务器发送邮件,这样就可能被人利用来发送垃圾邮件。也就是所谓的“open relay”。

另外,如果您修改了参数,麻烦您将修改的部分贴上来便于大家帮忙分析。笼统地说“修改了参数但是不生效”这样不利于大家帮忙分析。

回复: iRedmail取消发送邮件时的用户认证

我已经注释了smtpd_sender_login_maps 参数,然后在日志中看到如下信息:
Feb 17 10:59:55 mail postfix/smtpd[2141]: NOQUEUE: reject: RCPT from unknown[192.168.35.72]: 504 5.5.2 <gwtsam>: Helo command rejected: need fully-qualified hostname; from=<maxadmin@demo.com> to=<maxadmin@demo.com> proto=ESMTP helo=<gwtsam>

我就试着修改了参数smtpd_helo_restrictions
smtpd_helo_required = yes
smtpd_helo_restrictions =
queue_run_delay = 300s
还是会出现上述 Helo command rejected: need fully-qualified hostname;信息。

目前在原来main.cf文件的基础上修改了如下参数
smtpd_helo_restrictions =                    #(空)
#smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
#content_filter = smtp-amavis:[127.0.0.1]:10024

请指教,谢谢!

回复: iRedmail取消发送邮件时的用户认证

补充:
Trying 192.168.17.93...
Connected to 192.168.17.93.
Escape character is '^]'.
220 mail.example.com ESMTP Postfix (Ubuntu)
helo gwtsam
250 mail.example.com
mail from:<maxadmin@demo.com>
250 2.1.0 Ok
rcpt to:<maxadmin@demo.com>
504 5.5.2 <gwtsam>: Helo command rejected: need fully-qualified hostname
rcpt to:<pmrdpcausr@demo.com>
504 5.5.2 <gwtsam>: Helo command rejected: need fully-qualified hostname

回复: iRedmail取消发送邮件时的用户认证

贴一下以下命令的输出:

# postconf -n

另外,不知您的网络环境为何必须去掉 smtp 发信认证?

6 最后由 janpychou (2012-02-17 14:56:54) 编辑

回复: iRedmail取消发送邮件时的用户认证

我只是内部使用,只向外部发送邮件,而不接收外部发来的邮件。

问题已经解决,以下是main.cf配置文件的修改情况
root@mail:/etc/postfix# diff main.cf main.cf.original
36c36
< mynetworks = 127.0.0.0/8 0.0.0.0/0
---
> mynetworks = 127.0.0.0/8
73c73
< #smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
---
> smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
96c96
< #content_filter = smtp-amavis:[127.0.0.1]:10024
---
> content_filter = smtp-amavis:[127.0.0.1]:10024

因为不需要杀毒模块,所以注释了最后一行。

root@mail:/etc/postfix# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = example.com
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 0.0.0.0/0
mynetworks_style = subnet
myorigin = mail.example.com
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:ldap:/etc/postfix/ldap/relay_domains.cf
relayhost =
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = proxy:ldap:/etc/postfix/ldap/transport_maps_user.cf, proxy:ldap:/etc/postfix/ldap/transport_maps_domain.cf
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap/virtual_alias_maps.cf, proxy:ldap:/etc/postfix/ldap/virtual_group_maps.cf, proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf, proxy:ldap:/etc/postfix/ldap/catchall_maps.cf
virtual_gid_maps = static:1001
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_maps.cf
virtual_minimum_uid = 1001
virtual_transport = dovecot
virtual_uid_maps = static:1001

以上是postconf -n得到的信息,请张工检查一下这样配置会不会有什么问题。
谢谢指教!