我有我的机器上运行的后缀(随着centos最小),但今天我configuration它使用我的域名为例,这是我的域名example.com 。 这是我的configuration:
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 header_checks = regexp:/etc/postfix/header_checks html_directory = no inet_interfaces = all inet_protocols = ipv4 mail_owner = postfix mailbox_size_limit = 1073741824 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 10485760 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = example.com myhostname = mail.example.com mynetworks = 127.0.0.0/8 mynetworks_style = host myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relayhost = smtp.$mydomain sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_banner = $myhostname ESMTP $mail_name smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject unknown_local_recipient_reject_code = 550
我需要一个电子邮件帐户才能发送电子邮件(密码检索等)。 我今天在某个地方看过,如果你创build了unix账户,postfix将把它识别为电子邮件地址,所以如果你的账户用户名是ant你的电子邮件地址是[email protected] 。
所以我testing了一下,并试图发送邮件到[email protected] ,我成功地收到了邮件。
当我尝试使用ant任务脚本发送电子邮件时,我无法连接:
Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: mail.example.com, port: 25; nested exception is: java.net.ConnectException: Connection timed out: connect
我在这里错过了什么?
编辑
我能够telnet到本地主机:
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 mail.example.com ESMTP Postfix
什么是拒绝传入连接到后缀你有一个防火墙。
看看输出:
iptables-save
你错过了DNS。 mail.example.com必须parsing为127.0.0.1,否则必须将mail.example.com的IP添加到我的mynetworks 。