This content has been marked as final. Show 6 replies
The following works for me for using gmail:
Install the software:
Configure postfix smtp authentication. Use your own username and password credentials and use the echo command with single quotes ('):
su - root wget http://public-yum.oracle.com/public-yum-el5.repo \ --output-document=/etc/yum.repos.d/public-yum-el5.repo yum -y install postfix chkconfig sendmail --del chkconfig postfix --add
Configure postfix relay and authentication:
echo 'smtp.gmail.com username:password' > /etc/postfix/sasl_passwd postmap hash:/etc/postfix/sasl_passwd rm -f /etc/postfix/sasl_passwd
cat >> /etc/postfix/main.cf <<EOF smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_security_level = secure smtp_tls_mandatory_protocols = TLSv1 smtp_tls_mandatory_ciphers = high smtp_tls_secure_cert_match = nexthop smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt relayhost = smtp.gmail.com:587 EOF
service postfix restart
echo "testmail " | mail -s "test" firstname.lastname@example.org
Sorry please explain. I have no idea what DHCP or static IP as such has to do with relaying your mail for outgoing connections? If your machine can connect to the Internet, the above should work. If you cannot connect to the Internet with your IP setup, that's a completely different story and needs to be addressed separately. If your service provider gives you an IP address for your router and provides NAT services than any private IP will work as long as you use your DSL router as your TCP/IP gateway.
to check if your network have connection to internet for mail, do
dig mx gmail.com
telnet gmail-smtp-in.l.google.com 25
if you see prompts, then you should be able to mail outside.
if the ip with you get internet doesn't match the domain of the same, your emails will probably get mark as spam..