Re: allow comments and empty lines in spamd.alloweddomains

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Olli Hauer
Date: Tuesday, February 17, 2009 - 11:20 pm

-------- Original-Nachricht --------



you are right.


Index: grey.c
===================================================================
RCS file: /cvs/src/libexec/spamd/grey.c,v
retrieving revision 1.45
diff -u -r1.45 grey.c
--- grey.c  7 Dec 2008 21:12:52 -0000   1.45
+++ grey.c  18 Feb 2009 06:02:00 -0000
@@ -319,6 +319,18 @@
        SLIST_REMOVE_HEAD(&match_suffix, entry);
    if ((fp = fopen(alloweddomains_file, "r")) != NULL) {
        while ((buf = fgetln(fp, &len))) {
+           /* strip white space-characters */
+           while (len > 0 && isspace(buf[len-1]))
+               len--;
+           while (len > 0 && isspace(*buf)) {
+               buf++;
+               len--;
+           }
+           /* jump over comments and blank lines */
+           if (len == 0)
+               continue;
+           if (*buf == '#' || *buf == '\n')
+               continue;
            if (buf[len-1] == '\n')
                len--;
            if ((m = malloc(sizeof(struct mail_addr))) == NULL)

-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
f|r nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Tue Feb 17, 1:13 pm)
Re: allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Tue Feb 17, 3:02 pm)
Re: allow comments and empty lines in spamd.alloweddomains, patrick keshishian, (Tue Feb 17, 11:14 pm)
Re: allow comments and empty lines in spamd.alloweddomains, Olli Hauer, (Tue Feb 17, 11:20 pm)
Re: allow comments and empty lines in spamd.alloweddomains, Stephan A. Rickauer, (Wed Feb 18, 1:44 am)