I have an alias on my mail server, call it splitusers.

Based on which domain (a couple are run off one mail server) is used, I would like the mail forwarded to a different user account.


[email protected] should forward to [email protected]
[email protected] should forward to [email protected]

How can I accomplish this? Is procmail the right approach? If so, what would the recipe look like?

  • 1
    Which mail server are you running? How is it configured?
    – derobert
    Commented Apr 22, 2014 at 22:08
  • @derobert - postfix .. not sure what you mean by "how is it configured"
    – warren
    Commented Apr 23, 2014 at 19:28

1 Answer 1


Procmail can be used to do this, but will need and Envelope-to header added by the MDA.

It may be simpler to setup virtual domain aliases in the mail server. Exim4 supports different aliases for different domains, but needs some setup to do so. I would expect this capability from Postfix and Sendmail as well, although I haven't multiple domains with them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .