On Tue, 10 Jun 2008 13:59:43 +0200, Jan Völkers wrote:
> Hello,
> 
> has anyone written a rcptto_vrfy plugin?
> 
> I set up a new mx in a hurry and now i am searching for a nice 
> check_rcpt plugin. Actually i am using only the smtp_forward plugin 
> which has two disadvantages:
> 
> - it checks _after_ queueing the whole mail.
> 
> - it rejects legitimate mails: If one sends mails to different users 
> in the same domain with one correct and one incorrect address also 
> the legitimate receiver will not get any mail as it is completely 
> rejected.
> 
> 
> I would appreciate a simple plugin that checks recipients via vrfy. Yes,
> my next hop answers vrfy correctly.
> 
> Does anybody know something like this or has other suggestions? My Users
> are homed as virtual users and aliases in a mysql db, but i prefer 
> the vrfy way as it is more portable.

I don't think anyone has written one yet. We've talked a LOT about 
making smtp_forward be more of a direct proxy, or at least do that 
optionally, but different users seem to have different requirements for 
that.

It should be really easy to write. Just use Net::SMTP to make the 
connection and issue the VRFY.

Something like this:

use Net::SMTP;
sub hook_mail {
    my ($self, $tran) = @_;
    $tran->notes('my_smtp_server', Net::SMTP->new('wherever'));
    return DECLINED;
}
sub hook_rcpt {
    my ($self, $tran, $recipient) = @_;
    my $smtp = $tran->notes('my_smtp_server');
    if (!$smtp->verify($recipient->format)) {
        return DENY, "Bad recipient: $recipient";
    }
    return DECLINED;
}
sub hook_data {
    my ($self, $tran) = @_;
    my $smtp = $tran->notes('my_smtp_server');
    $smtp->quit;
    $tran->notes('my_smtp_server', undef);
    return DECLINED;
}

Matt.
  • rcptto_vrfy Jan Völkers
    • Re: rcptto_vrfy Matt Sergeant

Reply via email to