LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-09-2012, 01:13 AM   #1
avenitsh
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
Postfix relay won't send non-delivery notifications


Hi everybody and a happy new year!

We currently have a problem with our mail server, the situation is as follows:

- We are using an OpenEMM server running on CentOS 5.7 to send newsletters to our clients. The server uses sendmail for outgoing mail

- Sendmail is configured to relay e-mails by our company's mail server using SASL Auth. The company mail server is running postfix.

This setup is working so far, e-mails sent by our OpenEMM server are relayed and delivered to the final recepient - No problem here.

However, for non-existing recepients, postfix will not send any non-delivery notification back to sendmail - And that's our problem.

For testing, we sent e-mails from our OpenEMM server by commandline to an invalid e-mail address:
Code:
echo "This is a test" | sendmail -fnews@news.our-emmserver.com foo@bar.invalid
On our company mail server (Postfix) this will produce the following log:
Code:
Jan  7 06:17:41 mail postfix/cleanup[5156]: 03062156CC28: message-id=<201201070517.q075HVfT010764@www3.our-company.com>
Jan  7 06:17:41 mail postfix/qmgr[3367]: 03062156CC28: from=<news@news.our-emmserver.com>, size=750, nrcpt=1 (queue active)
Jan  7 06:17:42 mail postfix/smtp[5157]: 03062156CC28: to=<foo@bar.invalid>, relay=none, delay=1.4, delays=1.3/0.01/0.11/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=bar.invalid type=A: Host not found)
Jan  7 06:17:42 mail postfix/bounce[5159]: 03062156CC28: sender non-delivery notification: 16E22156CC2A
Jan  7 06:17:42 mail postfix/qmgr[3367]: 03062156CC28: removed
This case works as it should. Bounce sends a non-delivery notification back to our EMM server which can be received and processed.

When sending by EMM however, the log is slightly different:
Code:
Jan  7 05:18:14 mail postfix/cleanup[4077]: F3FCD156CC28: message-id=<20120107121736-1.1.c.7.0.97lfw7777k@openemm.invalid>
Jan  7 05:18:14 mail postfix/qmgr[3367]: F3FCD156CC28: from=<news@news.our-emmserver.com>, size=2071, nrcpt=1 (queue active)
Jan  7 05:18:14 mail postfix/smtp[4078]: F3FCD156CC28: to=<foo@bar.invalid>, relay=none, delay=1.3, delays=1.3/0/0.02/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=bar.invalid type=A: Host not found)
Jan  7 05:18:14 mail postfix/qmgr[3367]: F3FCD156CC28: removed
In this case, Postfix won't send any non-delivery notification, and we can't figure out why.

I'm also attaching the relevant parts of the Sendmail logs on the EMM server:

By commandline:
Code:
Jan  7 13:17:34 www3 sendmail[10764]: q075HVfT010764: to=foo@bar.invalid, ctladdr=news@news.our-emmserver.com (0/0), delay=00:00:03, xdelay=00:00:01, mailer=relay, pri=30015, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q075HX8e010765 Message accepted for delivery)
By OpenEMM (note there is no ctladdr in this case - maybe that's the problem?):
Code:
Jan  7 12:18:15 www3 sendmail[10500]: 2900T1f1d00000003: to=<foo@bar.invalid>, delay=00:00:39, xdelay=00:00:04, mailer=relay, pri=0, relay=mail.our-company.com. [xxx.xxx.xxx.xxx], dsn=2.0.0, stat=Sent (Ok: queued as F3FCD156CC28)
We've already spent days trying to figure out a solution, but the problem still exists. Maybe somebody can point us into the right direction?

Many thanks & best regards,
Andy
 
Old 01-11-2012, 01:47 AM   #2
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
With the EMM send, are the messages staying on the queue? Typically issues for name related failures result in deferrals as they are often transient, but this kind of failure should result in a 4xx error code. Issue 'mailq' and take a look to see if the message is sat there.

Typically messages stuck on the queue - if you've not changed the defaults - will retry with decreasing frequency for about a week, when they will finally bounce if they fail.

Why this would happen with EMM, but not with a CLI submitted message I can't be sure, but I suspect it may be related to the submission method.
 
Old 01-11-2012, 01:59 AM   #3
avenitsh
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Leslie,

thanks for your reply! Actually the messages are being sent out, both by CLI and EMM - This works fine.

Our only problem is, when sending by EMM, the Postfix server won't send any non-delivery report back to sendmail in case the mail is undeliverable (ex. to foo@bar.invalid). However if we send the same message by CLI, Postfix will send it.

So we're wondering if there is maybe some kind of parameter which EMM could pass to the local sendmail instance to explicitly tell the smart host not to send any non-delivery report. Or maybe it's related to no ctladdr being present when sending by EMM (see log snippet). We've done extensive research on this already, but were unable to find a solution.

Any other ideas?

Best regards,
Andy
 
Old 01-11-2012, 02:32 AM   #4
leslie_jones
Member
 
Registered: Sep 2011
Posts: 130

Rep: Reputation: Disabled
Not entirely sure I follow here.

From your example log, your error is *not* related to the address (foo@bar.invalid) being invalid, but because the DNS name cannot be found: "Host or domain name not found. Name service error for name=bar.invalid type=A: Host not found" NOT because the recipient is invalid.

This specific error can be transient as it could be down to a simple DNS server failure to provide the host name. That DNS issue may work itself out quickly, so typical behaviour would be to retain the message on the queue and retry it frequently. That said, I would expect to see a 4xx status code during the SMTP session for this - but it semi looks like you've got some weird 544 response.

So your error message above is, strictly speaking, nothing to do with an invalid recipient and should not bounce as such. Hence my remark, try it again, check the Postfix queue - you'll probably see the message sat there in a retry state of limbo.

To cover 'Invalid Recipients' for completeness;
Invalid recipients (no such user) generate 5xx SMTP codes (often thought of as permanent failures). Typically Postfix talks to the remote sever, offers RCPT TO user@domain.tld during the SMTP transaction and will either get a 200 go ahead, or 550 no such user. No bounce is produced as the message has never been delivered to the remote system, it has rejected it during the SMTP phase with an error code, not a bounce. Your Postfix is left holding the baby and *should* then generate an NDR and send the message back to the RETURN PATH address. Remote servers should not produce bounces after taking messages, this would be considered to be 'backscattering'.

Some (badly set up) servers (Exchange used to do this by default) accept mail for anybody at the domain name (catch all). This may result in mail vanishing into a black hole, but it won't result in any kind of bounce.

If your Postfix instance is unable to deliver a message because it gets a permanent failure (5xx) it would normally tell the client connected to it at the point it is trying to send the message using SMTP status codes, not bounces. I'm not familiar with EMM but it appears to be acting as 'the client' here. When you send via the CLI using Sendmail (the client) it seems to be successfully reporting back to you via a bounce. I suspect that is because Sendmail is injecting the message into Postfix in a different way (not via SMTP, but using local pickup). Hence you get the different behaviour - however this is just a 'best guess'.

Breaking all that waffle down into short English I suspect Postfix is telling EMM 'hey dude, that's an error generating mail you have there, so I'm not taking it' and EMM is left holding it like a twonk not knowing what to do with it. I stress, however, I am *not* familiar with EMM.
 
  


Reply



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
Use postfix send mail return 'relay access denied' ??need help!! xiaolong85 Linux - Server 6 01-24-2010 12:36 PM
Postfix+Dovecot error : RELAY ACCESS DENIED when send mail out to Other domain simon.unix Linux - Networking 6 09-16-2009 10:54 AM
"Relay acces denied" when trying to send an email to the host (postfix) ellion0815 Linux - Server 10 03-14-2008 07:27 AM
Postfix won't send send to outside LAN kotori Linux - Server 11 11-13-2006 06:16 AM
using postfix to send through a relay server that requires authentication surban99 Linux - Software 1 04-27-2004 06:16 PM

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

All times are GMT -5. The time now is 05:02 PM.

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