I'm using Sendmail as an MTA. I setup a local domain example.org, everything is running well, so now I want to use this local mail server to send email to my Gmail account or any external server. Just sending not receiving.

  • Hi and welcome to the site. You might want to read our how to ask page. Have you tried anything? Did you search for how to do this? This site is for solving specific problems not for giving howtos.
    – terdon
    Commented Jan 4, 2014 at 1:04
  • What exactly is your question?
    – michas
    Commented Jan 4, 2014 at 1:12
  • If you want just to send mails, then sendmail is quite overkill. Take a look at sSMTP, it may be more sufficient for you. Commented Jan 4, 2014 at 1:25

1 Answer 1


I found this tutorial which gives you a setup which will forward all email to a single GMail account. The article is titled:Forwarding all email to a domain with sendmail.

  1. Changes to /etc/mail/sendmail.mc

    Change this:

    DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=')dnl

    to this:

    DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp')dnl
  2. Enable virtusertable, again in the file: /etc/mail/sendmail.mc

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

    @example.com    [email protected]
  4. Compile the virtusertable

    $ cd /etc/mail
    $ sudo makemap hash virtusertable < virtusertable
  5. Add domain to /etc/mail/local-host-names

  6. Recompile sendmail.mc


    $ sudo sendmailconfig


    $ cd /etc/mail
    $ make
    $ /etc/init.d/sendmail restart
  • Thank you for taking time to respond, apparently that will works, i will try it this night & i will report a feedback.
    – ISMAIL
    Commented Jan 4, 2014 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .