xref: /openbsd/libexec/spamd/grey.h (revision 32cdaddf)
1 /*	$OpenBSD: grey.h,v 1.7 2007/02/27 02:10:58 beck Exp $	*/
2 
3 /*
4  * Copyright (c) 2004 Bob Beck.  All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #define MAX_MAIL 1024 /* how big an email address will we consider */
20 #define PASSTIME (60 * 25) /* pass after first retry seen after 25 mins */
21 #define GREYEXP (60 * 60 * 4) /* remove grey entries after 4 hours */
22 #define WHITEEXP (60 * 60 * 24 * 36) /* remove white entries after 36 days */
23 #define TRAPEXP (60 * 60 * 24) /* hitting a spamtrap blacklists for a day */
24 #define PATH_PFCTL "/sbin/pfctl"
25 #define PATH_SPAMD_ALLOWEDDOMAINS "/etc/mail/spamd.alloweddomains"
26 #define DB_SCAN_INTERVAL 60
27 #define PATH_SPAMD_DB "/var/db/spamd"
28 
29 struct gdata {
30 	time_t first;  /* when did we see it first */
31 	time_t pass;   /* when was it whitelisted */
32 	time_t expire; /* when will we get rid of this entry */
33 	int bcount;    /* how many times have we blocked it */
34 	int pcount;    /* how many times passed, or -1 for spamtrap */
35 };
36 
37 extern int greywatcher(void);
38