----- Original Message ----- From: Brian Evans - Postfix List <grkni...@scent-team.com> To: Postfix users <postfix-users@postfix.org> Date: Wed, 19 Aug 2009 14:41:51 -0400 Subject: Re: Special needs(filter - SASL)
> none none wrote: > > I would like email to be filtered ONLY from user that relays(SASL > > authed) mail to the outside(not localhost) mailbox. > > That is, if that same user is sending mail from local machine(no > > relaying) then filter doesn't kicks in. > > > > I've looked at postfix man pages and documentation and it is too much > > hassle about creating other instances of smtp ot smtpd etc... and pcre > > has limited caps for me. > > > > I am very skilled when it comes to PHP, so would like to create PHP > > script that would "suck" that mail in and spit it out for delivery by > > postfix. > > > > But Right now I would be happy even with in /usr/local/etc/postfix/main.cf: > > header_checks = pcre:/usr/local/etc/postfix/strip_relay_header > > > > BUT, that header_checks rule should kick in ONLY for remote SASL > > authed user when target mailbox is NOT locally hosted (goes out to the > > internet) > > > header_checks are applied globally for an instance. There is no way > around that fact. > > What *is* possible is to use a content_filter or milter instead. > > See some ideas here: > http://www.postfix.org/FILTER_README.html > http://www.postfix.org/MILTER_README.html > I think I will go for "before-queue Milter support" SMTP-only - which means It will be applied to incoming mail from the internet(Both SASL authed and those from outside senders with target as/for local mailboxes) I am a little bit puzzled with qmqpd. When it kicks in? I read "only explicitly authorized client hosts are allowed to use the service" And is in network category, so were hopping that, it would be my ticket to apply filter only to SASL authed users and no one else. /etc/postfix/main.cf: # Milters for mail that arrives via the smtpd(8) server. # See below for socket address syntax. smtpd_milters = unix:/path/to/php_daemon/its.sock This is how I link to my php daemon. Now tell me, how does string(which is mail[it's header & body]) is PASSED to and RETRIEVED back to postfix? I mean, is it true, that string(which is mail[it's header & body]) goes to "its.sock" AND after filtering, is returned to postfix, again, via "its.sock"