System Administration & Network Administration
email-server gmail
Updated Wed, 25 May 2022 15:25:25 GMT

Use Gmail for incoming mail, and own mail server for outgoing email

I want to switch to Gmail from Google apps to handle my email. I have some internal programs that send emails to me like cronjobs, logwatch, and php applications.

Is there a way to sill have the internal programs send email. The emails will be sent to account from gmail.

I will close all incoming email ports on my system, and only have the outgoing ports open.


I had a similar question here the other day and solved it using this. It looks simple and it is and it works, I can send email from my VPS only and receive mail at my Google apps address. just make you setup you MX records (setting an SPF record is also a good idea to help with anti spam measures), set a hostname in postfix ( , make the changes suggested in the link and your good to go. You dont need any firewall rules because you dont need an open port to send mail (at least i dont seem to need anyway) (I think and wait to be corrected by someone more knowledgeable if wrong)