Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amolkhanorkar/6710860 to your computer and use it in GitHub Desktop.
Save amolkhanorkar/6710860 to your computer and use it in GitHub Desktop.
I got the error while I am trying to send mail using postfix on ubuntu 12.04 LTS server.
I checked the mail logs, below are the logs:
Sep 26 02:02:12 git postfix/qmgr[17117]: 85F4E56C1E10: removed
Sep 26 02:17:23 git postfix/master[17113]: terminating on signal 15
Sep 26 02:17:23 git postfix/master[17271]: daemon started -- version 2.9.6, configuration /etc/postfix
Sep 26 02:17:44 git postfix/pickup[17274]: 5758F56C1E0F: uid=1000 from=<[email protected]>
Sep 26 02:17:44 git postfix/cleanup[17280]: 5758F56C1E0F: message-id=<[email protected]>
Sep 26 02:17:44 git postfix/qmgr[17275]: 5758F56C1E0F: from=<>, size=885, nrcpt=1 (queue active)
Sep 26 02:17:44 git postfix/local[17282]: 5758F56C1E0F: to=<>, relay=local, delay=0.25, delays=0.01/0/0/0.24, dsn=5.1.1, status=bounced (unknown user: "")
Sep 26 02:17:44 git postfix/cleanup[17280]: 92C2756C1E10: message-id=<20130926061744.92C2756C1E10@>
Sep 26 02:17:44 git postfix/bounce[17283]: 5758F56C1E0F: sender non-delivery notification: 92C2756C1E10
Sep 26 02:17:44 git postfix/qmgr[17275]: 92C2756C1E10: from=<>, size=2695, nrcpt=1 (queue active)
Sep 26 02:17:44 git postfix/qmgr[17275]: 5758F56C1E0F: removed
Sep 26 02:17:44 git postfix/local[17282]: 92C2756C1E10: to=<[email protected]>, relay=local, delay=0, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Sep 26 02:17:44 git postfix/qmgr[17275]: 92C2756C1E10: removed
Sep 26 02:18:53 git postfix/postfix-script[17293]: error: unknown command: ''
Sep 26 02:18:53 git postfix/postfix-script[17294]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Then, I figured out the relay host value is,
"relay=local, delay=0, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")"
Here, the mail relay having the value 'localhost', means whenever we tried to send mail the system , it looks on to the local system for mail address.
I resolved this issue by changing the relay host value by the actual domain MX Record value "aspmx.l.google.com". It is pointing to google mail server.
STEPS for resolving the issue,
1) Completly purge postfix from the system.
sudo apt-get purge postfix -y
2) Reinstall the postfix, Enter the proper FQDN for the system mail setting.
3) Then, it prompt for hostname.
Select 'Internet Site with SmartHost' and press enter to confirm the hostname.
Enter your proper hostname for the mail settings.
You can find your DNS Lookup record from "http://www.unlocktheinbox.com/dnslookup/mx/"
4) Restart postfix Deamon.
sudo /etc/init.d/postfix restart
Now I am able to send mails successfully. Following are the Mail logs:
Sep 26 02:18:57 git postfix/postfix-script[17301]: refreshing the Postfix mail system
Sep 26 02:18:57 git postfix/master[17271]: reload -- version 2.9.6, configuration /etc/postfix
Sep 26 02:19:48 git postfix/master[17271]: terminating on signal 15
Sep 26 02:27:48 git postfix/master[18568]: daemon started -- version 2.9.6, configuration /etc/postfix
Sep 26 02:28:18 git postfix/pickup[18571]: 27B8756C1E0C: uid=1000 from=<>
Sep 26 02:28:18 git postfix/cleanup[18582]: 27B8756C1E0C: message-id=<[email protected]>
Sep 26 02:28:18 git postfix/qmgr[18572]: 27B8756C1E0C: from=<>, size=886, nrcpt=1 (queue active)
Sep 26 02:28:27 git postfix/smtp[18584]: connect to aspmx.l.google.com[2a00:1450:4008:c01::1a]:25: Network is unreachable
Sep 26 02:28:30 git postfix/smtp[18584]: 27B8756C1E0C: to=<>, relay=aspmx.l.google.com[74.125.129.26]:25, delay=12, delays=0.01/0/11/1.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1380177108 ei3si27714pbc.140 - gsmtp)
Sep 26 02:28:30 git postfix/qmgr[18572]: 27B8756C1E0C: removed
Sep 26 02:30:11 git postfix/pickup[18571]: 60F9556C1E0D: uid=1000 from=<>
Sep 26 02:30:11 git postfix/cleanup[18589]: 60F9556C1E0D: message-id=<[email protected]>
Sep 26 02:30:11 git postfix/qmgr[18572]: 60F9556C1E0D: from=<>, size=870, nrcpt=1 (queue active)
Sep 26 02:30:13 git postfix/smtp[18591]: 60F9556C1E0D: to=<>, relay=aspmx.l.google.com[173.194.79.27]:25, delay=2.4, delays=0.02/0.01/1.1/1.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1380177211 gx9si2009989pac.185 - gsmtp)
Sep 26 02:30:13 git postfix/qmgr[18572]: 60F9556C1E0D: removed
Cheers !! ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment