Sending a mail to gmail from my local mail server

3

1

I just configured a mail server and tried sending a mail to my gmail account with a local email I created with my mail servers DNSs. I didn't go well. I use Redhat server and sendmail and the testing was done with evolution mail.

I had the following error :

"RCPT TO<mygmail@gmail.com> failed: <mygmail@gmail.com>...
  relaying temporarily denied. Cannot resolve PTR for my IP"

How can I solve this?

tambia

Posted 2012-09-11T15:11:18.050

Reputation: 31

Answers

0

I put this together for myself a long time ago, give it a try and see if it still works. In a terminal window, type:

sudo aptitude install postfix libsasl2 ca-certificates mailx
sudo gedit /etc/postfix/main.cf

then add/change this in main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
relayhost = [smtp.gmail.com]:587
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
smtp_tls_scert_verifydepth = 5
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtpd_use_tls=yes
smtp_use_tls = yes
smtpd_tls_ask_ccert = yes
smtpd_tls_req_ccert =no
smtp_tls_enforce_peername = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

edit the /etc/postfix/sasl_passwd to setup your username and password:

sudo gedit /etc/postfix/sasl_passwd


[smtp.gmail.com]:587    user.name@gmail.com:password

Then do:

sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
sudo /etc/init.d/postfix restart

d4v3y0rk

Posted 2012-09-11T15:11:18.050

Reputation: 1 187

thanks for cleaning that up. I am still trying to figure out all the editing quirks for the answer window. – d4v3y0rk – 2012-09-11T15:46:39.400