Linode Forum
https://forum.linode.com/

Linode Postfix configuration
https://forum.linode.com/viewtopic.php?f=11&t=11909
Page 1 of 1

Author:  ckaya [ Wed Jun 10, 2015 4:55 am ]
Post subject:  Linode Postfix configuration

Hi All,

I have followed exactly the following to setup postfix on ubuntu with gmail apps.

https://www.linode.com/docs/email/postf ... oogle-apps

postfix/main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# 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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = allhealthy.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = allhealthy.co.uk, localhost.co.uk, , localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

etc/hosts:
127.0.0.1 allhealthy.co.uk localhost allhealthy

Following is not sending any mail. No error message in /var/log/mail.log /var/log/mail.err

sendmail xyz@gmail.com
FROM: admin@allhealthy.co.uk
SUBJECT: test
test
.

What is wrong?

Thx
CK

Author:  sanvila [ Wed Jun 10, 2015 5:49 pm ]
Post subject:  Re: Linode Postfix configuration

Your /etc/hosts is definitely wrong. It should be like this:
Code:
127.0.0.1 localhost
123.456.789.123 allhealthy.co.uk allhealthy

where the obviously faked IP 123.456.789.123 should be your own IP.

Author:  ckaya [ Thu Jun 11, 2015 4:09 am ]
Post subject:  Re: Linode Postfix configuration

Exactly done as you said. It is also weird that there is nothing on /var/log/mail.log. It is blank. No error messages. I keep sending messages with sendmail from command prompt and nothing happens.

The DNS settings on Linode:

MX Records
Mail Server Preference Subdomain TTL Options
ALT2.ASPMX.L.GOOGLE.COM 5 300 (5 minutes) Edit | Remove
ALT1.ASPMX.L.GOOGLE.COM 5 300 (5 minutes) Edit | Remove
ALT3.ASPMX.L.GOOGLE.COM 10 Default Edit | Remove


I do not know what to do. At least I should get an error or some trace log of what is going on..
I even added the following to main.cf for debug messages.

debug_peer_level = 2
debug_peer_list = mydomainhere


Thx for the help.

Author:  ckaya [ Fri Jun 12, 2015 2:25 am ]
Post subject:  Re: Linode Postfix configuration

Today, I started to get some output on the mail.log
When I sent the mail, I get the following but still the mail is not reached at the destination:

Jun 12 10:21:25 allhealthy postfix/pickup[7651]: 0A21D340A1: uid=1000 from=<forge>
Jun 12 10:21:25 allhealthy postfix/cleanup[9609]: 0A21D340A1: message-id=<20150612062125.0A21D340A1@allhealthy.co.uk>
Jun 12 10:21:25 allhealthy postfix/qmgr[3180]: 0A21D340A1: from=<forge@allhealthy.co.uk>, size=273, nrcpt=1 (queue active)
Jun 12 10:21:25 allhealthy postfix/local[9611]: 0A21D340A1: to=<sales@allhealthy.co.uk>, relay=local, delay=23, delays=23/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jun 12 10:21:25 allhealthy postfix/qmgr[3180]: 0A21D340A1: removed


I have even checked the spam of the "To" destination. No mail! By the way I am using Google Apps...

Thx a lot.

Author:  ckaya [ Fri Jun 12, 2015 3:44 am ]
Post subject:  Re: Linode Postfix configuration

Yes now it worked finally.

main.cf

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = allhealthy.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all


etc/hosts

127.0.0.1 localhost
109.237.24.35 allhealthy.co.uk allhealthy localhost mail.allhealthy.co.uk

Author:  Vance [ Sat Jun 13, 2015 8:43 pm ]
Post subject:  Re: Linode Postfix configuration

Based on previous discussions in the forum, my understanding is that if you send mail from a Gmail account that gets redirected back to that account, it will not appear in your inbox (but will be in your sent messages). So if mail to your sales@ address ends up being forwarded to the account you're sending mail from, Gmail will take it upon itself to ignore the message, since it knows you sent it.

It's not exactly clear whether this applies to your situation here, but thought it might be a potential point of confusion.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/