diff src/context.h @ 13:75e1a9bcbc2e

gpl3, add removal option for original recipients
author carl
date Sat, 25 Aug 2007 11:14:49 -0700
parents 01268466f0dc
children b24369330483
line wrap: on
line diff
--- a/src/context.h	Mon Mar 19 22:38:37 2007 -0700
+++ b/src/context.h	Sat Aug 25 11:14:49 2007 -0700
@@ -1,3 +1,10 @@
+/*
+
+Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+the GPL version 3 or any later version at your choice available at
+http://www.gnu.org/licenses/gpl-3.0.txt
+
+*/
 #ifndef context_include
 #define context_include
 
@@ -16,13 +23,17 @@
 	string_set		config_files;
 	string_map		env_from;			// map senders to archive mailboxes
 	string_map		rcpt_to;			// map recipients to archive mailboxes
+	string_set		rcpt_remove;		// remove these recipients
 
 	CONFIG();
 	~CONFIG();
 	void		add_from(char *from, char *target)		{env_from[from] = target;	 };
 	void		add_to(char *to, char *target)			{rcpt_to[to]	= target;	 };
+	void		add_remove(char *to)					{rcpt_remove.insert(to);	   };
 	char *		find_from(char *from)					{return find(from, env_from);};
 	char *		find_to(char *to)						{return find(to, rcpt_to);	 };
+	bool		find_remove(char *to)					{return find(to, rcpt_remove); };
+	bool		find(char *needle, string_set &haystack);
 	char *		find(char *needle, string_map &haystack);
 	void		dump();
 };
@@ -32,6 +43,7 @@
 extern char *token_lbrace;
 extern char *token_rbrace;
 extern char *token_rcptto;
+extern char *token_remove;
 extern char *token_semi;
 
 extern string_set	all_strings;	// owns all the strings, only modified by the config loader thread
@@ -39,6 +51,7 @@
 void discard(string_set &s);
 char* register_string(string_set &s, char *name);
 char* register_string(char *name);
+void  clear_strings();
 CONFIG *parse_config(char *fn);
 bool  load_conf(CONFIG &dc, char *fn);
 void  token_init();