Rewriting recipient address for catchall address?

sweth

New member
Joined
Mar 10, 2009
Messages
3
I'm trying to migrate a virtual email domain on a server (running postfix) to another server running directadmin.

The postfix setup has a regex table that defines destination addresses; including a catchall rule like

/(\w+)@address.com/ [email protected]

so that all of the emails sent to address.com that don't have explicit forwarding rules go to [email protected], but with mail-sorting suffixes so we know who the original recipient address was. (Yes, I know that the original recipient address is in the Received: header, but it's much easier to parse that info from a single destination address than it is to parse multiple Received headers of various formats and figure out which one was the first one.)

Anyone know if something like this is possible w/ directadmin?

TIA,

Sweth.
 
Have the catchall pipe to a script.

Is that as simple as creating the script and and then putting "|/path/to/script" as the recipient in the catchall via the DirectAdmin interface, or do I need to hack exim configs directly (and if so, which ones)?

Also, is there some way to reinject the message into exim to handle delivery after my script rewrites it, or do I have to handle post-rewrite delivery myself?
 
Thanks; that confirms that I can configuring the pipe in the DA interface. How about the other part of the question: does the script being piped to need to manage post-processing delivery itself, or is there a callback mechanism of some sort where the output of the script gets re-injected into exim? Searching the forum doesn't give me anything addressing that.

(When searching, I do see some threads involving messages sent to pipes being sent twice unless changes are made to exim.conf; is that still a problem, or do I need to make those changes as well?)
 
When exim delivers the email to the script exim is done. The script is now responsible for the processing and delivery. However you can have the script resend the email through exim as though it were a new email as far as exim is concerned.
 
Back
Top