I'm in a situation where I need to rewrite, sometimes, the recipients of a message.
My basic problem is that I have two plugins: 1. recipient_foo 2. rcpt_ok (This is the vanilla version in qpsmtpd.) In the first plugin I wish to make tests, and possibly rewrite the recipient address. The intention is that rcpt_oks hook_rcpt function will then test against the updated recipient - however that doesn't work. (ie. If I try to modify $transaction->recipients() the current recipient hasn't yet been added to it. Obvious since hook_rcpt hasn't returned yet!) The current qpsmtpd implementation pretty much does: 1. Reads : RCPT TO <[EMAIL PROTECTED]> from SMTP 2. For each rcpt_hook registered call them in turn until we get OK/DENY/etc. This means right now, without modifying rcpt_ok, I'm out of luck. I can update recipient_foo to change the recipients only in a different stage of the SMTP transaction. (e.g. Like the "alias_rewrite" plugin[0] I can do the testing at RCPT stage, and rewrite the transaction's recipients() list in the DATA stage - but that doesn't allow me to work with a vanilla rcpt_ok plugin.) Ideally I'd like to be able to modify the recipient prior to subsequent hook_rcpt calls - is that possible? I've looked around over the source but I can't see a simple method of doing so. Steve -- [0] - Two-stage rewriting in alias_rewrite. http://www.hjp.at/projekte/qpsmtpd/aliases/