Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QUARANTINE in access file

30 views
Skip to first unread message

Joe Brennan

unread,
May 22, 2015, 11:47:58 AM5/22/15
to
To handle a temporary situation in a few weeks where some local users will be undeliverable, I want to queue up mail for those users for a few hours, and then release it when it will work again. Quarantine looked like a nice solution but it's not working for recipient addresses.

When I put this in access file... From:x...@columbia.edu QUARANTINE ...it quarantines mail from that address as expected.

But I need to do it by recipient like this... To:y...@columbia.edu QUARANTINE ...and this is ignored. It should work with a To: address, shouldn't it?

Joseph Brennan
Columbia University

Claus Aßmann

unread,
May 25, 2015, 11:40:03 AM5/25/15
to
Joe Brennan wrote:

> But I need to do it by recipient like this... To:y...@columbia.edu QUARANTINE ...and this is
> ignored. It should work with a To: address, shouldn't it?

Do you have
FEATURE(blacklist_recipients)
in your mc file?

Try your config in -bt mode:
http://www.sendmail.org/~ca/email/chk-dbg.html


--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

Joe Brennan

unread,
May 26, 2015, 9:24:20 AM5/26/15
to
On Monday, May 25, 2015 at 11:40:03 AM UTC-4, Claus Aßmann -no-copies-please wrote:

> Do you have
> FEATURE(blacklist_recipients)
> in your mc file?
>

I do not. Thanks!

Joseph Brennan
Columbia University

Joe Brennan

unread,
May 26, 2015, 10:18:53 AM5/26/15
to
Problem solved! Thanks again, Claus.

For anyone else who reads this... FEATURE(blacklist_recipients) is needed in order to quarantine by recipient. Then it's all good, done as follows.

access file:
To:sp...@columbia.edu QUARANTINE:foobar

makemap hash access < access, then check with -bt:

# /usr/sbin/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /map access To:sp...@columbia.edu
map_lookup: access (To:sp...@columbia.edu) returns QUARANTINE:foobar (0)
> Rcpt_ok sp...@columbia.edu
Rcpt_ok input: spam @ columbia . edu
ParseRecipient input: spam @ columbia . edu
CanonAddr input: spam @ columbia . edu
canonify input: spam @ columbia . edu
Canonify2 input: spam < @ columbia . edu >
Canonify2 returns: spam < @ columbia . edu . >
canonify returns: spam < @ columbia . edu . >
Parse0 input: spam < @ columbia . edu . >
Parse0 returns: spam < @ columbia . edu . >
CanonAddr returns: spam < @ columbia . edu . >
ParseRecipient returns: spam < @ columbia . edu >
SearchList input: < + To > $| < F : spam @ columbia . edu > < U : spam @ > < D : columbia . edu > < >
F input: < spam @ columbia . edu > < ? > < + To > < >
F returns: < QUARANTINE : foobar > < >
SearchList returns: < QUARANTINE : foobar >
Rcpt_ok returns: $# error $@ quarantine $: foobar


At port 25 all looks normal (done from another host):
rcpt to:<sp...@columbia.edu>
250 2.1.5 <sp...@columbia.edu>... Recipient ok

And here it is, quarantined:
# ls /var/spool/mqueue/
dft4QE86m2032233 hft4QE86m2032233


Joseph Brennan
Columbia University

0 new messages