El 12/09/2009, a las 15:38, Wietse Venema escribió:

Egoitz Aurrekoetxea Aurre:
When you are running the policy service under the spawn daemon:

1) The time limit BEGINS after an SMTP server connects to the
 policy server port, when a new policy daemon process is created.
 Thus, an SMTP server always "mates" with a policy server that
 has the full time limit left.

After the SMTP server has "mated" with a new policy daemon process,
the SMTP server keeps the connection open until it terminates.
During this time, the SMTP server will handle one or more SMTP
client requests, such as multiple requests in one SMTP session or
requests from different SMTP client (one SMTP client connects,
disconnects, another SMTP client connects, etc.)

When the SMTP server disconnects from the policy daemon, the
policy daemon must terminate.

and how could I know that the smtp server has disconnected from the policy server? what does postfix send for knowing it? I mean like it's tcpwrapped by spawn I don't know either some is connected or not.... it's just running waiting for attributes... For example, after I send an email (so after connecting to an smtpd proccess and after sending the mail and the quit command to postfix smtpd) if I do the following ps I see :

$ ps aux | grep pl && ps aux | grep smtp
cyrus 68585 0.2 0.4 23784 7852 ?? Ss 4:20PM 0:00.08 /usr/ bin/perl /usr/local/etc/postfix/postfix-qreject-frontales.pl (perl5.8.8) postfix 68584 0.0 0.1 13704 2232 ?? S 4:20PM 0:00.00 spawn -z -n 127.0.0.1:2222 -t inet user=cyrus argv=/usr/local/etc/ postfix/postfix-qreject-frontales.pl postfix 68581 0.0 0.2 29456 4236 ?? S 4:20PM 0:00.01 smtpd -n smtp -t inet -u postfix 68589 0.0 0.1 13828 2428 ?? S 4:20PM 0:00.01 smtp -n smtp-amavis -t unix -u -o smtp_data_done_timeout=1200 -o disable_dns_lookups=yes postfix 68591 0.0 0.2 28432 3692 ?? S 4:20PM 0:00.01 [smtpd]


so I have a spawn proccess for each the policy daemon (frontales.pl) and the own policy daemon running in this example with the user cyrus...


It is an error to terminate before
the SMTP server disconnects.

That's why policy daemon closes all mysql connections, all file descriptors and all before printing action to STDOUT later clears hash table of attributes and starts a new cycle


In particular, the policy daemon should not terminate after each
request.  This would waste a lot of system resources.

That's why I do it this way, so it's done well then.


If you believe that your SMTP server processes will be running fore
more than 3600s (for example, when receiving large messages over
a dialup connection) then increase the limit.

        Wietse

Thanks a lot really Wietse.

Reply via email to