Mailing List Archive

Router and transport for modifing message
Hello. I'm using transport_filter to modify certain incomimg e-mail (for
example, to set proper encoding for some headers). Based on others
experience here is my configuration:

# Router
send_to_modify_email:
senders = <list_of_senders_whose_email_is_bad>
domains = +local_domains
no_verify
condition = ${if !eq
{$received_protocol}{send_to_modify_email{1}{0}}
driver = accept
transport = send_to_modify_email

# Transport
send_to_modify_email:
driver = pipe
command = /usr/local/exim/bin/exim -oMr send_to_modify_email -bS
use_bsmtp = true
transport_filter = <path_to_modifing_script>

My question is - is there any way to just pass e-mail through modifing
script *without re-injecting* email via "command = ..."?
Basically I'd like to have the following "simple-and-clean" scheme:

Incoming e-mail -> Pass to send_to_modify_email ROUTER -> Pass modified
e-mail to some other ROUTER for real delivery.

Thanks in advance.


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Router and transport for modifing message [ In reply to ]
On Tue, Apr 25, 2023 at 11:59:25AM +0300, mouse via Exim-users wrote:

> Hello. I'm using transport_filter to modify certain incomimg e-mail
> (for example, to set proper encoding for some headers). Based on
> others experience here is my configuration:

> # Router
> send_to_modify_email:
> senders = <list_of_senders_whose_email_is_bad>
> domains = +local_domains
> no_verify
> condition = ${if !eq {$received_protocol}{send_to_modify_email{1}{0}}
> driver = accept
> transport = send_to_modify_email
>
> # Transport
> send_to_modify_email:
> driver = pipe
> command = /usr/local/exim/bin/exim -oMr send_to_modify_email -bS
> use_bsmtp = true
> transport_filter = <path_to_modifing_script>

> My question is - is there any way to just pass e-mail through
> modifing script *without re-injecting* email via "command = ..."?

Why do you need to re-inject? By the time a transport is selected,
exim is already chomping at the bit to deliver the message. A
transport_filter just changes the contents of the message but not the
metadata or how it's gonna be delivered. What's the problem with just
proceeding with delivery after the filter runs?

--
Ian

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Router and transport for modifing message [ In reply to ]
On 2023-04-25, mouse via Exim-users <exim-users@exim.org> wrote:
> Hello. I'm using transport_filter to modify certain incomimg e-mail (for
> example, to set proper encoding for some headers). Based on others
> experience here is my configuration:

> My question is - is there any way to just pass e-mail through modifing
> script *without re-injecting* email via "command = ..."?
> Basically I'd like to have the following "simple-and-clean" scheme:
>
> Incoming e-mail -> Pass to send_to_modify_email ROUTER -> Pass modified
> e-mail to some other ROUTER for real delivery.

Do the mofication instead in the real delivery transport

transport_filter=${if \
inlist{list_of_senders_whose_email_is_bad}{$sender_address}\
{<path_to_modifing_script>}}

--
Jasen.
???????? ????? ???????

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/