LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mail server not sending mail to location defined in MX record (http://www.linuxquestions.org/questions/linux-software-2/mail-server-not-sending-mail-to-location-defined-in-mx-record-851254/)

modulaaron 12-19-2010 05:03 PM

Mail server not sending mail to location defined in MX record
 
Hi,

I have an issue with Postfix that likely requires a change in my setup. The issue is this:

johndoe@mycompany.com is an email address located at mail.mycompany.com, a remote mail server and the MX record location of the domain. When I send mail to this address from the web server (mycompany.com), the mail bounces because it thinks that this address is located on the localhost instead of on the remote mail server.

For example, when I run:

Code:

sendmail -t < mail.txt
where mail.txt contains:

Code:

to: johndoe@mycompany.com
subject: Test
from: www-data@mycompany.com

Test test test

the mail bounces as per /var/log/mail.log:

Code:

Dec 19 14:48:52 swan postfix/local[15718]: 211C818B0B: to=<johndoe@mycompany.com>, relay=local, delay=0.22, delays=0.07/0.01/0/0.14, dsn=5.1.1, status=bounced (unknown user: "johndoe")
My postconf -n output is as follows:

Code:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = mydomain.com, localhost.localdomain, localhost
myhostname = mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

Any advice would be most appreciated. Thanks.

never say never 12-19-2010 07:17 PM

Change:
Code:

mydestination = mydomain.com, localhost.localdomain, localhost
myhostname = mydomain.com

To:
Code:

mydestination = host.mydomain.com, localhost.localdomain, localhost
myhostname = host.mydomain.com

where host is the hostname of your server. Right now postfix is configured to handle mail for the entire domain. I think that will do it.

never say never 12-19-2010 07:41 PM

To exapnd on my previous post just a bit. "mydestination" are the mail domains that are considered local. I believe this is the root of your problem. "myhostname" is how the server identifies itself. Best to have the hostname or www, something that shows the mail came from your web server, that will help you when it comes to troubleshooting.

modulaaron 12-19-2010 07:57 PM

That fixed it - thank you!

One more issue remains:

Code:

Dec 19 17:42:41 swan postfix/smtp[17100]: 3EF6918B0C: to=<johndoe@mydomain.com>, relay=mail.mydomain.com[xxx.xxx.xxx.xxx]:25, delay=0.26, delays=0.01/0/0.17/0.07, dsn=5.0.0, status=bounced (host mail.mydomain.com[216.97.239.95] said: 550-Verification failed for <www-data@mydomain.com> 550-The mail server could not deliver mail to www-data@mydomain.com.  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
I updated my reverse DNS about an hour ago, so hopefully this will resolve itself if I give it more time.

Thanks again :)


All times are GMT -5. The time now is 03:08 AM.