LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-12-2011, 10:06 AM   #1
tws
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
Postfix relay problem


Hi there.

The scenario:
We have an external server that runs HTTP/DB servers for out shop system.
Then, there's our local, in-house infrastructure that runs a.. yeah... Exchange 2010.

The shop system on the external server needs to send mails to customers (order confirmations, invoices, etc.). seing as sending them directly through the local MTA (Postfix) would cause mail delivery problems because of reverse DNS issues, i've set the Postfix MTA to act as a satellite to our in-house Exchange Server, so the Exchange sends the mail instead, giving recipient mail servers a valid reverse DNS lookup.

Now, mails sent by the (proprietary, uneditable) shop system are relayed correctly and sent to the target e-mail address.
My problem is: Mails not sent by the shop system, but by our own PHP scripts which run on that same external servers, are NOT relayed properly.
So the Exchange is fine with the mails sent by the shop system, but not the mails sent by our scripts.

This is what i get in the mail.log:

The successfully relayed mail sent by the shop system:
Quote:
Jan 12 16:10:42 appenzeller postfix/pickup[24729]: 95EFD2A22B7: uid=33 from=<www-data>
Jan 12 16:10:42 appenzeller postfix/cleanup[25330]: 95EFD2A22B7: message-id=<20110112151042.95EFD2A22B7@local.domain.tld>
Jan 12 16:10:42 appenzeller postfix/qmgr[24732]: 95EFD2A22B7: from=<www-data@local.domain.tld>, size=2482, nrcpt=1 (queue active)
Jan 12 16:10:44 appenzeller postfix/smtp[25267]: 95EFD2A22B7: to=<my.email@company.tld>, relay=external.mailserver.tld[1.2.3.4]:25, delay=2.3, delays=0.05/0/0.08/2.2, dsn=2.6.0, status=sent (250 2.6.0 <20110112151042.95EFD2A22B7@local.domain.tld> [InternalId=306220] Queued mail for delivery)
Jan 12 16:10:44 appenzeller postfix/qmgr[24732]: 95EFD2A22B7: removed
And here the unsuccessfully relayed mail sent by our scripts:
Quote:
Jan 12 16:10:15 appenzeller postfix/pickup[24729]: BC9432A22B7: uid=33 from=<www-data>
Jan 12 16:10:15 appenzeller postfix/cleanup[25330]: BC9432A22B7: message-id=<20110112151015.BC9432A22B7@local.domain.tld>
Jan 12 16:10:15 appenzeller postfix/qmgr[24732]: BC9432A22B7: from=<www-data@local.domain.tld>, size=2057, nrcpt=1 (queue active)
Jan 12 16:10:15 appenzeller postfix/smtp[25267]: BC9432A22B7: to=<my.email@company.tld>, relay=external.mailserver.tld[1.2.3.4]:25, delay=0.16, delays=0.02/0/0.07/0.06, dsn=5.7.1, status=bounced (host external.mailserver.tld[1.2.3.4] said: 554 5.7.1 This message has been blocked because the return email domain is invalid.(domain name normal.email@company.tld has invalid syntax) (in reply to end of DATA command))
Jan 12 16:10:15 appenzeller postfix/cleanup[25330]: E1D472A22BF: message-id=<20110112151015.E1D472A22BF@local.domain.tld>
Jan 12 16:10:15 appenzeller postfix/bounce[25268]: BC9432A22B7: sender non-delivery notification: E1D472A22BF
Jan 12 16:10:15 appenzeller postfix/qmgr[24732]: E1D472A22BF: from=<>, size=4271, nrcpt=1 (queue active)
Jan 12 16:10:15 appenzeller postfix/qmgr[24732]: BC9432A22B7: removed
Jan 12 16:10:21 appenzeller postfix/smtp[25267]: E1D472A22BF: to=<www-data@local.domain.tld>, relay=external.mailserver.tld[1.2.3.4]:25, delay=5.1, delays=0/0/0.07/5, dsn=5.7.1, status=bounced (host external.mailserver.tld[1.2.3.4] said: 550 5.7.1 Unable to relay (in reply to RCPT TO command))
Jan 12 16:10:26 appenzeller postfix/qmgr[24732]: E1D472A22BF: removed
external.mailserver.tld being our inhouse Exchange server, and normal.email@company.tld being the From/Reply-To email address set in the PHP scripts.

I can't really know for certain what exactly the shop system does behind the scenes, but what i do know is that the PHP scripts send mail through the normal mail() function with the only extra headers being the From and Reply-To headers.

I tried google-ing for the error message, but all i get are a million entries for a million different problems than mine.

Any hints?

Thanks!
 
Old 01-12-2011, 12:06 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
What I would do is look at the raw headers for each e-mail and see what the differences are. I suspect there is a spacing or other similar error (perhaps a special character) in the php scripts causing the issue.

The reason I suspect a formatting problem with the domain name is this line.
Code:
Jan 12 16:10:15 appenzeller postfix/smtp[25267]: BC9432A22B7: to=<my.email@company.tld>,
relay=external.mailserver.tld[1.2.3.4]:25, delay=0.16, delays=0.02/0/0.07/0.06, dsn=5.7.1, 
status=bounced (host external.mailserver.tld[1.2.3.4] said: 554 5.7.1 This message has been 
blocked because the return email domain is invalid.(domain name normal.email@company.tld has 
invalid syntax) (in reply to end of DATA command))
The problem may actually lie in the From Address generated by the PHP scripts. At least that is where I would start.

My other thought is I would set up Reverse DNS and just let postfix handle the mail rather than forwarding it to your exchange box. I think that is cleaner and probably more secure. But that's just me and I don't know all the particulars of your setup.
 
  


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
Postfix relay problem i_nomad Linux - Server 4 08-19-2009 10:27 AM
postfix relay problem smurfix Linux - Newbie 26 02-22-2005 10:56 PM
Postfix Relay Problem kubicon Linux - Networking 3 06-11-2004 06:41 PM
postfix relay problem sopiaz57 Linux - General 0 03-03-2004 10:25 AM
Postfix relay problem txtoolman Linux - Software 0 12-16-2003 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration