HowTo: Configure Sendmail with Gmail SMTP Server in FreeBSD


Yeah! Finally I was able to send and receive email with sendmail and dovecot implemented on my FreeBSD server. I choose gmail smtp server to act as my Outgoing Email Server. Here is how I did,

In the /etc/mail/ file, add the following above the DAEMON_OPTIONS line.

define(`confAUTH_OPTIONS’, `A’)dnl
FEATURE(`authinfo’, `Hash -o /etc/mail/authinfo’)dnl
define(`SMART_HOST’, `’)dnl
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)

Create or edit the /etc/authinfo file and with this codes. “U:smmsp” “I:gmailusername” “P:gmailpassword” “M:PLAIN” “U:smmsp” “I:gmailusername” “P:gmailpassword” “M:PLAIN”

Now, we can run this command in the /etc/mail directory.

touch local-host-names
makemap -r hash authinfo.db < authinfo
make all install restart

If the “make all install restart” command didn’t work, you can also run “make” alternatively.



7 Responses to “HowTo: Configure Sendmail with Gmail SMTP Server in FreeBSD”

  1. 1 piju

    i still dont know how to setup sendmail for my local networks

  2. Good website …from kulhari group..manish kumar.


  3. 3 Ricardo Marinho

    Great work!!

  4. Nice manual but I have a problem with my sendmail.
    Error massage is:

    Starting: sendmail554 5.0.0 /etc/mail/ line 59: unknown configuration line ”

    554 5.0.0 /etc/mail/ line 85: unknown configuration line ”

    Warning: Option: AuthMechanisms requires SASL support (-DSASL)
    Warning: Option: AuthOptions requires SASL support (-DSASL)

  5. Thank you very much for this. I didn’t have luck getting sendmail to work with my Uverse SMTP, but this worked great to get my mail sending via Gmail.

  6. Thanks for the useful post like this C I had fun reading it! I always love your blog. Have a good day!

  7. I configured as everything correctly.. But I got this “Authentication Required” error

    —– Transcript of session follows —–
    … while talking to
    >>> AUTH dialogue
    <<< 535-5.7.1 Username and Password not accepted. Learn more at
    <<>> MAIL From: SIZE=538 AUTH=
    <<< 530-5.5.1 Authentication Required. Learn more at
    <<< 530 5.5.1 i7sm28108408qap.12
    554 5.0.0 Service unavailable

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: