I am using namecheap privateemail service.
I tried the following and still getting 127.0.0.1 connection refused and I dont know why
Created file /etc/postfix/sasl_passwd
[mail.privateemail.com] username:password
sudo postmap /etc/postfix/sasl_passwd
sudo chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db sudo chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
sudo nano /etc/postfix/main.cf
# specify SMTP relay host relayhost = [mail.privateemail.com]:587
# enable SASL authentication smtp_sasl_auth_enable = yes # disallow methods that allow anonymous authentication. smtp_sasl_security_options = noanonymous # where to find sasl_passwd smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd # Enable STARTTLS encryption smtp_use_tls = yes # where to find CA certificates smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sudo service postfix restart
in my maillog I get this:
Nov 24 22:33:34 new-host-1 sendmail[4737]: vAP3XYeD004737: to=admin@giftboundgifts.com, ctladdr=admin@giftboundgifts.com (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=48631, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Nov 24 22:36:45 new-host-1 postfix/postmap[4808]: warning: /etc/postfix/sasl_passwd: logical line must not start with whitespace: " [mail.privateemail.com] admin..."