put message on HOLD based on sender & recipient

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

put message on HOLD based on sender & recipient

patpro
Hello,

What would be the best way to hold an incoming email that match both criteria From=foo and To=bar?
First I thought about header_checks with something like:

if /^From:.*foo.*/
/^To:.*bar.*/ HOLD
endif

but obviously it can't work as headers are processed 1 by 1.
The final solution will have to match a unique From: and multiple To:, if that's of any importance.

any idea?
thanks,
patpro
Reply | Threaded
Open this post in threaded view
|

Re: put message on HOLD based on sender & recipient

Bill Cole-3
On 15 Sep 2020, at 16:55, Patrick Proniewski wrote:

> Hello,
>
> What would be the best way to hold an incoming email that match both
> criteria From=foo and To=bar?
> First I thought about header_checks with something like:
>
> if /^From:.*foo.*/
> /^To:.*bar.*/ HOLD
> endif
>
> but obviously it can't work as headers are processed 1 by 1.

Right: header_checks CANNOT do this.

This requires a comprehensive filtering tool. Because milters can return
a "quarantine" reply, a milter would be the obvious choice. MIMEDefang
is one which could do this rather easily.


--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not For Hire (currently)
Reply | Threaded
Open this post in threaded view
|

Re: put message on HOLD based on sender & recipient

Wietse Venema
In reply to this post by patpro
Patrick Proniewski:

> Hello,
>
> What would be the best way to hold an incoming email that match both criteria From=foo and To=bar?
> First I thought about header_checks with something like:
>
> if /^From:.*foo.*/
> /^To:.*bar.*/ HOLD
> endif
>
> but obviously it can't work as headers are processed 1 by 1.
> The final solution will have to match a unique From: and multiple To:, if that's of any importance.
>

http://www.postfwd.org supports conditions on sender and recipient.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: put message on HOLD based on sender & recipient

patpro
In reply to this post by Bill Cole-3
September 15, 2020 11:52 PM, "Bill Cole" <[hidden email]> wrote:

> On 15 Sep 2020, at 16:55, Patrick Proniewski wrote:
>
>> Hello,
>>
>> What would be the best way to hold an incoming email that match both > criteria From=foo and
>> To=bar?
>> First I thought about header_checks with something like:
>>
>> if /^From:.*foo.*/
>> /^To:.*bar.*/ HOLD
>> endif
>>
>> but obviously it can't work as headers are processed 1 by 1.
>
> Right: header_checks CANNOT do this.
>
> This requires a comprehensive filtering tool. Because milters can return a "quarantine" reply, a
> milter would be the obvious choice. MIMEDefang is one which could do this rather easily.


Thanks Bill, I'll take a look at MIMEDefang.

regards,
patpro
Reply | Threaded
Open this post in threaded view
|

Re: put message on HOLD based on sender & recipient

patpro
In reply to this post by Wietse Venema
September 16, 2020 12:30 AM, "Wietse Venema" <[hidden email]> wrote:

> Patrick Proniewski:
>
>> Hello,
>>
>> What would be the best way to hold an incoming email that match both criteria From=foo and To=bar?
>> First I thought about header_checks with something like:
>>
>> if /^From:.*foo.*/
>> /^To:.*bar.*/ HOLD
>> endif
>>
>> but obviously it can't work as headers are processed 1 by 1.
>> The final solution will have to match a unique From: and multiple To:, if that's of any importance.
>
> http://www.postfwd.org supports conditions on sender and recipient.


Looks very powerful, may be too much for my needs but I'll take a closer look.

Thanks,
patpro