Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Good afternoon;

I don't know much about sendmail, so this may be fairly easy for those of you more experienced with it. We have an account, "", sending reports to various groups. From time to time an undeliverable message will be sent back to "". We'd like for those undeliverable messages to be rerouted, or bounced, from "" to a group of our choosing. To carve out a scenario for clarity:

  • sends a report to and
  • has someone who's mail account no longer exists, triggering an undeliverable message being sent back to
  • Rather than having the undeliverable message sit in's Inbox, we'd like for it to be automatically rerouted/bounced to an admin group,

So I guess a "rule" of sorts. I've come across this solution: Sendmail : ignore local delivery But I don't know enough about sendmail to know if this is what will fit this situation. Any help is greatly appreciated.

share|improve this question

I see two potential solutions: set the sender to be the address you want bounces sent to, or use something procmail to handle incoming mail to that account. I'd recommend option 1 in general, but depending on your environment option 2 may be easier / faster to implement.

share|improve this answer
Thanks John; I'm open to either option, but my first inclination is to use the procmail solution since it sounds like an add-on that can be fitted into place without disturbing the sendmail environment. Is that correct? That being said, if the sendmail sender address is easily modifiable, I'd consider testing with that first to avoid having another piece of software to install/manage/document. How would I change the sender's address in sendmail? – Dizzle Dec 6 '12 at 20:30
When you invoke sendmail, you can append a -f<sender address> option in most languages / instances / environments. It doesn't have anything to do with sendmail configuration, only invocation. It does, however, depend on where you're invoking sendmail from. – John Dec 7 '12 at 13:21

Use an actual mailing list for this, instead of the ad-hoc stuff you're doing now. The mailing list software will then catch bounces and deal with them for you.

share|improve this answer

In your /etc/mail/aliases add a line:


Run newaliases as root after that. For more elaborate handling, like John wrote, you need to use procmail.

share|improve this answer

From your responses it looks like you want to rewrite the sender. A quick search for sendmail sender rewrite found a fair bit of documentation. It looks like you want to add a line to /etc/mail/genericstable. Something like this:


Use the appropriate values for your case.

share|improve this answer
Thanks Bill, unfortunately I don't have that file in /etc/mail. I'll Google a bit to see if that applies to our environment or sendmail version. – Dizzle Dec 7 '12 at 19:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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