我在configurationpostfix服务器时遇到了问题,当我发出时:telnet myhost 25 outputs:
[root@******** init.d]# telnet localhost 25 Trying 127.0.0.1... Connected to host-********* (127.0.0.1). Escape character is '^]'.
而我没有收到220线。
这是我的main.cnf
# SOFT BOUNCE # # LOCAL PATHNAME INFORMATION # queue_directory = /var/spool/postfix # The command_directory parameter specifies the location of all # postXXX commands. # command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix # QUEUE AND PROCESS OWNERSHIP # mail_owner = postfix # INTERNET HOST AND DOMAIN NAMES # myhostname = mail.xxxxxxxxxx.com mydomain = xxxxxxxxxx.com # SENDING MAIL # # RECEIVING MAIL # inet_interfaces = localhost mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # REJECTING MAIL FOR UNKNOWN LOCAL USERS # #unknown_local_recipient_reject_code = 550 # TRUST AND RELAY CONTROL # mynetworks = 192.168.0.0/16, 127.0.0.0/8 #relay_domains = $mydestination relay_domains = /etc/postfix/relaydomains virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf # INTERNET OR INTRANET # # REJECTING UNKNOWN RELAY USERS # # ADDRESS REWRITING # # ADDRESS REDIRECTION (VIRTUAL DOMAIN) # # "USER HAS MOVED" BOUNCE MESSAGES # # TRANSPORT MAP # # ALIAS DATABASE # #alias_maps = dbm:/etc/aliases alias_maps = hash:/etc/aliases #alias_maps = hash:/etc/aliases, nis:mail.aliases #alias_maps = netinfo:/aliases #alias_database = dbm:/etc/aliases #alias_database = dbm:/etc/mail/aliases alias_database = hash:/etc/aliases #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases # ADDRESS EXTENSIONS (eg, user+foo) # # DELIVERY TO MAILBOX # # JUNK MAIL CONTROLS # # FAST ETRN SERVICE # # SHOW SOFTWARE VERSION OR NOT # # PARALLEL DELIVERY TO THE SAME DESTINATION # # DEBUGGING CONTROL # debug_peer_level = 2 debug_peer_list = 127.0.0.1 #debug_peer_list = some.domain # INSTALL-TIME CONFIGURATION INFORMATION # sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.3.3/samples readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES virtual_alias_domains = mynaturalcure.com #virtual_alias_maps = hash:/etc/postfix/virtual virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/postfix/virtual_regexp virtual_mailbox_base = /home/vmail virtual_transport = virtual virtual_uid_maps = static:89 virtual_minimum_uid = 89 #dovecot_destination_recipient_limit = 1 # authentication # smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname
master.cf
# # Postfix master process configuration file. For details on the format # of the file, see the Postfix master(5) manual page. # # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - n - - smtpd -v -v -D # -o content_filter=smtp-amavis:127.0.0.1:10024 # -o receive_override_options=no_address_mappings #submission inet n - n - - smtpd # -o smtpd_etrn_restrictions=reject # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # smtps inet n - n - - smtpd -v -v -D # -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes #submission inet n - n - - smtpd # -o smtpd_etrn_restrictions=reject # -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes #628 inet n - n - - qmqpd pickup fifo n - n 60 1 pickup -o content_filter= -o receive_override_options=no_header_body_checks cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 oqmgr tlsmgr unix - - n 1000? 1 tlsmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce trace unix - - n - 0 bounce verify unix - - n - 1 verify flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap smtp unix - - n - - smtp -v -v -D # When relaying mail as backup MX, disable fallback_relay to avoid MX loops relay unix - - n - - smtp -o fallback_relay= # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - n - - showq error unix - - n - - error discard unix - - n - - discard local unix - nn - - local virtual unix - nn - - virtual lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 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 file for details. # Also specify in main.cf: maildrop_destination_recipient_limit=1 # maildrop unix - nn - - pipe flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} # # The Cyrus deliver program has changed incompatibly, multiple times. # old-cyrus unix - nn - - pipe flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user} # Cyrus 2.1.5 (Amos Gouaux) # Also specify in main.cf: cyrus_destination_recipient_limit=1 cyrus unix - nn - - pipe user=cyrus argv=/usr/lib/cyrus-imapd/deliver -r ${sender} -m ${extension} ${user} # # See the Postfix UUCP_README file for configuration details. # uucp unix - nn - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) # # Other external delivery methods. # ifmail unix - nn - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - nn - - pipe flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient # # spam/virus section # smtp-amavis unix - - y - 2 smtp # -o smtp_data_done_timeout=1200 # -o disable_dns_lookups=yes -o smtp_send_xforward_command=yes #127.0.0.1:10025 inet n - y - - smtpd # -o content_filter= # -o smtpd_helo_restrictions= # -o smtpd_sender_restrictions= # -o smtpd_recipient_restrictions=permit_mynetworks,reject # -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 receive_override_options=no_header_body_checks # -o smtpd_bind_address=127.0.0.1 # -o smtpd_helo_required=no # -o smtpd_client_restrictions= # -o smtpd_restriction_classes= # -o disable_vrfy_command=no # -o strict_rfc821_envelopes=yes #
对于初学者来说,你已经对configuration进行了相当彻底的configuration。 这意味着任何事情都可能出错。
首先validationpostfix实际上正在监听端口25; netstat -plnt |grep master应该在所有IP或单个IP上显示端口25。
如果你碰到master.cf也是不幸的,那么你可能已经把事情弄得比这里可见的更多了;)
我build议你撤消大部分的破坏,并按照关于如何configurationTLS和SASL的官方文档:
http://www.postfix.org/TLS_README.html
http://www.postfix.org/SASL_README.html
从文档看来,smtpd_banner需要至less包含$ myhostname。
“你必须在文本开头指定$ myhostname,这是SMTP协议所要求的。
来自: http : //www.postfix.org/postconf.5.html#smtpd_banner
你目前的configuration中没有这个。