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, "user@server.com", sending reports to various groups. From time to time an undeliverable message will be sent back to "user@server.com". We'd like for those undeliverable messages to be rerouted, or bounced, from "user@server.com" to a group of our choosing. To carve out a scenario for clarity:

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

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.


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.

  • 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.


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

user: admins@team.com

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


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:

 user   bounces@example.com

Use the appropriate values for your case.

  • 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 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.