LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-19-2010, 05:03 PM   #1
modulaaron
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
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.

Last edited by modulaaron; 12-19-2010 at 05:19 PM.
 
Old 12-19-2010, 07:17 PM   #2
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
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.
 
Old 12-19-2010, 07:41 PM   #3
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
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.
 
Old 12-19-2010, 07:57 PM   #4
modulaaron
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending mail from win xp to linux imap mail server cvdsamy Red Hat 2 05-30-2009 12:37 AM
sending mail from our mail server nima0102 Linux - Server 4 02-22-2009 03:42 AM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
Sending mail through mail server. TheRealDeal Linux - Networking 17 09-11-2004 11:31 PM
Sending mail through mail server. TheRealDeal Linux - Networking 0 09-06-2004 11:43 PM


All times are GMT -5. The time now is 01:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration