Configure Postfix to Use Gmail SMTP on Ubuntu

Update: This article is part of WordPress-Nginx tutorials series.

If you want to use a Gmail account as a free SMTP server on your Ubuntu-Linux server, you will find this article useful. This guide is tested with Ubuntu 12.04. If you face any issue, feel free to use comments-section below.

Relaying Postfix mails via

First, install all necessary packages:

sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

If you do not have postfix installed before, postfix configuration wizard will ask you some questions. Just select your server as Internet Site and for FQDN use something like

Then open your postfix config file:

vim /etc/postfix/

and following lines to it:

relayhost = []:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

You might have noticed that we haven’t specified our Gmail username and password in above lines. They will go into a different file. Open/Create

vim /etc/postfix/sasl_passwd

And add following line:


If you want to use your Google App’s domain, please replace with your

Fix permission and update postfix config to use sasl_passwd file:

sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

Next, validate certificates to avoid running into error. Just run following command:

cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

Finally, reload postfix config for changes to take effect:

sudo /etc/init.d/postfix reload


Check if mails are sent via Gmail SMTP server

If you have configured everything correctly, following command should generate a test mail from your server to your mailbox.

echo "Test mail from postfix" | mail -s "Test Postfix"

To further verify, if mail sent from above command is actually sent via Gmail’s SMTP server, you can log into Gmail account with PASSWORD and check “Sent Mail” folder in that Gmail account. By default, Gmail always keeps a copy of mail being sent through its web-interface as well as SMTP server. This logging is one strong reason that we often use Gmail when mail delivery is critical.

Once configured, all emails from your server will be sent via Gmail. This method will be useful if you have many sites on your server and want them all to send emails via Gmail’s SMTP server.

Alternatively, you can use a plugin like WP Mail SMTP so that mails from your particular WordPress site will be sent using Gmail’s SMTP server.

Please note that Gmail’s SMTP server has a limit of 500 emails per day. So use wisely! :-)


Error: “SASL authentication failed; server”

You need to unlock the captcha by visiting this page

You can run test again after unlocking captcha.

P.S. Do not miss out on our other helpful tutorials. Join us on twitter and facebook for more updates.


180 Responses to “Configure Postfix to Use Gmail SMTP on Ubuntu”

  1. elricho

    Excelent tutorial it work very well !!! Thank you so much.

  2. Mark

    A great big thank you to you this worked brilliantly on my Ubuntu 12.04.2 LTS install

  3. birdpunisher

    I felt the need to say thank you since you were a big help – straightforward explanation that worked after the first try :)

  4. Zeeshan

    Excellent.. Thanks for saving time.

  5. kasun

    Man ! I owe you big time 😀 thanks heaps , This is a lot simple and understandabale than any other thing I’ve found , It actually works ! KEEP UP THE GOOD WORK ! CHEERS !!!

  6. Chris Walsh

    This was fantastically useful; thanks for taking the time to write it up.

  7. ayad


  8. Ricardo

    After configured everything and download the root cert from Thawte I am receiving the following error. Could you please help me?

    Action: failed
    Status: 5.7.0
    Remote-MTA: dns;
    Diagnostic-Code: smtp; 530 5.7.0 Must issue a STARTTLS command first.
    f71sm25739776yha.8 – gsmtp

    • Rahul Bansal

      It looks related to postfix file.

      Check settings in `/etc/postfix/`. Have you modified any setting?

    • JEsus

      USE THIS in the

      eliminates default security options which are imcompatible with gmail

      smtp_sasl_security_options =

      • Jens Skov

        I also have this problem.

        I can’t spot the error.. Any suggestions?

        My looks like:

        myhostname = raspberrypi
        alias_maps = hash:/etc/aliases
        alias_database = hash:/etc/aliases
        myorigin = /etc/mailname
        mydestination = raspberrypi, localhost.localdomain, localhost
        relayhost = []:587
        mynetworks =
        mailbox_size_limit = 0
        recipient_delimiter = +
        inet_interfaces = all
        inet_protocols = ipv4

        smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
        biff = no

        # appending .domain is the MUA's job.
        append_dot_mydomain = no

        # Uncomment the next line to generate "delayed mail" warnings
        #delay_warning_time = 4h

        readme_directory = no

        # TLS parameters
        smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
        smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

        # use sasl when authenticating to foreign SMTP servers
        smtp_sasl_auth_enable = yes

        # path to password map file
        smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

        # list of CAs to trust when verifying server certificate
        smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

        # eliminates default security options which are imcompatible with gmail
        smtp_sasl_security_options =

  9. Bastian

    Anyone else facing an ‘Authenication Required’ error message when sticking to the tutorial (although setting up the password file worked flawlessly)?

  10. Ed

    Worked Perfectly! Thanks!

  11. Omar


  12. Kinshuk Tyagi

    Thanks it worked!

  13. Yuri Sklar

    Thanks a lot!

  14. kk

    worked great….

  15. didnot work

    XXXx@XXXXXX:/etc/postfix$ echo “Test mail from postfix” | mail -s “Test Postfix”
    The program ‘mail’ is currently not installed. To run ‘mail’ please ask your administrator to install the package ‘mailutils’

  16. Rafael

    It is not the first tutorial that i tried, but it is the first that worked on my Ubuntu 12.04.
    It is excellent. Thank you very much

  17. rossdavidh

    Worked great! However, in my case I had to do one more thing which I thought I’d share here. After sending the test email, I got a “Suspicious sign-in prevented” email from google in my inbox. So, I went to to search for a solution, saw a big red banner saying something like “someone tried to login to your email from a new application, was it you?” I clicked through several screens to say “yes, this was me”.

    echo “Test mail from postfix” | mail -s “Test Postfix”

    …and this time got test email in gmail account!

    Just sharing this in case someone else gets this.

  18. krishna

    very nice smtp relay worked like charm.thanks dude.

  19. Vamsi Ampolu

    When executing the following command:

    postfix/postfix-script: fatal: the Postfix mail system is not running

    • Rahul Bansal

      Which command you tried executing?

      Sorry but looks like your command got stripped during comment submission.

  20. Vamsi Ampolu

    sudo /etc/init.d/postfix reload
    * Reloading Postfix configuration… postfix/postfix-script: fatal: the Postfix mail system is not running

    • Rahul Bansal

      Just try… `sudo /etc/init.d/postfix restart`

      If you get error `bind port 25: Address already in use` then it might be the case some other mail program is already present in your system.

  21. subin

    I configured postfix as above, but unfortunately send mail root through root@ not from gmail , and no email at send mail of gmail a/c, I double checked all config exactly as per this doc, Can you please help me , Is their any additional configuration I need set up?


    • Rahul Bansal

      If gmail is configured correctly, FROM address will be overridden with Gmail’s email address for all outgoing email.

      It looks like your emails aren’t sent by Gmail. Hence they are not appearing in Gmail’s sent mail folder as well.

      • Herm

        Hi subin

        Did you get a resolution to your issue? I’m facing the same. The FROM address is not being overridden. So it is trying to send from “linuxuser” instead of “gmailname”

        • Rahul Bansal

          This is really strange as Gmail makes sure that we can not override FROM name on the go.

          In fact, that is one reason to NOT use Gmail in many production server where system need to send emails from multiple FROM addresses.

  22. Scor

    Great guide, could set up relaying in 5 minutes. :) Thanks!

  23. Making Your Garage Door Email, Tweet, or SMS: Part 2 - Richard L. Lynch

    […] These instructions are largely summarized from […]

  24. Matache

    I have a problem, everything worked without a problem , no errors no nothing, but when i check my gmail account nothing was sent? What do you think the problem might be?

    • Rahul Bansal

      Please check

      You may find some details in postfix logs.

      Also – did receiver receive test email?

      • Matache Mihai

        Thanks for the promp response and sorry for the late comeback, but I found out that at the place where i was trying to set this up smtp is a no no, it has been disabled on the network for security reasons.

        • Rahul Bansal

          That’s something strange! Outbound mail disabled for security reason. 😐

          • Matache Mihai

            Not all outbound mail. 99% of the users use windows and have outlook configured through the company servers. I’m the oddball there because i’m trying to get a backup application running on a linux pc for some of the older computers that can’t be replaced for some reason or another, and when i say old i mean going on 20 years, they’re practicaly the legal drinking age. I was trying to configure email client on that. Thanks for all the help.

  25. anirudha rath

    after configuring postfix as above I cann’t receive any mail from the server to my mail id

  26. Subin

    Hi Rahul, Its a great post, helpful for me, The issue I posted earlier is resolved, By default sendmail also installed and sending mail through sendmail, I removed sendmail, now everything is as expected. Thank you somuch


  27. krishna

    I have strange problem please help me

    it was all working fine,

    now i cannot send email to,,

    but i can send to hotmail and google hosted email service,rediffpro account.

    i cant understand what is this problem please help….

    • Rahul Bansal

      Look for postfix logs and also Gmail’s sent folder for email address being used.

      On other end, check spam folder on email accounts where you are not receiving mails.

  28. Chris Brown

    Thank you! This article just saved me a loooong weekend of work.

  29. Automating the hell out of it « ClickedyClick

    […] every run, some when new information appears), and for good delivery I have set up postfix to use Gmail as an SMTP relay. This way I'm sure to receive the emails and receive them […]

  30. Praveen

    a Big thanks for the point shoot instructions. It worked pretty well. Now I will try to configure my other domain SMTP here (you showed it how :) )….

  31. Mike

    Just wanted to extend my thanks to you for this succinct write-up. I have setup mail on Ubuntu servers before, but this was my first time attempting SMTP via Postfix, and this was a very simple and quick mail setup that just works.

    Nicely done!

  32. Ubuntu User

    Thank you. Works for me. Also liked the simple instructions.

  33. postfix-r

    Works Great!! thanks a lot for the well documented steps.

    Found “aptitude” command does’t work on Ubuntu 13.04 ( 13.04, Raring Ringtail ) ,
    – Used insted “apt-get ”

    sudo aptitude install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

    WORKS great!, Thank you.

  34. RavanH

    Why not switch to msmtp instead of postfix if you’re only going to use it for sending through gmail? I’ve not compared/tested but I think its memory footprint is much smaller… While setup is similar :)

  35. suraj

    postdrop: warning: unable to look up public/pickup: No such file or directory

  36. alex.fliker

    Thank you so much!

  37. Aanu

    Hey man,
    You’re really the best… I’ve been on this for over a week but U did it in less than 30 minutes!!! Thanks a million. I hope I will be able to send with attachments too!!!
    Thany you so much… You deserve the best

  38. Alex Lydiate

    Beautiful! You’re a hero of modern times, my friend, what a superb tutorial. I shall now send emails from the command line alone, simply because I can :)

  39. André Kjellstrup

    Thank you.
    Unfortunately I get this:
    Nov 8 12:27:41 ODIN2 postfix/error[20109]: EDB1E77006EE: to=, orig_to=, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced ([]:587)

    I have ssmtp on my server, but cron did not like to use it. I assume it’s not the cause of this problem.
    also: I use 2-factor auth, but I gave it an application-specific password. – and it does not seem to be an authentication problem.
    Please help me. :)

    • André K.

      Also, I did not get a wizard, you mention that I should configure as “internet site”.
      I changed

      now the error is still the same, except for the destination address being all wrong
      Nov 8 12:54:12 ODIN2 postfix/error[25061]: 871077700701: to=, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced (

      ow can I do this” select Internet Site and for FQDN use something like”

  40. Tamara

    Hi Rahul,

    This tutorial has been very helpful many times. However, I am stuck with a couple of clients using Zoho (at my recommendation as it is free-er)

    Do you have any experience setting up postfix with Zoho? If you do, would you be willing to write another lovely tutorial?
    The internet has failed me and I was not able to find anything but the following:

    Thanks for your time,

    • Rahul Bansal

      I never used Zoho mail. But if they are providing SMTP interface then you can just substitute values for Zoho SMTP in place of Gmail SMTP to get it working.

      All this tutorial does in relay outgoing emails via Gmail’s SMTP server rather than local sendmail program.

      • Tamara

        Thank you for the prompt response!

        Zoho uses an SSL connection rather than TLS. I’ve started playing with the config outlined at the following article, but got stuck on how to add the username and password.

        Would you know if I’d still be able to use the following for storing the username and pass

        smtp_sasl_auth_enable = yes
        smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
        smtp_sasl_security_options = no anonymous

        Thanks again 😀

        • Rahul Bansal

          Those settings comes into picture when “your postfix server” is used by other applications. In this case, you are using “zoho server” so I don’t think your postfix’s master conf will matter much.

          Try replacing []:587 with []:465 evrywhere in this article.

          • Wei Fang

            Replacing with []:465 in unfortunately doesn’t help, since Postfix doesn’t support legacy TLS. I happened to get Postfix work with Zoho email while setting up gitlab. Details are here. Details Link.

  41. ayush

    thank you sir…

  42. YoTsumi

    Works perfect :) Thank !

  43. pkinjo

    After issuing command:
    sudo chmod 400 /etc/postfix/sasl_passwd

    Come with this issue:
    sudo: unable to resolve host mail

    Masters, need some help please. Thanks a lot.

  44. George

    Thank you. It’s pity I didn’t find this article earlier…

  45. Mohammed Awwal

    works like a freaking charm…… whoever did this tutorial he freaking rock….thanks wherever you are

  46. Ian C

    Thank you very much for this excellent tutorial. It works fine on Ubuntu 12.04 LTS but not on 13.10

    • Rahul Bansal

      We only use LTS releases for Ubuntu.

      However, if you manage to get this working on Ubuntu 13.10, feel free to suggest changes and I will have this post updated with your contribution.

  47. B.k.Jayasundera

    Thank you Rahul

  48. erikb85

    And how to debug if the testrun fails? As far as I can tell it doesn’t even say any error messages or warnings.

  49. Paula

    Worked! Thanks.

  50. Raja

    Dear, excellent posting, followed step by step and working like a charm.
    All the best! Regards raja

  51. angels1100

    Dec 19 12:11:42 user-System-Product-Name postfix/smtp[20581]: B3DA31A421D2: SASL authentication failed; server[] said: 535-5.7.8 Username and Password not accepted. Learn more at?535 5.7.8 y11sm1790904lbm.13 – gsmtp
    Dec 19 12:11:43 user-System-Product-Name postfix/smtp[20581]: B3DA31A421D2: SASL authentication failed; server[] said: 535-5.7.8 Username and Password not accepted. Learn more at?535 5.7.8 mq10sm1794674lbb.12 – gsmtp
    Dec 19 12:11:43 user-System-Product-Name postfix/smtp[20581]: connect to[2a00:1450:4008:c01::6d]:587: Network is unreachable
    Dec 19 12:11:43 user-System-Product-Name postfix/smtp[20581]: B3DA31A421D2: to=, relay=none, delay=2.2, delays=0.08/0/2.2/0, dsn=4.4.1, status=deferred (connect to[2a00:1450:4008:c01::6d]:587: Network is unreachable)

  52. Ping

    Worked on Ubuntu 12.04
    Thank you a lot! I spent like 4 days with sendmail, postfix, dns server set up. So fed up with all these tech challenges. Finally reinstall Ubunut and you post saved me!

  53. Asdrubal Velasquez

    Worked!! (tested on Lubuntu 13.10)
    Best regards

  54. Relay Ubuntu desktop off my gmail account. | Parker Web Services

    […] Relay Ubuntu desktop off my gmail account. […]

  55. Dennis van den Berg

    Great instructions, thanks!

  56. Enis

    Great tutorial, thank you!

  57. reena

    Hi, thanks for your guide. I got it to work for outgoing emails from root@localhost. What must i do to get it to work for incoming emails sent to gmail? I tried searching on the internet but came up with nothing :(. Hopefully you have a solution for me.

  58. reena

    sorry there is a typo above, i mean incoming emails sent to root. not gmail. thanks again!

    • Rahul Bansal

      Sorry I couldn’t understood your problem clearly. This article deals with outgoing mails only.

      Your server cannot receive incoming emails for root@localhost from outside world. Incoming mail is whole different topic.

      If you are concerned about “replies” to mails going through Gmail; those “replies” will be directly reach to Gmail server.

  59. Darren

    Fantastic tutorial but I’m falling at the first hurdle;-
    Reading packages lists…Done
    Building dependency tree
    Reading state information… Done
    Package mailutils is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or is only available from another source
    E: Package ‘mailutils’ has no installation candidate
    E: Unable to locate package libsas12-2
    E: Unable to locate package libsas12-modules

  60. anonymous

    I did what you said but when i check Sentmail, the mail is not there…the resident also did not recieve any mail.pls help.i m using uunty 12.04 lts.Thank you.

  61. anonymous

    i m getting mail in mailbox but no mail in sent mail in my gmail host name is my computer name without domain and i m not able to change it by editing /etc/hostname.

    • Rahul Bansal

      This means mails are sent via localhost and not gmail.

      Try this –

      • anonymous

        changed my host name by editing /etc/hostname and /etc/hosts but now host myfqdn is not working and giving 3(NXDomain) error.Still the mail is sent via my fqdn and not gmail.

        • Rahul Bansal

          Did you follow instructions in above article? Hostname doesn’t play much role in relaying outgoing mails via Gmail.

      • anonymous

        Reverse Dns not working in my fqdn.its giving 3(NXDomain)error.i enabled smtp my gmail account whose details i saved in/etc/postfix/sasl_passwd so whenever i send to any other gmail account via command prom then its working but if i send it to username@myfqdn then its not sent via gmail accnt .i m not able to send any mail to my fqdn.for example if fqdn is then i can send mail to but not to i try to send mail to then it gives failure report in my gmail account…if my hostname is myhost and fqdn is then sending mail to is giving failure report but is sending mail bt not via gmail.

        • Rahul Bansal

          I think you are having problem for sending to only one particular domains – your FQDN in this case.

          Check postfix value for mydestination setting. If its anything apart from localhost, or contains your FQDN, then remove that value from there.

  62. Pritam

    Thank you Rahul. It worked like charm. Your article saved a lot of time for me.

  63. anonymous

    Is there any way of sending email from gmail to my domain??

    • Rahul Bansal

      Not sure what are you asking for? All mails will be through Gmail account’s email address. You can use an email address with Google Apps mail.

  64. néo

    Hello sir, thank you for your great tutorials, i know this is not the right place for this but unfortunely im a windows user with xampp server, i configured my php.ini and my sendmail.ini for gmail smtp, my php mail sender script says mail successfully sent, but i dont recive any thing, i tried all possible sollutions on internet but still got this problem! so maybe you cn helep me :( PLEAZEEE!

  65. Piers Harding


  66. Jim Volf

    Awesome. Worked great. Thank you very much!

  67. Raseel Bhagat

    Thanks a lot Rahul for such a precise, concise post. It served me really well and saved up a LOT of time to do a quick mail test.

  68. Trisha

    Thank you for this tutorial! I got my gmail smtp on postfix to work, Quick question which I really pray u have an answer for it! How do I configure fail2ban for postfix if I followed your tutorial? thank you!!!

    • Rahul Bansal

      How do I configure fail2ban for postfix if I followed your tutorial?

      The same way you would have configured when not using Gmail as reply in postfix. I guess fail2ban comes into picture if you are running a public SMTP server. In this case, it is assumed that postfix is not accessible to the outside world via SMTP.

      Gmail accounts has very low sending limits. So we use this kind of setup only in small apps for notification email types only.

  69. Ghost

    Awesome, awesome, awesome! Thanx a lot for this, works like a charm :)

  70. Aka Chilala

    Much appreciated, Rahul. This worked perfectly.

  71. tanvir.raihn

    Many , thanks.. its working and u awesome :)

  72. lizhi

    my postfix can send an e-mail ,but the sender is wrong. My configuration is, but that e-mail is

    postfix/qmgr[22022]: 1225BA0CF5:, size=1030, nrcpt=1 (queue active)
    how do I change the ‘from’?

    • Rahul Bansal

      Looks like is your hostname and mails are sent from postfix only. Are you sure you have configured Gmail setup properly?

      Because all mails replayed from Gmail uses Gmail’s email address as FROM address.

  73. sayantani Saha

    Hi, I follow your instruction to send mail via gmail using postfix. However, my network is working behind proxy with userid and password. Will you help me setting up these parameters so that I also feel happy to send mail using this way.

    • Rahul Bansal

      Sorry. I never configured anything like that. Most likely you need to do this outside postfix. Not sure though.

  74. vins069

    very good, simple and efficient, thanks so much

  75. Ranjit

    Thank you….clear and concise instructions…..worked in first attempt.!!

  76. Send Emails from PHP on Ubuntu localhost LAMP setup | Muhammad Anas

    […] To solve this problem, I further configured my newly installed mail server to use my Gmail account for all outgoing email. I did this by following the awesome instructions provided in this tutorial. […]

  77. BuzB

    Excellent instructions, thank you!

  78. Rafael

    Excellent article. Thank you by to share your knowledge.

  79. Ubuntu Postfix 通过 SMTP 发送IP地址 « J2EE开发爱好者

    […] 第一步:Ubuntu下配置 Postfix 使用便捷的 SMTP 发送邮件,这样做的好处就是不用搭建自己的邮件服务器,使用第三方的就可以了,已经有篇文章写的很好了,它用的 Gmail SMTP,地址如下:Configure Postfix to Use Gmail SMTP on Ubuntu […]

  80. Randy

    Thank you very much, this tutorial was spot on, and very easy to follow. And as an added bonus it worked like a peach! You Rock, Rahul, thanks.

  81. Joe

    when I am at work where we have a domain it works fine, when I am at home it complains about fqdn and won’t send, what can I do to make it work at home where I don’t have a domain?

    • Rahul Bansal

      Postfix via Gmail shouldn’t care about domain or IP. This is used mostly in locations where server/machine IP is dynamic.

      I am assuming that you have a postfix+gmail setup on your laptop which is you are using at home/work.

      When at work try ping Repeat same commands at home. If there is a difference in IP, try to offset that difference by modifying local /etc/hosts.

      Another case, is postfix+gmail setup is present at work machine but postfix has smtpd_recipient_restrictions enabled with setting reject_non_fqdn_sender. Remove reject_non_fqdn_sender so your (senders) IP/FQDN will not be verified.

      References: and

  82. Daniel Clarks

    Work’d for me, tanks

  83. si


  84. Daniel Stoian

    Your tutorial worked very well on Debian 7 (Wheezy).<br/>
    Clear steps that anyone can understand.<br/>
    Thank you very much!

  85. Umesh Kumar

    Thanks for the Plugin suggestion, I couldn’t make relay setup working being in hurry but the Plugin WP Mail SMTP works great for me.

    • Rahul Bansal

      Where did you get stuck? WP Mail SMTP plugin might slow down few WordPress feature as SMTP connections are generally blocking in nature.

      Using relay host is useful as postfix uses mail queue.

  86. daniel_mullins

    This is a great tutorial! Followed step by step and was able to get it working. Had some issue with sendmail already running on port 25, but I removed it and rebooted and now it works like a champ!

  87. Jorge Saldivar

    After several trials getting this error message “SASL authentication failed; server” I could finally manage by unlocking the captcha visiting this page

  88. Configure Postfix to Use Gmail SMTP on Ubuntu | onewaterdrop

    […] via Configure Postfix to Use Gmail SMTP on Ubuntu. […]

  89. Christopher S Wells

    Every time i boot my server, I get that test mail… x2 and every now and again while its up… how to fix. thanks

    • Rahul Bansal

      This is not related to this article. This article doesn’t have test mail sending on boot.

      Anyway, check crontab. It looks like cronjob.

  90. john

    hi. really nice tutorial. i got it working simply by following this tutorial.
    when i send emails, the recipient sees root (as name, the email address appears correctly).
    it appears as root is there a way to change the root to another name.
    when i send from my thunderbird using this email address it appears the name i have setup.

  91. pergaet

    I get the following log message from gmail: “….The IP you’re using to send mail is not authorized to 550-5.7.1 send email directly to our servers. Please use the SMTP relay at your 550-5.7.1 service provider instead…. ”
    Could you suggest a workaround?

  92. Ryan P. Meyer | Fixing my backups

    […] thing I did was make it so my server would email me if one of the harddrives went down using this tutorial, which basically uses a gmail account to send the […]

  93. Orlando Combita

    Nice and Clear! Thanks a lot Rahul!. I’m on my way to develop a testing server for a php app! Your artice was very helpful

  94. Tom

    Clear and working!
    thanks a lot!

  95. Sohail

    Thanks @Rahul,
    I have one issue though, if you could help.

    I have installed it as you explained it here step by step for my WordPress site. I use Contact Form7 plugin for creating my forms. So I am able to send emails, but the Sender address in all those emails is what I have entered in sasl_passwd file. And it ignores the Sendaddress in the ContactFrom7 plugin. Is there a solution for this ?

  96. That Jack Elliott

    Rahul: It didn’t work perfectly initially. But commenter’s followup questions echoed my issues. The machine said “bind port 25: Address already in use. ” You suggested that this might be due to “some other mail program is already present in your system.” I did “apt-get –purge remive sendmail” to get rid of my best guess, but apparently sendmail it had its claws sunk deep into the OS: I continued to get errors when I did your example test.

    But one reboot and Hey Presto! it sends mail!

    Many thanks, Rahul! It works good. Thank you for writing up this very handy how-to.

    One wonders how you figured it out?

    • Rahul Bansal

      Glad to know your issue is fixed.

      I figured out it using Google, forums and plenty of trial and errors! 😉

  97. Postfix GMail SMTP Relay @ Adam Bonny

    […] Follow these steps to create a Postfix SMTP relay that sends external mail via a GMail account. The GMail config comes from Rahul at rtcamp. […]

  98. Get Email/SMS notifications when your IP changes (Linux) : David Wayne Baxter

    […] I’m assuming most folks don’t have an SMTP relay setup on their home networks.  Thankfully, it’s easy to setup Gmail as a relay for Postfix.  RT Camp has a straight forward tutorial for this process here:   Configure Postfix to Use Gmail SMTP on Ubuntu […]

  99. How to install Zoneminder in ubuntu 14.04 64 bit | bkjaya

    […] sudo adduser www-data video /etc/init.d/apache2 force-reload (5)Download cambozola and extract to home folder.Then the extracted folder name may be look like cambozola-0.935 .Then open the terminal and input cp cambozola-0.935/dist/cambozola.jar /usr/share/zoneminder now open the web browser and goto address localhost/zm Now you can add your monitor (using the web cam or any  other ip cam)  and configure zm as you wish.If you want to get e-mail alerts you can use postfix .refer – Configure Postfix to Use Gmail SMTP on Ubuntu […]

  100. Setting up GitLab CE (a GitHub-like Git server) | IAM SysAdmin

    […] going to diverge from GitLab’s instructions and jump to rt Camp for their Postfix tutorial to enable outbound email support before I get GitLab all setup. For simplicity I used Gmail as my […]

  101. Install GitLab | self-hosted Git server | IAM SysAdmin

    […] going to diverge from GitLab’s instructions and jump to rt Camp for their Postfix tutorial to enable outbound email support before I get GitLab all setup. For simplicity I used Gmail as my […]

Comments are closed on this article.
Please use our free support forum for support and discussions.