Intercept and redirect email from a particular user

We've got a guy sending a bunch of our admins abusive and threatening email=
..  Legal and the police would like us to intercept any email coming from th=
at guys address (yes, I know he could change it, but doubt he will anytime =
soon), and silently redirect it to a police email address, where they'll mo=
nitor it for escalation, or signs he's coming into the area.

What's the easiest way to do this?  I can think of several if I was redirec=
ting the to, but not the from.

Thanks for any help anyone can give.
8/29/2016 11:46:50 PM
comp.mail.sendmail 13518 articles. 1 followers. jfretby (35) is leader. Post Follow

3 Replies

Similar Articles

[PageSpeed] 14

> police would like us to intercept any email coming from that guys address (yes, I know he

Custom rules... search for "sender based routing", that should
give you a good starting point.

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.
8/30/2016 7:35:57 PM
On Mon, 29 Aug 2016 16:46:50 -0700, ron.jarrell wrote:

> Legal and the police would like us to intercept any email coming from
> that guys address

To forward to one recipient:

In virtusertable:

recipient@yourdomain	police@theirdomain

Or to forward to more than one recipient use aliases:

In virtusertable:

recipient@yourdomain	local_alias_badboy

In aliases:

local_alias_badboy:	address1@domain1, address2@domain2 [,more...]

In access:

To:local_alias_badboy@	DISCARD

Not forgetting to remake the db('s) and restart sendmail!

9/3/2016 10:20:07 AM
Realised I not only (partially) misread the original post but also made a 
number of hidden assumptions that won't have helped!

The solution I'd use would be the "mimedefang" milter.  Easy to install, 
and by far the most powerful sendmail milter of all (Though I've never 
actually used its mime-defanging capabilities!)

In the "sub filter_end" routine of the "mimedefang-filter" config file, 
add something like:

if ($sender =~ /badboy's addy/i) {
  delete_recipient('admin's addy');
  add_recipient ('lawyer's addy');
  add_recipient ('police addy');
  ... repeat for others as required, if any (yourself for testing?)

That's it, done and dusted!

Should all be very familiar if you're familiar with Perl, otherwise note 
the slashes in the first line, they're literal as is the 'i' (ignore 
case). The enclosing "'" in add_recipient() are also literal. Addies are 
in the usual mail form, though probably best to leave out the usual 
containing '<>'s unless/until you've got the hang of it.
9/14/2016 11:25:50 PM