[Mimedefang] Re: Re: Cloning/Splitting Mail at SMTP level (Les Mikesell)

Albert Croft acroft at cyber-wizard.com
Wed Mar 7 14:28:44 EST 2007


>
>
>Today's Topics:
>
>   4. Re: Cloning/Splitting Mail at SMTP level (Les Mikesell)
>
>
>----------------------------------------------------------------------
>Message: 4
>Date: Tue, 06 Mar 2007 14:23:40 -0600
>From: Les Mikesell <les at futuresource.com>
>Subject: Re: [Mimedefang] Cloning/Splitting Mail at SMTP level
>To: mimedefang at lists.roaringpenguin.com
>Message-ID: <45EDCDCC.2070802 at futuresource.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>David F. Skoll wrote:
>  
>
>>> Jeremy Phillips wrote:
>>> 
>>    
>>
>>>>>    After a couple hours of searching on the Internet I've come up with
>>>>> this mailing list, and was wondering if anyone has used MIMEDefang in an
>>>>> application similar to this situation?  Can MIMEDefang do these
>>>>> processes at the SMTP level so mail that comes in get's scanned by our
>>>>> spam appliance, and also send to another external account for analysis?
>>>      
>>>
>>> 
>>> Sure.  Pseudocode in filter_end:
>>> 
>>> foreach my $recip (@Recipients) {
>>> 	add_recipient(localpart($recip) . '@test.example.com');
>>> }
>>> 
>>> You then configure a box to accept mail for "test.example.com"
>>    
>>
>
>Is anyone doing something like this to have archive/backup copies or 
>comply with email retention regulations?  In that case you'd have to 
>treat local and remote recipients differently.
>
> -- Les Mikesell lesmikesell at gmail.com
>

I had a customer a little over a year and a half ago who had the 
requirement that supervisors get copies of emails received by their 
first-level subordinates (example illustrated below). I installed 
mime-defang, modified a mimedefang-filter to stream_by_domain, disabled 
the filtering normally done (which was being done on other servers 
instead), created a couple of database tables, and edited filter_end() 
to look at the addresses present, look up to whom copies should be 
forwarded, then executed appropriate add_recipient() commands as needed. 
The code only looked at those addresses in @Recipients that matched a 
pattern I had for their domain name, and all the management of who to 
forward from/to is taken care of in database tables (which could (at 
some point) have a nice front-end wrapped around it (a year later, and 
that's still on my list-php*admin works, though)).

Example:
    Joe is Bob's supervisor
    Bob is Steve's supervisor
    Expected behavior:
       If email to Bob, Joe should receive a copy
       If email to Steve, Bob should receive a copy, Joe should not 
receive a copy

(My code for this was a bit ugly, but it has worked so far. If you're 
interested, contact me off-list.)

-Albert C.



More information about the MIMEDefang mailing list