|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Olli Hauer (ohauer
gmx.de)
Date: Fri Mar 16 2007 - 18:26:35 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I have a little patch to allow comments in spamd.alloweddomains.
- olli
--- src/libexec/spamd/grey.c.orig Fri Mar 16 19:39:55 2007
+++ src/libexec/spamd/grey.c Fri Mar 16 23:09:43 2007

-317,20 +317,31 
SLIST_REMOVE_HEAD(&match_suffix, entry);
if ((fp = fopen(alloweddomains_file, "r")) != NULL) {
while ((buf = fgetln(fp, &len))) {
- if (buf[len-1] == '\n')
- len--;
- if ((m = malloc(sizeof(struct mail_addr))) == NULL)
- goto bad;
- if ((len + 1) > sizeof(m->addr)) {
- syslog_r(LOG_ERR, &sdata,
- "line too long in %s - file ignored",
- alloweddomains_file);
- goto bad;
+ /* ignore lines starting with '#' and '\n'*/
+ if ((*buf != '#') && (*buf != '\n')) {
+ /* strip trailing */
+ while (isspace(buf[len - 1])) {
+ len--;
+ }
+ /* strip leading */
+ while (isspace(*buf)) {
+ *buf++;
+ len--;
+ }
+ if ((m = malloc(sizeof(struct mail_addr))) == NULL)
+ goto bad;
+ if ((len + 1) > sizeof(m->addr)) {
+ syslog_r(LOG_ERR, &sdata,
+ "line too long in %s - file ignored",
+ alloweddomains_file);
+ goto bad;
+ }
+ memcpy(m->addr, buf, len);
+ m->addr[len]='\0';
+ syslog_r(LOG_ERR, &sdata,
+ "got suffix \"%s\"", m->addr);
+ SLIST_INSERT_HEAD(&match_suffix, m, entry);
}
- memcpy(m->addr, buf, len);
- m->addr[len]='\0';
- syslog_r(LOG_ERR, &sdata, "got suffix %s", m->addr);
- SLIST_INSERT_HEAD(&match_suffix, m, entry);
}
}
return;

-524,8 +535,7 
memset(&dbk, 0, sizeof(dbk));
dbk.size = strlen(key);
dbk.data = key;
- memset(&dbd, 0,
- sizeof(dbd));
+ memset(&dbd, 0, sizeof(dbd));
i = db->get(db, &dbk, &dbd, 0);
if (i == -1)
return (-1);
--- src/libexec/spamd/spamd.8.orig Fri Mar 16 16:49:08 2007
+++ src/libexec/spamd/spamd.8 Fri Mar 16 23:15:07 2007

-370,6 +370,9 
Any destination address which does not match one of the suffixes listed in
.Pa spamd.alloweddomains
will be trapped, exactly as if it were sent to a spamtrap address.
+Comment lines beginning with
+.Ar #
+are ignored.
.Pp
For example, if
.Pa spamd.alloweddomains
--
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal f|r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]