I have configured postfix on ubuntu 14.04 and can send email from command line to my personal Gmail account.
Now I want to send email from my Gmail account to my Ubuntu server. How can I do that?
I have configured postfix on ubuntu 14.04 and can send email from command line to my personal Gmail account.
Now I want to send email from my Gmail account to my Ubuntu server. How can I do that?
Yes, you can. What you have to do is to get a domain. Configure your mail server with a functioning DNS record (e.g. mail.example.com, if example.com is your domain).
Next, add a MX Record to DNS. This tells other mailservers whom they should talk to to deliver mail for example.com
The third thing you have to do is to set up Postfix to accept mail.
In /etc/postfix/main.cf
you will find a line that begins with mydestination
. This is a comma seperated list of domains for which postfix will accept mail. It probably contains localhost already. After appending your domain it should look something like this:
mydestination = localhost, example.com
At that stage you should be able to accept incoming e-mail from the Internet. There's a lot of configuration you probably want to do in addition, such as adding TLS certificates to the SMTP server, set up IMAP server and so forth, but the tre steps above will make you able to receive e-mail from the Internet.