Discussion:
setting up postfix for outgoing mail ONLY -- no local mail
(too old to reply)
sneakyimp
2011-07-27 21:25:21 UTC
Permalink
I want to install postfix with the following goals in mind:
* let PHP scripts send mail using the mail() function function (http://
php.net/mail).
* various system notification functions (cron, etc.) will be able to
send their emails
* emails destined for ***@localhost will be redirected to some FQDN
such as ***@mydomain.com
* let tiger, samhain or other monitoring apps send their notification
emails
* NO INCOMING OR LOCAL MAIL IS PERMITTED. Because mail for my domain
is handled by google apps, nobody will be checking mail on this
server. Also, this server has very limited disk space. It is therefore
very important that we don't have mail accumulating in boxes that will
never be checked.
* no unnecessary ports, services, or cron jobs are running. ideally,
there would be no external ports open on the machine.

I've been reading a variety of pages that describe postfix setup on
Ubuntu but these articles are imprecise, incomplete, and describe
installation of things I don't want like POP/IMAP/etc:
https://help.ubuntu.com/community/Postfix
https://help.ubuntu.com/community/PostfixAmavisNew
https://help.ubuntu.com/community/PostfixCompleteVirtualMailSystemHowto

There's also one final wrinkle. I will be setting up postfix to send
via Amazon SES:
http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html?IntegratingWithServer.Postfix.html

If anyone can help me sort this, I'd very much like any tips or
suggestions you may have.
Pradip Barua
2013-02-12 08:53:11 UTC
Permalink
Post by sneakyimp
* let PHP scripts send mail using the mail() function function (http://
php.net/mail).
* various system notification functions (cron, etc.) will be able to
send their emails
* let tiger, samhain or other monitoring apps send their notification
emails
* NO INCOMING OR LOCAL MAIL IS PERMITTED. Because mail for my domain
is handled by google apps, nobody will be checking mail on this
server. Also, this server has very limited disk space. It is therefore
very important that we don't have mail accumulating in boxes that will
never be checked.
* no unnecessary ports, services, or cron jobs are running. ideally,
there would be no external ports open on the machine.
I've been reading a variety of pages that describe postfix setup on
Ubuntu but these articles are imprecise, incomplete, and describe
https://help.ubuntu.com/community/Postfix
https://help.ubuntu.com/community/PostfixAmavisNew
https://help.ubuntu.com/community/PostfixCompleteVirtualMailSystemHowto
There's also one final wrinkle. I will be setting up postfix to send
http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/index.html?IntegratingWithServer.Postfix.html
If anyone can help me sort this, I'd very much like any tips or
suggestions you may have.
First Configure your postfix mail server as a null client. an example is given below:
myhostname = host.example.com
mydestination =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
local_recipient_maps =
local_transport = error:local delivery is disabled
canonical_maps = hash:/etc/postfix/canonical
mailbox_size_limit = 0
inet_interfaces = loopback-only

then configure /etc/postfix/canonical for any mail to local users will have an address.
remember to issue postmap /etc/postfix/canonical after each change to the file.


If postfix properly configured you php script will be able to send mail via your MTA.
Loading...