Hi all! So, I have just created what might be my first qpsmtpd plugin!
I decided to hand-maintain a list of valid addresses on my system, since it was too complex to automate with mailman-run mailing lists on virtual domains. And, given my double bounce spam problem, I need to be able to identify valid recipients at RCTP TO time. So, not finding one that could do that, I decided to try create my own. It should be a good way to start creating qpsmtpd plugins anyway. Problem is, I don't have a suitable test system right now, as I just had a hardware failure... :-( Therefore, I hope you good folks could poke at it with a critical eye and see if it is likely to do as intended: Just checked it in: http://svn.kjernsmo.net/qpsmtpd-check-rcptlist/trunk/check_rcptlist The only code looks like this: sub hook_rcpt { my ($self, $transaction, $recipient) = @_; foreach my $ok ($self->qp->config('validaddresses')) { return OK if ($recipient->user eq $ok); # That's a valid address } return DENY; # Then it doesn't exist } Sane? For one thing, is a for-loop OK here, or are there more efficient ways to do it? Chris Prather posted this version when I started to ask around: http://scsys.co.uk:8001/5030 Remember, the list will never be big, as it is hand-maintained. Then, I'm in a slight doubt as to the semantics of OK and DENY in this context: OK does only mean that the address is OK, not that it will pass unhindered through my other filters? And does DENY mean that "this address was incorrect, but you may try another" and DENY_DISCONNECT would tell the client to go away? Or does DENY also mean "go away"? I'm not sure I would want to say "go away", because it could be an honest mistake (one valid user and a user who recently left in the CC list, for example). If this looks sane, it would be pretty trivial to implement VRFY the same way, but is that sane to do nowadays, or will it just mean less work for spammers? Cheers, Kjetil -- Kjetil Kjernsmo Programmer / Astrophysicist / Ski-orienteer / Orienteer / Mountaineer [EMAIL PROTECTED] Homepage: http://www.kjetil.kjernsmo.net/ OpenPGP KeyID: 6A6A0BBC
