[Greylist-users] /etc/mail/access file simple implementation

Adrian de los Santos demon at demon.com.mx
Wed Dec 15 11:59:13 PST 2004


I just installed and tested graylist today and found that it does not 
take care of the /etc/mail/access file (i use it for pop before smtp 
access) so i create a simple code for the relaydelay.pl program.

Here is it:

----
  # Check for local IP relay whitelisting from the sendmail access file
  # FIXME - needs to be implemented
  #
   my $swpass=0;
   open(ACC,"</etc/mail/access");
   while(<ACC>) {
         my @fields=split(/\s+/,$_);
         my $ip_addr = $fields[0];
         my $action = $fields[1];
         if("$ip_addr" eq "$relay_ip" && "$action" eq "RELAY" )
         {
                 print "  IP found on Acess File, Passing Mail!\n" if 
($verbose);
                 $swpass=1;
                 last;
         }
    }
    close(ACC);
    if ($swpass)
    {
       reverse_track($dbh, $mail_from, $rcpt_to) if 
($reverse_mail_tracking and $rcpt_mailer !~ /\Alocal\Z/i);
       goto PASS_MAIL;
    }
----

If by any chance this code can be improved, please tell me.. im 
submitting this code so others can benefit from it.

Thanks and sorry for my english.



More information about the Greylist-users mailing list