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

I am installing Bugzilla and I want to prevent it from sending out e-mails, which instead should be sent to a user on the local machine.

I have this line in my /etc/mail/

FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')

I added the following line to the top of /etc/mail/virtusertable (the rest is comments):     myusername

I then ran the following comands:

$ makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
$ m4 /etc/mail/ > /etc/mail/

I then restarted the sendmail server. However, when I send an e-mail to via the mail command, I still receive it in my web-based inbox, which is not what I want. I want it to be delievered only to myusername on the local machine.

share|improve this question

Please do yourself, and the world, a favour and replace Sendmail with something easier to configure and maintain, like Exim or Postfix. I would normally vote down answers that said "use a different product", but in the case of Sendmail, I think it's worth the risk. Sendmail is very complex to configure compared to modern MTAs and should only be used if you have an existing complex Sendmail infrastructure and you have considerable Sendmail experience.

Also, I don't know if it's a typo or not, but you have

m4 /etc/mail/ > /etc/mail/

Notice the, rather than

share|improve this answer
Thanks, I fixed that typo. – titaniumdecoy Aug 12 '09 at 15:39
up vote 1 down vote accepted

I took David's advice and installed Postfix. It was amazingly easy to set up. I followed these instructions to configure, then all I had to do was add the following line to /etc/postfix/virtual:     myusername

Then execute the following commands:

$ postmap /etc/postfix/virtual
$ postfix reload

And voilà! All mail sent from the local machine to any address is instead sent to the local user myusername.

share|improve this answer
Yeah, Postfix or exim are so much easier to set up than Sendmail. Even people who've used Sendmail for 20 years complain about its config files. – David Pashley Aug 12 '09 at 18:12
I had a similar requirement and also went down this route. The linked instructions are unfortunately no longer there, one step I missed initially is to add the line virtual_alias_maps = hash:/etc/postfix/virtual to – harmic Jul 30 '15 at 1:29

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.