[Rspamd-Users] per recipient reject

G.W. Haywood rspamd at jubileegroup.co.uk
Mon Aug 21 16:50:46 UTC 2023


Hi there,

On Mon, 21 Aug 2023, rspam at padaru.de wrote:

> is there a way to isolate one specific recipient out of a
> multi-recipient mail and only reject this rcpt? I have a multimap
> rule, that checks for recipient and triggers "action = reject".
> Currently the complete mail with all recipients is then rejected.

The specifications for the interaction between milters and the Postfix
and Sendmail MTAs say that if a milter returns REJECT at the envelope
recipient stage, then only that recipient is rejected; mail processing
continues with the next command from the client, which can be the next
recipient or the start of the message data (ignoring for the moment
things like aborting the transmission altogether).  See for example

.../libmilter/docs/overview.html
.../libmilter/docs/xxfi_envrcpt.html

in the Sendmail documentation (I only really do Sendmail).

Also see

.../libmilter/docs/smfi_delrcpt.html

which explains that during the "end of message" phase you can delete a
recipient; presumably at the earlier "envelope recipient" stage of the
SMTP conversation the recipient was accepted, but you can change your
mind as it were.  I do this sort of thing in my own milters but I have
no idea if anyone else ever does it.

So yes you can certainly do that but I don't know if you can easily do
it using rspamd.  If rspamd can't do it I guess I'd defend it, because
rspamd is looking for spam - so nobody wants it - and from what you're
asking it seems like the mail isn't actually spam, you just have picky
users or something.  (I have nothing against picky users, as you might
have guessed I lean to the picky side myself. :)

There are probably several milters which can address what you want to
do, but it will help if you can explain in detail under exactly what
circumstances you want to reject the recipient.  If it's just a matter
of rejecting this one recipient under all circumstances, then you can
probably do it in the MTA configuration itself.  It might be a little
more tricky if it's not so clear-cut as that.  There might be issues
deciding for example whether or not all the filters are to know that a
rejected recipient appeared in the recipients list - for example for
the purposes of spam scoring.  Which MTA are you using?

-- 

73,
Ged.


More information about the Users mailing list