Postfix :: Relay Email to Google Apps / Gmail

40 sec read

:: What’s Postfix
Postfix is free and open source mail transfer agent.

 
:: How to setup Postfix relay email to Google Apps / Gmail in CentOS 6.3
+ Setup main.cf to relay email

vi /etc/postfix/main.cf

add some configure like these:

relayhost = [smtp.gmail.com]:587

smtp_sasl_auth_enable=yes
smtp_sasl_password_maps = hash:/etc/postfix/gmail
smtp_sasl_security_options =
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = login

smtp_tls_eccert_file =
smtp_tls_eckey_file =
smtp_use_tls = yes
smtp_enforce_tls = no
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_received_header = yes
tls_random_source = dev:/dev/urandom

 
+ Setup Google Apps / Gmail Login

vi /etc/postfix/gmail

add line like this:

smtp.gmail.com [email protected]:password

 
+ Create Postfix db file for gmail login

postmap /etc/postfix/gmail

 
+ set CAfile

cp /etc/pki/tls/certs/ca-bundle.crt /etc/postfix/cacert.pem

 
+ Restarting Postix

/etc/init.d/postfix restart

 
+ Testing send an email

echo 'hello' | mailx -s 'ignore me' [email protected]

 
:: Links
+ Google
+ Carlosgomez

How to install NextCloud in Ubuntu 22.04

What’s NextCloud Nextcloud is an open-source software suite that offers a secure, self-hosted alternative to popular cloud storage and productivity platforms. With a focus...
sysadmin.id
8 min read

Reset root password on CentOS 7

Edit boot menu on-the-go 0. reboot the CentOS 7 and press ESC when GRUB menu show up on the screen and press “e” 1....
sysadmin.id
18 sec read

Free ext4 reserved blocks with tune2fs

Check disk usage df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 95G 82G 7.9G 92% / Check size of Reserved block count...
sysadmin.id
19 sec read