[Mimedefang] Copying specific sender addresses to another mailbox.

Jan Pieter Cornet johnpc at xs4all.nl
Fri Jun 4 09:47:40 EDT 2004


On Fri, Jun 04, 2004 at 11:23:36AM +0100, Martin Ferguson wrote:
> I need to copy all mail sent from specific addresses in my domain to another
> address for archive purposes, i.e. sales at mydomain.com or
> support at mydomain.com to archive at mydomain.com.
> 
> I've been using Mimedefang for sometime now, however my rules are somewhat
> basic due to my limited knowledge of perl, any help with this one much
> appreciated.
> 
> >From the man page, I'm thinking filter_sender is what I need to call. I have
> the following in my filter.....

filter_sender is probably an option, but you might as well do this in
filter_end. Just test something along this lines:
sub filter_end {
    # .... any other tests
    if ( $Sender =~ /^<?support\@mydomain.com>?$/i ) {
	add_recipient('archive at mydomain.com');
    }
    # ...
}
 
> sub filter_sender {
>     my($sender, $hostip, $hostname, $helo) = @_;
>     if ($sender =~
>     /support\@mydomain.com/i)
>     {
>     add_recipient('archive at mydomain.com');
>     }
> 
> }
> 
> I'm not really sure the correct place to call filter_sender in the filter.
> 
> I've enabled MX_SENDER_CHECK=yes in the init script, so filter_sender is
> definitely being called.
> 
> All messaged are currently rejected. (on a test machine though, so not to
> much of a panic)

filter_sender is supposed to return a value accepting or rejecting the
sender, so it would work if you simply inserted:

    return ('CONTINUE', "ok");

-- 
#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig;                                # Jan-Pieter Cornet



More information about the MIMEDefang mailing list