We currently have a qmail set up as an email gateway for incoming mail, and from there it is routed to a different internal mail server based on smtproutes.

Is there a way that we can have one domain forwarded from the qmail 'gateway' to multiple internal servers? For example, when someone will send an email to user@example.com, it gets routed to our qmail server, and from there a copy is sent to both mailserver1.example.com and mailserver2.example.com - both of which have the same list of users and both of which think that they are the mailserver for example.com

Thank you.

migrated from stackoverflow.com Jan 29 '10 at 1:20

This question came from our site for professional and enthusiast programmers.


One way to handle this would be to route the message on the head server to a .qmail file and then in the .qmail file forward the message to user@mailserver1.example.com and user@mailserver2.example.com. I think if you use the 'forward' program you could create a generic catch all that forwards all messages to the two servers.

/var/qmail/aliases/.qmail-default might look like this:

|forward "$LOCAL@mailserver1.example.com" "$LOCAL@mailserver2.example.com"
  • Thanks for this, I will try to see if I can implement it within our setup. – yayim Feb 1 '10 at 23:03

Both? Probably not, at least with stock qmail. If you're happy to recompile qmail, you can define QUEUE_EXTRA to anything you like, and then route the local ones to a second local server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.