aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/smtp/spam.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-02-11 23:38:55 +0000
committerrsc <devnull@localhost>2006-02-11 23:38:55 +0000
commitb5f65921f346e6b4335f77e457ac5bcae0ab9d67 (patch)
treed85d6da9def0b62b51537bf6348b43252ad69f5f /src/cmd/upas/smtp/spam.c
parente4d832222ba5519db94c7512c1fb82bd32491120 (diff)
downloadplan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.tar.gz
plan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.tar.bz2
plan9port-b5f65921f346e6b4335f77e457ac5bcae0ab9d67.zip
various cleanup
Diffstat (limited to 'src/cmd/upas/smtp/spam.c')
-rw-r--r--src/cmd/upas/smtp/spam.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/cmd/upas/smtp/spam.c b/src/cmd/upas/smtp/spam.c
index 84a8fccc..a4d49485 100644
--- a/src/cmd/upas/smtp/spam.c
+++ b/src/cmd/upas/smtp/spam.c
@@ -62,7 +62,7 @@ findkey(char *val, Keyword *p)
char*
actstr(int a)
{
- char buf[32];
+ static char buf[32];
Keyword *p;
for(p=actions; p->name; p++)
@@ -84,7 +84,8 @@ getaction(char *s, char *type)
return ACCEPT;
for(k = actions; k->name != 0; k++){
- snprint(buf, sizeof buf, "/mail/ratify/%s/%s/%s", k->name, type, s);
+ snprint(buf, sizeof buf, "%s/mail/ratify/%s/%s/%s",
+ get9root(), k->name, type, s);
if(access(buf,0) >= 0)
return k->code;
}
@@ -99,7 +100,7 @@ istrusted(char *s)
if(s == nil || *s == 0)
return 0;
- snprint(buf, sizeof buf, "/mail/ratify/trusted/%s", s);
+ snprint(buf, sizeof buf, "%s/mail/ratify/trusted/%s", get9root(), s);
return access(buf,0) >= 0;
}
@@ -167,6 +168,7 @@ getconf(void)
sysclose(bp);
}
+#if 0
/*
* match a user name. the only meta-char is '*' which matches all
* characters. we only allow it as "*", which matches anything or
@@ -186,6 +188,7 @@ usermatch(char *pathuser, char *specuser)
}
return strcmp(pathuser, specuser);
}
+#endif
static int
dommatch(char *pathdom, char *specdom)
@@ -493,7 +496,7 @@ dumpfile(char *sender)
return "/dev/null";
}
-char *validator = "/mail/lib/validateaddress";
+char *validator = "#9/mail/lib/validateaddress";
int
recipok(char *user)
@@ -504,7 +507,12 @@ recipok(char *user)
Biobuf *bp;
int pid;
Waitmsg *w;
-
+ static int beenhere;
+
+ if(!beenhere){
+ beenhere++;
+ validator = unsharp(validator);
+ }
if(shellchars(user)){
syslog(0, "smtpd", "shellchars in user name");
return 0;
@@ -522,9 +530,7 @@ recipok(char *user)
if(w->pid != pid)
continue;
if(w->msg[0] != 0){
- /*
syslog(0, "smtpd", "validateaddress %s: %s", user, w->msg);
- */
return 0;
}
break;
@@ -581,7 +587,7 @@ optoutofspamfilter(char *addr)
rv = 0;
- f = smprint("/mail/box/%s/nospamfiltering", p);
+ f = smprint("%s/mail/box/%s/nospamfiltering", get9root(), p);
if(f != nil){
rv = access(f, 0)==0;
free(f);