Upon 550-5.1.1 errors, send report to replyTo instead

Bug #1468172 reported by Michael Heuberger
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Currently Postfix reports delivery errors back to the sender defined in the `From` field.

But can you alter this behavior and have Postfix report it back through the email address defined in `ReplyTo` if there s one.

We have a server-side app here that sets the `From` field to `noreply@....` but the replyTo field to the email address of that user triggering the email to be sent. This to circumvent SPF issues.

Unfortunately this has one drawback and returns `Undelivered Mail Returned to Sender` reports back to `noreply@...` but we want these to be returned back to the real user, defined in the `ReplyTo` field.

I hope this change request makes sense and you can do it?

Many thanks
Michael

Revision history for this message
Kenyon Ralph (kralph) wrote :

No, this is not possible. You have a fundamental misunderstanding of how email works. The "reply-to" field is part of the message content. A 550 rejection happens before the SMTP client even gets to start sending message content. In other words, the 550 rejection occurs based on the message envelope; the message contents are never seen by the server. You need to fix your app so that it uses a valid envelope from address.

Changed in postfix (Ubuntu):
status: New → Invalid
Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

I see. What about the return-path? Can I use the Return-Path instead for redirecting these error reports to sender A? The return path is defined on the envelope too.

Problem is that our app is sending videomails from any sender A to any receiver B through a public website.

If we'd use any email address in the From-Field, then chances are pretty high that these get classified as spam due to SPF issues. That's our problem here and the reason we are using <email address hidden> for any sender A's from email address.

Just want to return the 550 error reports to the sender A so that sender A gets notified when his/her videomail didn't arrive at receiver B.

Any suggestions?

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Or should I add SMTP-based code in the app to validate the receiver B's email address before sending? Feel free to see the app yourself to get a better picture: www.videomail.io - thanks

Revision history for this message
Kenyon Ralph (kralph) wrote :

I think you're still confused on the difference between envelope-From and header From. SPF doesn't care about the header From, it cares about the envelope-From (and HELO). You can set the header From to the user's address without SPF issues. But that user still won't get bounces. Not much you can do about that other than forward the bounce to the user.

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Hmmm, that makes it difficult. Videomail has in avg. 260 video emails every day and about 5% result in error bounces.

Is there no other way around? Really need to solve this. How to automatically redirect the bounces to the sender?

What's the current logic in Postfix to decide where to send the bounce? The Envelope-From or the Header-From? Can you point me to the source code where it is decided?

And would it make a difference to alter the Envelope-From? Or to circumvent the SPF validation with a hack? How do others solve this problem?

Revision history for this message
Scott Kitterman (kitterman) wrote :

Altering the envelope-from would solve this problem, but would circumvent SPF as you suggest. What you might do is use your mail from to send the mail and then use SRS (Sender Rewriting Service) to redirect bounce messages to other domains, but I don't know of a simple solution for setting that up.

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Dang - right. Thanks for your advice. I better do not mess with the envelope-from and SPF.

How can I inform my videomail users automatically when their entered email address caused a 550? Looks like that's a problem I have to crack myself somewhere else somehow.

SRS? Had a look but looks a bit too complicated I think. Do you have any other ideas/ suggestions?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.