[Mimedefang] Allowing mails from specific users

Paul Murphy pmurphy at ionixpharma.com
Mon Nov 1 11:42:27 EST 2004


Richard,

I use a Perl hash to hold details of all whitelisted addresses, and check this
before calls to contentious parts of the filter, e.g.:

At the top of the filter (i.e. globally):

# Addresses to allow regardless of origin
$IncomingWhitelist{'trusteduser at domain1.com'} = 1;
$IncomingWhitelist{'another_friend at doma2.net'} = 1;

Then in the relevant parts of the filter (in this case :

# skip greylisting for selected users
  my @senderparts = split(/@/, $Sender);     
  my $senderdom = $senderparts[1];
  $senderdom =~ s/[<>]//g;   

  #md_syslog('debug',"Whitelist check - $Sender,$senderdom,$ip");
  if (
       (exists $IncomingWhitelist{lc($sender)}) ||
       (exists $IncomingWhitelist{lc($senderdom)}) ||
       ( exists $LocalRelayAddrs{$ip}) )                  
    {
    md_syslog('info',"WhiteList - skip greylisting check,
Sender=$Sender,Dom=$senderdom, Addr=$ip");
    return ('CONTINUE', "ok");
    }

Or:

    if ( (!exists $IncomingWhitelist{lc($Sender)}) && 
          (filter_bad_filename($entity)) ) {
        md_graphdefang_log('bad_filename', $fname, $type);
        action_notify_administrator("A file called $fname from $Sender was
removed from an e-mail with subject | $subject | - quarantined.\n\n");

This has the advantage of keeping in virus scanning, SPAM filtering, or whatever
while allowing some addresses to skip some parts.

In addition, my ZIP file handling is fairly involved, as the only way to be sure
that a zip file is "safe" is to examine the contents in an intelligent manner.
See the attached code from "filter()" for details.

Best Wishes,

Paul.
__________________________________________________
Paul Murphy
Head of Informatics
Ionix Pharmaceuticals Ltd
418 Science Park, Cambridge, CB4 0PA

Tel. 01223 433741
Fax. 01223 433788

_______________________________________________________________________
DISCLAIMER:
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to which they
are addressed.  If you have received this email in error please contact
the sender or the Ionix IT Helpdesk on +44 (0) 1223 433741
_______________________________________________________________________ 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip_check.pl
Type: application/octet-stream
Size: 5635 bytes
Desc: zip_check.pl
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20041101/ac31dc57/attachment.obj>


More information about the MIMEDefang mailing list