how to rewrite headers to change from and to fields?
Posted: 03 May 2023, 04:56
I am trying to create a filter to rewrite the from and to of messages we send to our internal fax service.
My requirements are:
Determine if the message is from one of three allowed domains
If yes, then determine if the message is being sent to our fax software.
if yes, then
change the from address to the address our fax software will respond to
change the to address to the format our fax software knows how to handle
add some headers for our own tracking.
This filter is in a new file in /usr/local/cpanel/etc/exim/sysfilter/options
This is what I have so far,
if $h_from: contains "@(companya.org|companyb.net|companyc.com)"
then if $h_to: contains "@fax.companya.org"
then
headers add "Actual-From: $h_from:"
headers remove From
headers add "From: sendfax@companya.org"
headers remove Reply-To
headers add "Reply-To: $h_from"
headers add "Actual-To: $h_to:"
headers remove To
headers add "To: $local_part@companyc.com"
endif
endif
Any pointers or suggestions would be most appreciated!
Thanks
My requirements are:
Determine if the message is from one of three allowed domains
If yes, then determine if the message is being sent to our fax software.
if yes, then
change the from address to the address our fax software will respond to
change the to address to the format our fax software knows how to handle
add some headers for our own tracking.
This filter is in a new file in /usr/local/cpanel/etc/exim/sysfilter/options
This is what I have so far,
if $h_from: contains "@(companya.org|companyb.net|companyc.com)"
then if $h_to: contains "@fax.companya.org"
then
headers add "Actual-From: $h_from:"
headers remove From
headers add "From: sendfax@companya.org"
headers remove Reply-To
headers add "Reply-To: $h_from"
headers add "Actual-To: $h_to:"
headers remove To
headers add "To: $local_part@companyc.com"
endif
endif
Any pointers or suggestions would be most appreciated!
Thanks