Forwarder needs to change [FROM] to forwarder address

Ergensinnl

New member
Joined
Jun 1, 2022
Messages
4
I currently have a client that has an online accountancy account that needs all invoices sent to it to come from one (1) address, namely "[email protected]".

When I make a forwarder, the [from] header is retained as the original sender, when this should be [reply-to] but the [from] should change to "[email protected]"

This is so that all invoices are automatically imported.

Is there a (easy) way to accomplish this?
 
So you mean invoices send to [email protected] should be forwarded to [email protected] if I understand correctly?
But then is the question, how do you want to recognize mail to [email protected] as invoice or as just normal mail? So how to know what/when to forward?

If it's only invoices, then the easiest way to do this would be for the customer to change his email address at the company's he's getting invoices from, which would keep mail settings also official in Exim.

As for the [from] change, maybe somebody else knows.
 
You could maybe achieve this by using Sieve/Pigeonhole to do the forwarding, along with the use of the editHeader extension to Sieve.
 
So you mean invoices send to [email protected] should be forwarded to [email protected] if I understand correctly?
But then is the question, how do you want to recognize mail to [email protected] as invoice or as just normal mail? So how to know what/when to forward?

If it's only invoices, then the easiest way to do this would be for the customer to change his email address at the company's he's getting invoices from, which would keep mail settings also official in Exim.

As for the [from] change, maybe somebody else knows.
No; invoices from all suppliers should mail to "[email protected]" which forwards it to "import.invoices.####@onlineaccountant.tld"

In order to import the invoices the [from] should read "[email protected]" as to prevent spam they (The online accountant) only accept mail from that ([email protected]) address.

I hope this clarifies it.
 
Please don't quote full posts (do not use reply button but reply box). ;)

Ah oke so it's already received at 1 address. I don't know how to prevent spam that way, since forwarders just forward blindly if I'm not mistaken. Which would mean spam to [email protected] would just be forwarded to import.invoices.##@onlineaccountent.tld but only direct spam to that address might be prevented.

You might check this post which changes the TO, maybe somehow to be used for the from:

Or I found this part, which is talking about rewriting senders address (so the from address).
You might need to put that into the exim.conf and take care exim.conf will not be overwritten anymore.

There is somebody knowing a lot of e-mail here, that is @mxroute and maybe he can shed his light on your question and maybe has a solution.
 
That might work, but since i'm no coder I'm not 100% sure, you might want to test it.
Or wait until mxroute passes by, maybe he can confirm this more surely (or somebody else).
 
Funny thing; It worked, but it also created a problem that I'm trying to solve (feedback loop).

I am currently testing the following:

Code:
if "$h_to" contains "[email protected]"
then
    headers remove "reply-to"
    headers add "reply-to: $h_from"
    headers remove "From"
    headers add "From: [email protected]"
endif

So I remove/add the [reply-to] to reflect the original sender
then I change the [from] to the address specified.
 
Back
Top