develooper Front page | perl.qpsmtpd | Postings from January 2007

handle multiple recipients differently?

Thread Next
From:
Joe Knall
Date:
January 13, 2007 11:57
Subject:
handle multiple recipients differently?
Message ID:
200701132057.06715.joe.knall@gmx.net
Hello,

how do I make qpsmtpd handle a mail with multiple recipients as several 
completely separate transactions?

As far as I understand a mail with two recipients triggers hook_rcpt 
twice. Problem: hook_rcpt returns only one return value.

Imagine a mail like this:
echo test | mail -r sender@example.com -s test37 \ 
recipient1@example.com,recipient2@example.com,recipient3@example.com

Now recipient2@example.com doesn't exist so my check (hook_rcpt) 
actually should return DENY, but recipient1 and recipient3 do exist so 
my check actually should return OK.
In fact if hook_rcpt returns DENY for my non existent recipient2 the 
other two won't get their messages.

Currently I save the returns, evaluate them afterwards (hook_data) and 
return OK as soon as at least one of them is OK.
Does anyone know an easy way how to hanldle this case, eg. how to send a 
reply "recipient2@example.com doesn't exist"?

Related case:
Header lines can be accessed in hook_data_post which is only run once. 
How can I add different headers for each recipient like 
"X-Test-Redirected: for recipient1@example.com to 
alternate-addr-recipient1@example.com"? Of course this should not be 
written to the headers of recipient3.

I think qpsmtpd does nothing wrong, it just handles mail. So in the end 
my question boils down to "how do I make qpsmtpd handle a mail with 
multiple recipients as several completely separate transactions?"

Thanks for your ideas, Joe

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About