BreadCrumbs: Postfix


From Luke Jackson

(Difference between revisions)
Jump to: navigation, search
Revision as of 06:50, 17 September 2020 (edit)
Ljackson (Talk | contribs)
(Empty Mail Queue)
← Previous diff
Current revision (06:53, 17 September 2020) (edit)
Ljackson (Talk | contribs)
Line 90: Line 90:
* *
[[Category:Linux]] [[Category:Linux]]

Current revision



Deferred: Connection refused by []

Please uninstall sendmail and then restart Postfix.


# Check the /usr/share/doc/sendmail/ file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/ is part of the sendmail-doc
# package.
# by default we allow relaying from localhost...
localhost.localdomain           RELAY
localhost                       RELAY                       RELAY
mail.server.ext                 RELAY

Comcast requires that all mail servers must have a PTR record with a valid Reverse DNS entry.

"Currently your mail server does not fill that requirement." - For more information, refer to:

[Solved] Changing Postfix Outbound IP Address

Changing Postfix Outbound IP Address

When a server has more than one IP address assigned to it, Postfix randomly selects an IP address for outbound emails. This default Postfix behavior can result in emails being listed as spam due to the sending IP not matching the IP address to which the server hostname is resolving.

The solution is to bind Postfix to the server's primary IP, or the IP to which the server's hostname is resolving.

Using your favorite text editor, open the Postfix configuration file:

vim /etc/postfix/

Add the line:

smtp_bind_address =

Where has to be replaced with the primary IP address of the server.

Then, restart Postfix:

/etc/init.d/postfix restart

Command To Know

postfix flush
postmap <file>
cat /var/log/mail.log
/etc/init.d/postfix reload

Empty Mail Queue

postsuper -d ALL
postsuper -d ALL deferred

Postfix Script (PHP)

  • Create script to parse incoming mail*
  $data = file_get_contents("php://stdin");
  • Add a new email address to Postfix configuration*
vi /etc/aliases
  • Add the following line (everything on one line)*
email+to+redirect: "| php -q /home/user/full/path/to/your/new/script.php"
  • Apply the changes to the aliases by running*
  • Reload Postfix and Restart*
/etc/init.d/postfix reload
/etc/init.d/postfix restart


Personal tools