How to bounce a queued mail

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to bounce a queued mail

Dominic Raferd
We occasionally get emails in our postfix queue that can never be delivered but which are held in the queue for a week before postfix bounces them (example: sender has typed gmail.co instead of gmail.com). I realise this delay is the correct behaviour, but how can I - by exception - bounce a queued mail immediately, with notification back to sender?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to bounce a queued mail

Wietse Venema
Dominic Raferd:
> We occasionally get emails in our postfix queue that can never be delivered
> but which are held in the queue for a week before postfix bounces them
> (example: sender has typed gmail.co instead of gmail.com). I realise this
> delay is the correct behaviour, but how can I - by exception - bounce a
> queued mail immediately, with notification back to sender?

See the thread "How to bounce malformed addresses ?" from a few days ago.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: How to bounce a queued mail

Dominic Raferd


On 15 June 2017 at 11:58, Wietse Venema <[hidden email]> wrote:
Dominic Raferd:
> We occasionally get emails in our postfix queue that can never be delivered
> but which are held in the queue for a week before postfix bounces them
> (example: sender has typed gmail.co instead of gmail.com). I realise this
> delay is the correct behaviour, but how can I - by exception - bounce a
> queued mail immediately, with notification back to sender?

See the thread "How to bounce malformed addresses ?" from a few days ago.

​I think my situation is different. In that thread the problem was that sender never received bounce notification (for some reason). In my situation, the bounce notification will be issued (and received by sender) at the correct time ​(i.e. after one week) but I would like a way to trigger this earlier for some emails stuck in the queue. 

A week's delay in receiving a non-notification message for a response to a sales lead may lose the sale opportunity (you might expect response is to a valid email address but here sender is responding to a manually-entered 'Reply-To' address on a web form). Once sender has the non-notification message (s)he might spot the typo or be able to use another contact method.

Rather than deleting an item from the queue (postsuper -d) I want a way - by exception - of defining it as failed thus triggering immediate bounce notification (i.e. before the week has expired). Maybe some option to postsuper that I haven't understood?

In the meantime I have implemented Noel's helpful suggestions (in the aforementioned thread) for rejecting mails to commonly-mistyped domains - using transport table.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: How to bounce a queued mail

Bastian Blank-3
On Thu, Jun 15, 2017 at 12:34:14PM +0100, Dominic Raferd wrote:
> ​I think my situation is different. In that thread the problem was that
> sender never received bounce notification (for some reason). In my
> situation, the bounce notification will be issued (and received by sender)
> at the correct time ​(i.e. after one week) but I would like a way to
> trigger this earlier for some emails stuck in the queue.

For a dedicated MSA it might be worthwhile to set delay_warning_time to
some smaller time (a few hours).

Bastian

--
You!  What PLANET is this!
                -- McCoy, "The City on the Edge of Forever", stardate 3134.0
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: How to bounce a queued mail

Dominic Raferd

On 15 June 2017 at 13:14, Bastian Blank <[hidden email]> wrote:
On Thu, Jun 15, 2017 at 12:34:14PM +0100, Dominic Raferd wrote:
> ​I think my situation is different. In that thread the problem was that
> sender never received bounce notification (for some reason). In my
> situation, the bounce notification will be issued (and received by sender)
> at the correct time ​(i.e. after one week) but I would like a way to
> trigger this earlier for some emails stuck in the queue.

For a dedicated MSA it might be worthwhile to set delay_warning_time to
some smaller time (a few hours).

​Thanks for the suggestion, I now have done that too (I set 90m).​
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: How to bounce a queued mail

Noel Jones-2
In reply to this post by Dominic Raferd
On 6/15/2017 6:34 AM, Dominic Raferd wrote:

>
>
> On 15 June 2017 at 11:58, Wietse Venema <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Dominic Raferd:
>     > We occasionally get emails in our postfix queue that can never
>     be delivered
>     > but which are held in the queue for a week before postfix
>     bounces them
>     > (example: sender has typed gmail.co <http://gmail.co> instead
>     of gmail.com <http://gmail.com>). I realise this
>     > delay is the correct behaviour, but how can I - by exception -
>     bounce a
>     > queued mail immediately, with notification back to sender?
>
>     See the thread "How to bounce malformed addresses ?" from a few
>     days ago.
>
>
> ​I think my situation is different. In that thread the problem was
> that sender never received bounce notification (for some reason). In

At any rate, the solution is the same. Use transport_maps to return
an immediate error for misbehaving domains such as gmail.co.

If you already have mail queued for gmail.co, you can add the
transport_maps entry as described in the earlier thread and postfix
will bounce the offending message on the next queue run.




  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: How to bounce a queued mail

Dominic Raferd


On 15 June 2017 at 17:02, Noel Jones <[hidden email]> wrote:
On 6/15/2017 6:34 AM, Dominic Raferd wrote:
>
>
> On 15 June 2017 at 11:58, Wietse Venema <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Dominic Raferd:
>     > We occasionally get emails in our postfix queue that can never
>     be delivered
>     > but which are held in the queue for a week before postfix
>     bounces them
>     > (example: sender has typed gmail.co <http://gmail.co> instead
>     of gmail.com <http://gmail.com>). I realise this
>     > delay is the correct behaviour, but how can I - by exception -
>     bounce a
>     > queued mail immediately, with notification back to sender?
>
>     See the thread "How to bounce malformed addresses ?" from a few
>     days ago.
>
>
> ​I think my situation is different. In that thread the problem was
> that sender never received bounce notification (for some reason). In

At any rate, the solution is the same. Use transport_maps to return
an immediate error for misbehaving domains such as gmail.co.

If you already have mail queued for gmail.co, you can add the
transport_maps entry as described in the earlier thread and postfix
will bounce the offending message on the next queue run.

​I have indeed done that, thanks. For the identified misspellings it is a perfect solution.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to bounce a queued mail

Brett @Google
In reply to this post by Dominic Raferd
An interesting question,

can there is a use case where some classes of failure could be configured to be bounced earlier, if the domain does not exist is a good one, it wont ever improve, exyfingers.co will continue to not exist, no matter how long postfix waits

while most might say just don't accept mails with invalid dns names etc., typically such mail comes from a automated source, which can not handle bounces or relay failures. web forms, batch processes, etc., should at least have a noreply@ that is valid but goes to /dev/null, but ideally to a human to do error feedback or a script that reports to somebody in the sender support group

if there is always a valid from (enforce it) you could be more forgiving on the to: (relax it) but only if that mail is being sent from a known source, but then how to enforce to: for other non no-reply sources. afaik we can say sender=x and recipient is valid separately OR, in sender/recipient checks and not AND

can we say iff sender is a particular sender, then allow loose recipient, but otherwise enforce a tight to: recipient validation by default ? doing combined logic,  in other words if the sender is [hidden email] AND ip is a.b.c.d, THEN allow loose recipient ?

in short :

can we do and queries and bind several different (sender|recipient)_checks with an AND logic ?

can we configure some classes of failures, such as dns, to fail more quickly ?

Cheers
Brett

On 15 Jun 2017, at 4:42 pm, Dominic Raferd <[hidden email]> wrote:

We occasionally get emails in our postfix queue that can never be delivered but which are held in the queue for a week before postfix bounces them (example: sender has typed gmail.co instead of gmail.com). I realise this delay is the correct behaviour, but how can I - by exception - bounce a queued mail immediately, with notification back to sender?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to bounce a queued mail

Noel Jones-2
On 6/15/2017 7:37 PM, Brett Maxfield wrote:
> in short :
>
> can we do and queries and bind several different
> (sender|recipient)_checks with an AND logic ?

Yes, you can do all sorts of clever and complex checks with an
external policy service.
http://www.postfix.org/SMTPD_POLICY_README.html

> can we configure some classes of failures, such as dns, to fail more
> quickly ?

Generally, no.  If something fails with a temporary error, how to
reliably automatically distinguish between a "real" site that's
temporarily down from something that will never work?

Postfix can reject domains with a zero-length or null MX record, but
that must be set by the domain owner.
http://www.postfix.org/postconf.5.html#reject_unknown_sender_domain
http://www.postfix.org/postconf.5.html#reject_unknown_recipient_domain


(Surprisingly, hotmal.com has a null MX, but gmail.co doesn't.
Anyone here know someone at Google?;))

I suppose it would be possible for someone to operate a rhsbl
listing domains that persistently don't receive mail. It's not clear
the benefit would outweigh the effort...



  -- Noel Jones
Loading...