diff src/context.h @ 168:6bac960af6b4

add generic reverse dns filtering regex
author carl
date Thu, 30 Aug 2007 11:08:46 -0700
parents 9b129ed78d7d
children bd33eaccfed8
line wrap: on
line diff
--- a/src/context.h	Mon Aug 27 20:49:19 2007 -0700
+++ b/src/context.h	Thu Aug 30 11:08:46 2007 -0700
@@ -11,6 +11,7 @@
 
 #include "tokenizer.h"
 #include <map>
+#include <regex.h>
 
 
 enum status {oksofar,		// not rejected yet
@@ -123,6 +124,9 @@
 	string_set		env_to; 			// this context applies to these envelope recipients
 	char *			verify_host;		// use this smtp host to verify email addresses
 	VERIFYP 		verifier;			// pointer to the verifier structure
+	char *			generic_regx;		// pointer to generic regular expression
+	char *			generic_message;	// pointer to generic message with one %s
+	regex_t 		generic_pattern;	// compiled regular expression
 	char *			autowhite_file; 	// file to use for automatic whitelisting
 	WHITELISTERP	whitelister;		// pointer to the auto whitelister structure
 	string_map		env_from;			// map senders to white/black/unknown
@@ -202,6 +206,9 @@
 	void		add_dnsbl(DNSBLP dns)						{dnsbl_list.push_back(dns);};
 	DNSBLP		find_dnsbl(char *name);
 
+	bool		set_generic(char *regx, char *msg);
+	char*		generic_match(char *client);
+
 	bool			get_content_filtering() 				{return content_filtering; };
 	int 			get_host_limit()						{return host_limit; 	   };
 	bool			get_host_random()						{return host_random;	   };
@@ -260,6 +267,7 @@
 extern char *token_envfrom;
 extern char *token_envto;
 extern char *token_filter;
+extern char *token_generic;
 extern char *token_host_limit;
 extern char *token_html_limit;
 extern char *token_html_tags;