Re: Plugin to manage gone users

[email protected] ("Peter J. Holzer")
Newsgroups perl.qpsmtpd
Message-ID <[email protected]>
On 2010-09-05 21:51:27 +0200, Kjetil Kjernsmo wrote:
> I have a small number of users that are no longer using the system, but 
> have no known forwarding address. Thus, I'd like to auto-respond to 
> messages to these users (after spamassassin), but I'd like to respond with 
> a permanent error (550, right?)

551 would be better. But last time I looked, plugins couldn't return
specific codes.

> so that mailing list system can automatically remove these addresses
> from their lists. Furthermore, I'd like to include a long text
> explaining where the user went.
> 
> I'm not familiar enough with SMTP to know if such a text can be included in 
> a 550-message, but if it can, this sounds like a pretty trivial plugin. Has 
> anyone written such a thing?

I use that one:


sub hook_rcpt {
    my ($self, $transaction, $rcpt) = @_;
    
    return DECLINED unless $rcpt->notes('redirect');

    if ($rcpt->notes('redirect') =~ /(.*)\@(.*)/) {
        return DENY, "Mail address disabled; try <" . $rcpt->notes('redirect') . ">";
    } else {
        my ($local, $domain) = $rcpt->address =~ /(.*)\@(.*)/;
        return DENY, "Mail address disabled; try <" . $local . '@' . $rcpt->notes('redirect') . ">";
    }
}


Of course you need another plugin to set the "redirect" note on the
recipient, but that's part of my general address-handling.

	hp

-- 
   _  | Peter J. Holzer    | Openmoko has already embedded
|_|_) | Sysadmin WSR       | voting system.
| |   | [email protected]         | Named "If you want it -- write it"
__/   | http://www.hjp.at/ |  -- Ilja O. on [email protected]
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFMhAaUfZ+RkG8quy0RAtFnAJsF0TRVAuWY42ZFzy7mTuuu3EzdnwCfcStq
YzeDix5moc12uoLOq9amAH8=
=zhl9
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.