mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
If the -T or -t flag is given, the key must be an email address so check
that it contains an @ sign. Prompted by jmc@, OK beck@.
This commit is contained in:
parent
ff1e82edd3
commit
a574b422b1
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: spamdb.c,v 1.23 2007/05/31 20:00:16 cnst Exp $ */
|
||||
/* $OpenBSD: spamdb.c,v 1.24 2008/05/17 10:48:06 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 Bob Beck. All rights reserved.
|
||||
@ -106,6 +106,9 @@ dbupdate(DB *db, char *ip, int add, int type)
|
||||
case SPAMTRAP:
|
||||
gd.expire = 0;
|
||||
gd.pcount = -2;
|
||||
/* ensure address is of the form user@host */
|
||||
if (strchr(ip, '@') == NULL)
|
||||
errx(-1, "not an email address: %s", ip);
|
||||
/* ensure address is lower case*/
|
||||
for (i = 0; ip[i] != '\0'; i++)
|
||||
if (isupper(ip[i]))
|
||||
|
Loading…
Reference in New Issue
Block a user