Question

How to setup a outgoing mail smtp server like smtp.gmail.com?

Posted January 25, 2015 7.5k views

Hi Good day!

I have LEMP installed on my Droplet and I want it to be my web and mail server at the same time, I have installed postfix, dovecot in it and it works fine.

My objective is to create an SMTP server (smtp.mydomain.com) and use it to gmail as outgoing mail.
https://support.google.com/mail/answer/22370?hl=en

Any steps or tutorial of how can I setup my own SMTP server?

Thanks in advance

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Well, you said that you’ve already created your own SMTP server. What would you like to know? How you could build a smtp server which will use GMAIL as relay server?

There are plenty of tutorials out there. The most important thing is to configure your postfix in the right way.

  • Thank you for your response jay986365

    Yeah, postfix and dovecot I have installed already and its working but I want “smtp.mydomain.com” so that I can use it to my gmail account. :D

  • I have tried relay server of gmail already and it’s not working, I think relay server is for those who want their own webmail and relay to gmail smtp server. In my case I want my own smtp.mydomain.com like gmail smtp server which is smtp.gmail.com because gmail had provided an option to put your own smtp.domain.com.

  • So what u want, is using smtp.yourdomain.com as hostname?

  • Yeah, hostname the right word to describe, I want to setup my own smtp email server host along with my web server.

  • Oh well, that’s possible. Step 1 is configuring your DNS settings of your domain name. There you should create an A record pointing to the IP of your DigitalOcean Droplet which will serve as a mailserver.

    The second step is configuring the /etc/hosts file in your Droplet.

  • Thank you for your response jay986365. Will try that one. :D

Submit an Answer