linux – Postfix客户端主机被拒绝

linux – Postfix客户端主机被拒绝,第1张

概述我在Ubuntu 12.04上设置了Postfix Courier Roundcube,但是当我尝试使用Roundcube发送电子邮件时,收到以下错误: /var/log/mail.log: Dec 30 20:54:35 server postfix/smtpd[31465]: connect from localhost[127.0.0.1]Dec 30 20:54:35 server po 我在Ubuntu 12.04上设置了Postfix CourIEr Roundcube,但是当我尝试使用Roundcube发送电子邮件时,收到以下错误:

/var/log/mail.log:

Dec 30 20:54:35 server postfix/smtpd[31465]: connect from localhost[127.0.0.1]Dec 30 20:54:35 server postfix/smtpd[31465]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)Dec 30 20:54:35 server postfix/smtpd[31465]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <localhost[127.0.0.1]>: ClIEnt host rejected: Access denIEd; from=<sender@mydomain.net> to=<receiver@gmail.com> proto=ESMTP helo=<mail.mydomain.net>Dec 30 20:54:35 server postfix/smtpd[31465]: disconnect from localhost[127.0.0.1]

根据我的设置,不确定这是怎么回事:

/etc/postfix/main.cf:

# Debian specific:  Specifying a @R_404_6852@ name will cause the first# line of that @R_404_6852@ to be used as the name.  The Debian default# is /etc/mailname.#myorigin = /etc/mailnamesmtpd_banner = $myhostname ESMTP $mail_namebiff = no# appending .domain is the MUA's job.append_dot_mydomain = no# Uncomment the next line to generate "delayed mail" warnings#delay_warning_time = 4hreadme_directory = no# TLS parameterssmtp_tls_security_level = maysmtpd_tls_security_level = maysmtp_tls_note_starttls_offer = yessmtpd_tls_loglevel = 1smtpd_tls_received_header = yessmtpd_tls_session_cache_timeout = 3600stls_random_source = dev:/dev/urandomsmtpd_tls_cert_@R_404_6852@=/etc/ssl/certs/ssl-cert-snakeoil.pemsmtpd_tls_key_@R_404_6852@=/etc/ssl/private/ssl-cert-snakeoil.key# smtpd_use_tls=yes# smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache# smtp_tls_session_cache_database = btree:${data_directory}/smtp_scachesmtp_tls_CA@R_404_6852@ = /etc/ssl/certs/ca-certificates.crt#SASLsmtpd_sasl_auth_enable = yesbroken_sasl_auth_clIEnts = nosmtpd_sasl_security_options = noanonymoussmtpd_sasl_local_domain =# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for# information on enabling SSL in the smtp clIEnt.myhostname = server.mydomain.netalias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesmyorigin = mydomain.netmydestination = mail.mydomain.net,mydomain.net,localhost.mydomain.net,localhost#mydestination =relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128mailBox_command = procmail -a "$EXTENSION"mailBox_size_limit = 0recipIEnt_delimiter = +inet_interfaces = allmynetworks_style = hostmasquerade_domains = mail.mydomain.net mydomain.net !sub.dyndomain.commasquerade_exceptions = rootlocal_recipIEnt_maps =mydestination =delay_warning_time = 4hunkNown_local_recipIEnt_reject_code = 450maximal_queue_lifetime = 7dminimal_backoff_time = 1000smaximal_backoff_time = 8000ssmtp_helo_timeout = 60ssmtpd_recipIEnt_limit = 16smtpd_soft_error_limit = 3smtpd_hard_error_limit = 12smtpd_helo_restrictions = permit_mynetworks,warn_if_reject reject_non_fqdn_hostname,reject_invalID_hostname,permitsmtpd_sender_restrictions = permit_sasl_authenticated,permit_mynetworks,warn_if_reject reject_non_fqdn_sender,reject_unkNown_sender_domain,reject_unauth_pipelining,permitsmtpd_clIEnt_restrictions = reject_rbl_clIEnt sbl.spamhaus.org,reject_rbl_clIEnt blackholes.easynet.nlsmtpd_recipIEnt_restrictions = reject_unauth_pipelining,permit_sasl_authenticated,reject_non_fqdn_recipIEnt,reject_unkNown_recipIEnt_domain,reject_unauth_destination,check_policy_service inet:127.0.0.1:10023,permitsmtpd_data_restrictions = reject_unauth_pipeliningsmtpd_helo_required = yessmtpd_delay_reject = yesdisable_vrfy_command = yesalias_maps = hash:/etc/postfix/aliasesalias_database = hash:/etc/postfix/aliasesvirtual_mailBox_base = /var/spool/mail/virtualvirtual_mailBox_maps = MysqL:/etc/postfix/MysqL_mailBox.cfvirtual_alias_maps = MysqL:/etc/postfix/MysqL_alias.cfvirtual_mailBox_domains = MysqL:/etc/postfix/MysqL_domains.cfvirtual_uID_maps = static:5000virtual_gID_maps = static:5000content_filter = amavis:[127.0.0.1]:10024

/etc/postfix/master.cf:

# Postfix master process configuration @R_404_6852@.  For details on the format# of the @R_404_6852@,see the master(5) manual page (command: "man 5 master").## Do not forget to execute "postfix reload" after editing this @R_404_6852@.## ==========================================================================# service type  private unpriv  chroot  wakeup  maxproc command + args#               (yes)   (yes)   (yes)   (never) (100)# ==========================================================================smtp      inet  n       -       -       -       -       smtpd#smtp      inet  n       -       -       -       1       postscreen#smtpd     pass  -       -       -       -       -       smtpd#dnsblog   unix  -       -       -       -       0       dnsblog#tlsproxy  unix  -       -       -       -       0       tlsproxysubmission inet n       -       n       -       -       smtpd  -o smtpd_sasl_auth_enable=yes  -o smtpd_tls_auth_only=yes  -o smtpd_clIEnt_restrictions=permit_sasl_authenticated,reject  -o smtpd_sasl_security_options=noanonymous,noplaintext  -o smtpd_sasl_tls_security_options=noanonymous#  -o syslog_name=postfix/submission#  -o smtpd_tls_security_level=encrypt#  -o smtpd_sasl_auth_enable=yes#  -o smtpd_clIEnt_restrictions=permit_sasl_authenticated,reject#  -o milter_macro_daemon_name=ORIGINATINGsmtps     inet  n       -       -       -       -       smtpd  -o smtpd_tls_wrappermode=yes  -o smtpd_sasl_auth_enable=yes  -o smtpd_tls_auth_only=yes  -o smtpd_clIEnt_restrictions=permit_sasl_authenticated,noplaintext  -o smtpd_sasl_tls_security_options=noanonymous#  -o syslog_name=postfix/smtps#  -o smtpd_tls_wrappermode=yes#  -o smtpd_sasl_auth_enable=yes#  -o smtpd_clIEnt_restrictions=permit_sasl_authenticated,reject#  -o milter_macro_daemon_name=ORIGINATING#628       inet  n       -       -       -       -       qmqpdpickup    fifo  n       -       -       60      1       pickup  -o content_filter=  -o receive_overrIDe_options=no_header_body_checkscleanup   unix  n       -       -       -       0       cleanupqmgr      fifo  n       -       n       300     1       qmgr#qmgr     fifo  n       -       n       300     1       oqmgrtlsmgr    unix  -       -       -       1000?   1       tlsmgrrewrite   unix  -       -       -       -       -       trivial-rewritebounce    unix  -       -       -       -       0       bouncedefer     unix  -       -       -       -       0       bouncetrace     unix  -       -       -       -       0       bounceverify    unix  -       -       -       -       1       verifyflush     unix  n       -       -       1000?   0       flushproxymap  unix  -       -       n       -       -       proxymapproxywrite unix -       -       n       -       1       proxymapsmtp      unix  -       -       -       -       -       smtprelay     unix  -       -       -       -       -       smtp#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5showq     unix  n       -       -       -       -       showqerror     unix  -       -       -       -       -       errorretry     unix  -       -       -       -       -       errordiscard   unix  -       -       -       -       -       discardlocal     unix  -       n       n       -       -       localvirtual   unix  -       n       n       -       -       virtuallmtp      unix  -       -       -       -       -       lmtpanvil     unix  -       -       -       -       1       anvilscache    unix  -       -       -       -       1       scache## ====================================================================# Interfaces to non-Postfix software. Be sure to examine the manual# pages of the non-Postfix software to find out what options it wants.## Many of the following services use the Postfix pipe(8) delivery# agent.  See the pipe(8) man page for information about ${recipIEnt}# and other message envelope options.# ====================================================================## maildrop. See the Postfix MAILDROP_README @R_404_6852@ for details.# Also specify in main.cf: maildrop_destination_recipIEnt_limit=1#maildrop  unix  -       n       n       -       -       pipe  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipIEnt}## ====================================================================## Recent Cyrus versions can use the existing "lmtp" master.cf entry.## Specify in cyrus.conf:#   lmtp    cmd="lmtpd -a" Listen="localhost:lmtp" proto=tcp4## Specify in main.cf one or more of the following:#  mailBox_transport = lmtp:inet:localhost#  virtual_transport = lmtp:inet:localhost## ====================================================================## Cyrus 2.1.5 (Amos Gouaux)# Also specify in main.cf: cyrus_destination_recipIEnt_limit=1##cyrus     unix  -       n       n       -       -       pipe#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}## ====================================================================# old example of delivery via Cyrus.##old-cyrus unix  -       n       n       -       -       pipe#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}## ====================================================================## See the Postfix UUCP_README @R_404_6852@ for configuration details.#uucp      unix  -       n       n       -       -       pipe  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipIEnt)## Other external delivery methods.#ifmail    unix  -       n       n       -       -       pipe  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipIEnt)bsmtp     unix  -       n       n       -       -       pipe  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipIEntscalemail-backend unix  -   n   n   -   2   pipe  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}mailman   unix  -       n       n       -       -       pipe  flags=FR user=List argv=/usr/lib/mailman/bin/postfix-to-mailman.py  ${nexthop} ${user}amavis  unix    -   -   -   -   2   smtp  -o smtp_data_done_timeout=1200  -o smtp_send_xforward_command=yes  -o disable_dns_lookups=yes  -o max_use=20127.0.0.1:10025 inet    n   -   -   -   -   smtpd  -o content_filter=  -o local_recipIEnt_maps=  -o relay_recipIEnt_maps=  -o smtpd_restriction_classes=  -o smtpd_delay_reject=no  -o smtpd_clIEnt_restrictions=permit_mynetworks,reject  -o smtpd_helo_restrictions= -o smtpd_sender_restrictions=  -o smtpd_recipIEnt_restrictions=permit_mynetworks,reject  -o smtpd_data_restrictions=reject_unauth_pipelining  -o smtpd_end_of_data_restrictions=  -o mynetworks=127.0.0.0/8  -o smtpd_error_sleep_time=0  -o smtpd_soft_error_limit=1001  -o smtpd_hard_error_limit=1000  -o smtpd_clIEnt_connection_count_limit=0  -o smtpd_clIEnt_connection_rate_limit=0  -o receive_overrIDe_options=no_header_body_checks,no_unkNown_recipIEnt_checks

/etc/roundcube/main.inc.PHP的相关部分

// ----------------------------------// SMTP// ----------------------------------// SMTP server host (for sending mails).// To use SSL/TLS connection,enter hostname with prefix ssl:// or tls://// If left blank,the PHP mail() function is used// Supported replacement variables:// %h - user's IMAP hostname// %n - http hostname ($_SERVER['SERVER_name'])// %d - domain (http hostname without the first part)// %z - IMAP domain (IMAP hostname without the first part)// For example %n = mail.domain.tld,%d = domain.tld$rcmail_config['smtp_server'] = 'ssl://127.0.0.1';// SMTP port (default is 25; 465 for SSL)$rcmail_config['smtp_port'] = 465;// SMTP username (if required) if you use %u as the username Roundcube// will use the current username for login$rcmail_config['smtp_user'] = '';// SMTP password (if required) if you use %p as the password Roundcube// will use the current user's password for login$rcmail_config['smtp_pass'] = '';// SMTP AUTH type (DIGEST-MD5,CRAM-MD5,LOGIN,PLAIN or empty to use// best server supported one)$rcmail_config['smtp_auth_type'] = '';// Optional SMTP authentication IDentifIEr to be used as authorization proxy$rcmail_config['smtp_auth_cID'] = null;// Optional SMTP authentication password to be used for smtp_auth_cID$rcmail_config['smtp_auth_pw'] = null;// SMTP HELO host // Hostname to give to the Remote Server for SMTP 'HELO' or 'EHLO' messages // Leave this blank and you will get the server variable 'server_name' or // localhost if that isn't defined. $rcmail_config['smtp_helo_host'] = 'mail.mydomain.net';// SMTP connection timeout,in seconds. Default: 0 (no limit)$rcmail_config['smtp_timeout'] = 0;

有任何想法吗?我觉得我在这里走到了尽头.

解决方法 您定义了smtpd_sasl_security_options = noanonymous(这也是默认值).
在你的圆形立方体配置线
$rcmail_config['smtp_server'] = 'ssl://127.0.0.1';

定义使用ssl.
对于匿名ssl连接被拒绝,您必须提供连接的用户名和密码.
但你没有定义:

// SMTP username (if required) if you use %u as the. username Roundcube// will use the current username for login$rcmail_config['smtp_user'] = '';// SMTP password (if required) if you use %p as the password Roundcube// will use the current user's password for login$rcmail_config['smtp_pass'] = '';
总结

以上是内存溢出为你收集整理的linux – Postfix客户端主机被拒绝全部内容,希望文章能够帮你解决linux – Postfix客户端主机被拒绝所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/1035079.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-24
下一篇2022-05-24

发表评论

登录后才能评论

评论列表(0条)

    保存