Tony Holmes wrote:
My google-fu has failed me.

I have a FreeBSD 7 system for hosting php for  various users on it.
I wish to allow the php mail() function to work but to aslo prevent
spam and enforce an outgoing quota. I have replaced the default sendmail
command and am including my own wrapper to ensure the from address is
being set correctly so that the policy server (postfix-policyd-sf).

The wrapper I wrote uses the sendmail compatibility with -t so that it
pulls the from/to from the email body itself.

The pertinent line in my main.cf is:

smtpd_sender_restrictions =
        check_sender_access hash:/usr/local/etc/postfix/cwahi_net-allowed
        check_policy_service inet:216.18.117.19:10031
        reject


Note: sendmail client is received via the pickup service *not* smptd.

You need PHP to send via SMTP. There are many ways to do this and many scripts available to integrate. My favorite is htmlMimeMail (google it for details). There is also the PEAR version as well.

Brian
/usr/local/etc/postfix/cwahi_net-allowed:
root    PERMIT

So basically, I don't trust anyone on the system, but I want root to be
able to send (it goes to a relayhost) so that I get my nightly cron jobs,
etc. Everyone else can only send if the policy service allows it.

However, the policy service is never checked.

I set mynetwork=  since I don't even want to trust myself, but no go.

I have to be missing something obvious, but I'm not sure what.

Pointers?



Reply via email to