Hello,
I have a special virtual domain my postfix which is @special.mydomain.tld.
I would like any emails to that address to be sent to a command and as the first parameter of the email have the username from before @special or the entire
username@special.mydomain.tld.
Trouble is this:
I setup in virtual like so:
@special.mydomain.tld :
special@mydomain.tld
and in alias
special@mydomain.tld | /etc/postfix/mycommand
trouble is, the only way to recover is with the X-Original-To: header in the email, but it is not always correct.
Because I also have an alias on my server that points to a mailbox and an email on
special@mydomain.tld, so when emails from from here X-Original-To contains the first email and not the email for
special@mydomain.tld, so I am screwed.
Possibilities:
1. Execute the command directly from a virtual alias ( I can't figure out how to do this )
2. Perhaps something in master.cf could be configured for this? Use transport to deliver it?
3. ... other ideas?
Any ideas what to do or how to do one of the ideas I suggested?
edit:
I have done a bit of research and it would seem that having the code in master.cf is the best way to handle this. What I need to figure out is how to tell the virtual delivery to deliver @special.domain.tld to special in master and everything else to virtual as it does by default.
Thanks,
David