I want to have some mail accounts on my domain (contact, webaster) redirected to my gmail account.

In order to do this I installed sendmail.

Default install (apt-get install sendmail on ubuntu server 10.04) has local daemon, and only accepts delivery to local accounts.

To forward I activated virtusertable on sendmail.mc adding the line FEATURE(virtusertable)dnl, edited the file /etc/mail/virtusertable and added the lines:

webmaster@mydomain.com   myaccount@gmail.com
contact@mydomain.com    myaccount@gmail.com

finally, I did m4 sendmail.mc > sendmail.cf and make virtusertable.db, and edited the sendmail.cf to change the daemon listenting on my external ip's interface instead of

As a result I can send email to, let's say root@mydomain.com from any host and it gets to my server's root local mail account, but on the forwarded accounts (webmaster, contact) I don't get any delivery error message but neither any forwarded mail on my gmail account, or local mail on the server like it happens with root@mydomain.com which is not forwarded using virtusertable.

I guess I would like to know what's happening (I don't even know where is the log file), and how to fix it. And also how can I change the daemon config on sendmail.mc to allow outside connections instead of just local ones without having to edit sendmail.cf file.


I just forgot about virtusertable and edited /etc/mail/aliases file instead, adding the lines:

webmaster:    myaccount@gmail.com
contact:      myaccount@gmail.com

then I executed newaliases and everything peachy.

Now, about proper config of the daemon to listen on and also on any other interface editing sendmail.mc instead of sendmail.cf I've found this: http://lists.samba.org/archive/linux/2002-August/004310.html

which basically tells to simply place dnl at the front of the line which specifies the daemon options, which will make sendmail listen on all available network interfaces. e.g:

dnl DAEMON_OPTIONS('Port=smtp,Addr=, Name=MTA')

of course after doing that it's necessary to rebuild the config files (m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf) and restart sendmail.

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.