Web服务器从Postfix发送电子邮件

我的networking服务器通过postfix从网站发送电子邮件有问题。 我有运行Ubuntu 12.04.5和使用Apachenetworking服务器的服务器。 我在安装了postfix的服务器上安装了virtualmin。 Web服务器部分运行得很好,但联系表单的电子邮件是使用PHP函数邮件的网站上的问题。

服务器本身不是电子邮件服务器。 它不承载任何电子邮件。 但是,在日志文件中有错误说邮件循环回自己。 这是来自日志文件的条目。

Jan 12 21:20:37 postfix/smtp[19519]: 261BE184BE: to=<[email protected]>, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for domainname.com loops back to myself 

我在网上做了一些研究,说你需要将你的domainname.com添加到你的main.cf文件中,然后重新启动它。 我这样做,然后从邮件日志中得到未知的用户:信息错误。 我觉得在main.cf文件中添加mydomains的域名是正确的,如果我使用这个作为电子邮件服务器。 有一个存在的domainname.com MXlogging,并指向一个完全不同的服务器。

我不知道如何解决这个问题,以便来自服务器的电子邮件实际上查找MXlogging并发送到相应的电子邮件服务器。 如果这有帮助,我已经发布main.cf文件来看看:

  # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/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_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = webserver.domainname.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = webserver.domainname.com, localhost.domainname.com, , localhost, newdomainname.com relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all virtual_alias_maps = hash:/etc/postfix/virtual sender_bcc_maps = hash:/etc/postfix/bcc home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination allow_percent_hack = no 

感谢任何帮助,让我的电子邮件被发送到正确的电子邮件服务器。