Markus Ullmann skribis 2008-05-07 12:22 (+0200):
> # this plugin checks if a user exists in the vpopmail database

Note that a database check does not account for catch-alls
(.qmail-default, vdelivermail), qmail's extension mechanism
(.qmail-foo-default), and manually added anythings (.qmail-foo).

A plugin like that is only useful in a highly homogenous environment.

>   my $bad = $local_part . '@' . $domain_part;

I would suggest not calling this $bad, as at this point in the code,
it's not yet known if this is good or bad. How about $address?

>   my $sth_1 = $dbh->prepare(<<SQL);
> select *
> from vpopmail
> where pw_name = ? and pw_domain = ?
> SQL

You could increase performance by re-using the database connection and
prepared statement handle for subsequent checks. Remember that a single
mail transaction can enlist numerous recipients.

>   return (DENY,Qpsmtpd::DSN->no_such_user("mail to $bad not accepted here"));

While this is a common error message, I personally find it uninformative
and that it looks like the address was blacklisted. My personal
preference is qmail's default "No mailbox here by that name".

Are you going to release your plugin? If so, I would like to include it
(as a level 0 solution) in Qmail::Deliverable::Comparison.
-- 
Met vriendelijke groet,  Kind regards,  Korajn salutojn,

  Juerd Waalboer:  Perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  Convolution:     ICT solutions and consultancy <[EMAIL PROTECTED]>
1;

Reply via email to