Re: [exim] Setting up a mailsink/blackhole?

Pàgina inicial
Delete this message
Reply to this message
Autor: Andrew Heagle
Data:  
A: exim-users
Assumpte: Re: [exim] Setting up a mailsink/blackhole?
On February 22, 2008 08:49:55 Dave Evans wrote:
> On Fri, Feb 22, 2008 at 12:39:10AM -0500, Andrew Heagle wrote:
> > ... all the mail should end up in either the "qa"
> > mailbox or the "dev" mailbox depending on which server sent the email
> > server/dev server). Also, the sysadmin for the QA/Dev lab wants to have
> > yet another mailbox for email with the local_user being "alerts" from any
> > server so he can quickly be notified of any hardware problems.
>
> I think you want to implement this using routers - if I were you I'd ignore
> headers_rewrite, and rewrite rules. It sounds like you want to user
> routers instead:
>
>  * one router which looks for "alert" mail (using a local_parts condition),
>    and sends that mail to the alert mailbox

>
>  * and another router which uses $sender_host_address (the sender's IP
>    address) as the basis for picking the destination mailbox - e.g. you
> could use a lookup on a file which says something like:

>
> Both of these routers could use the "accept" driver.
>
> Have a read of the spec about how routers work, and give the list a shout
> if you still need help.
>
> Good luck,


Hello, I got it going, thanks for pointing me in the right direction.

Here are the routers I made

qa_alert_user:
driver = accept
local_parts = alerts_qa
transport = lmtp_delivery

dev_alert_user:
driver = accept
local_parts = alerts_dev
transport = lmtp_delivery

dept_redirect_email:
driver = redirect
data = ${lookup{$sender_host_address}lsearch{/etc/exim/dev_servers}}

I suppose I could reduce the "alerts" routers to just 1 and change the
local_parts to local_part_prefix = ^\\alerts_(qa|dev)\\ or something. In the
dev_servers file, I have a IPs and the mailbox they should deliver to in
there as you suggested. Anyway, this works great, thanks! Seems so simple
after so much frustration!


And speaking of which, I was wondering, aside from experience, is there some
kind of rule-of-thumb about when you want to implement something whether one
should use ACLs, routers or transports? I don't think I've quite wrapped my
brain around this yet.


Regards,
Andrew