Viktor Dukhovni wrote:
For policy services spawn is fine, because each smtpd(8) connects
once and makes many requests.  However, you need to NOT exit until
the connection is closed by the client (i.e. smtpd(8)).  Rather
you need to loop reading requests and writing responses until there
are no more requests.
I suspected as much, but when I tried this previously ;
do{
      ... rest of  script ....
} until (time==0)

I ended up overloading my VPS. On examination, I found Postfix opened a new policy instance each time, and each instance kept on running after Postfix had disconnected. I killed the processes manually and did away with the loop adding the exit(0) clause. All seemed well after that. I not asking for advice here, but think the socket idea is the best route to explore next.



The only per-parameter documentation is a reference manual, not a
tutorial.  Reference manuals document available features and syntax.
Yeah well, that may be. I have picked up ideas from it, but then had to look elsewhere. If I want to do something, I tend to ignore any searches that point to postfix.org as mostly the data there is just not helpful to me.



Out of interest to me, and perhaps P.V. who asked the question in the first
place, how would you even start?  smtpd_sender_login_maps = exactly what?

A list of tables that map envelope sender addresses to lists of
SASL login names.  There are many supported table types.  These
are referenced from DATABASE_README which has links to per-type
documents.

With SQL tables you can make union queries that neatly solve the
problem at hand.  Something along the lines of:

        SELECT sasl_login
        FROM sender_to_login
        WHERE sender_to_login.sender = '%u@%d' -- unlike %s, no partial keys
        UNION
        SELECT sasl_login
        FROM anysender_login


I get the basics of how MySQL works, though UNION and unlike are new to me. Perhaps -- denotes a comment? I understand how to read and write to them at least. What are %u, %d an %s? Global postfix variables for $sasl_user, $domain $sender? You surely could not add ...

smtpd_sender_login_maps = SELECT sasl_login
        FROM sender_to_login
       <snip>

... could you? Clear as mud, but thanks for trying to explain it.





Can you create a text file containing  ;
....
a...@domain.tld, f...@domain.tld, g...@domain.tld
b...@domain.tld, f...@domain.tld, h...@domain.tld, j...@domain.tld

Well, for simple indexed files via postmap, no comma in the key
column. Just optional commas between the RHS elements.
RHS? Royal Horticultural Society ;-)


My employer is running the 2.11 backport on wheezy just fine.  This
takes very little effort (I am not the one managing the MTA).
I will wait for the distro. I'm not prepared to take the change of it going pear shaped. It took me near on 3 months to get it running as I wanted it. Don't want to ever spend that much time banging my head against a brick wall again.
As for lookups by SASL user

        smtpd_sender_restrictions =
            check_sasl_access <some-table>,
            reject_sender_login_mismatch,
            ...

Just use "OK" for the RHS of <some-table> for logins not constrained
to any particular sender address, then they are not contrained by
the mismatch check that follows.

If you've not yet read the Postfix book by Ralf and Patrick, do.

Thanks for your input. All questions asked n this message are rhetorical, so no reply expected. Without working commented examples I simply won't get it. I have downloaded "The Postfix Book". Thanks for that. A real bonus for sure. While a lot has probably changed or been added since 2005 I'm sure I will get up a better idea of what is going on from there.

Thanks Viktor, and good luck P.V.

Mick.


Reply via email to