Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: {Disarmed} Re: {Disarmed} Re: {Disarmed} [milter-greylist] How to whitelist with access.db?

2007-02-20 by Oliver Haufe

Easy - now it also accepts "WHITE"  from access.db.  But as i am running an 
older Version "milter-greylist-3.0rc7" so if someone would like to patch 
his version he schould check the place inside milter-greylist.c

and i added in milter-greylist.c in the declaration of the the function 
after row 291 four (4) variables.

sfsistat
mlfi_envrcpt(ctx, envrcpt)
         SMFICTX *ctx;
         char **envrcpt;
{
         struct mlfi_priv *priv;
         time_t remaining;
         char *greylist;
         char addrstr[IPADDRSTRLEN];
         char rcpt[ADDRLEN + 1];

         FILE *fda;
         char accbuff[100];
         char acc_ipaddr[50];
         char acc_code[50];



than i added after your code for access.db in milter-greylist.c after line 
367 my code:



if((fda = fopen("/etc/mail/access","r")) != NULL)
             {
             while(fgets(accbuff,100,fda) != 0)
                   {
                   sscanf(accbuff,"%s %s\n",acc_ipaddr,acc_code);
                   if(strncmp(acc_ipaddr,addrstr, strlen(addrstr))==0)
                     {
                     if(strcmp(acc_code,"RELAY") == 0 || 
strcmp(acc_code,"relay") == 0
                        || strcmp(acc_code,"WHITE") == 0 || 
strcmp(acc_code,"white") == 0
                     || strcmp(acc_code,"OK") == 0 || strcmp(acc_code,"ok") 
== 0)
                         {
                         mg_log(LOG_DEBUG, "whitelisted by 
{/etc/mail/access}");
                         priv->priv_elapsed = 0;
                         priv->priv_whitelist = EXF_ACCESSDB;
                         fclose(fda);
                         return SMFIS_CONTINUE;
                         }
                     }
                   }
            fclose(fda);
            }



At 22:25 20.02.2007, manu@... wrote:
>As far as I understand, your change introduce a change of behavior,
>which is not very nice for people using it the old way. Perhaps you
>could change the patch so that it accepts both WHITE and RELAY values?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.