develooper Front page | perl.qpsmtpd | Postings from August 2007

Re: ANNOUNCE: Plugins check_content_type / check_user

Thread Previous | Thread Next
August 28, 2007 12:07
Re: ANNOUNCE: Plugins check_content_type / check_user
Message ID:
Jens Weibler wrote on 28.08.2007 19:41:
> Ernesto wrote:
>> Jens Weibler wrote on 28.08.2007 08:27:
>>> Ernesto wrote:
>>>> *check_user*
>>> Do I see it right, that you're sharing one mysql-connection for
>>> all connections?
>> Yes.
>>> What about threaded qpsmtpd?
> mmh, I think the problem is that two threads could execute a query
> over one connection at the same time.

I think, that the database engine will keep track about the queries.

And for MySQL the Perl fork seems to close the connection, therefore
mysql_auto_reconnect has to be used. Please look at the source of

> [...]
> $spam_reject_threshold is written into $transaction->notes where it's
> later read by the spamassassin plugin.
> As you can see I need a custom query because I also check a
> alias-table.
> My idea: every column starting with "notes_" could be automatically
> imported into the transaction notes (=session variable)..

check_user was designed mainly for the qpsmtpd-exim4 environment, where
exim4 runs only the queue-daemon.

We have no catch-all user and no alias file; all users are virtual and
only in the email_table splitted into the fields local_part (user) and
domain. The other form (email_adress as 'user@domain') might be used by
other setups.

A third column (forward) tells exim, where to send the mail (local or
external) and another column (box) gives the physical place of the
local mailbox - e.g.:

local_part domain      forward          box
user1                   b_user1
user2                   b_user2

Please see

check_user makes not more or less then looking up the user in the
central configuration database of the mailsystem - spam handling etc. is
leftover to other plugins.

And that you wrote a plugin by yourself shows only, how easy it is to
extend qpsmtpd ;-)

Just place your plugin near mine and they'll work together.

On the other hand you're right - with qpsmtpd the spam and virus
scanning is done during smtp phase in contrast to exim4, where this is
done after queuing. Maybe it will make sense to use the other fields in
email_table (see above link) and put them into the notes, thus providing
an user-based spam handling i.e.

Maybe than the name of the plugin should be changed to
check_user_and_get_scan_options or something like that.

Just looking at the shipped spamassassin plugin: It doesn't use
$transaction->notes - lot of work ;-)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About