Index: trunk/include/sh_filter.h
===================================================================
--- trunk/include/sh_filter.h	(revision 232)
+++ trunk/include/sh_filter.h	(revision 232)
@@ -0,0 +1,35 @@
+#ifndef SH_FILTER_H
+#define SH_FILTER_H
+
+/* Filtering
+ */
+
+#define SH_FILT_NUM 32
+#define SH_FILT_OR  0
+#define SH_FILT_AND 1
+#define SH_FILT_NOT 2
+#define SH_FILT_INIT { 0, { NULL }, 0, { NULL }, 0, { NULL }}
+
+/* Pattern storage is of type void since it may be a char*
+ * or a regex_t*
+ */
+typedef struct _sh_filter_type
+{
+  int      for_c;
+  void   * for_v[SH_FILT_NUM];
+  int      fand_c;
+  void   * fand_v[SH_FILT_NUM];
+  int      fnot_c;
+  void   * fnot_v[SH_FILT_NUM];
+
+} sh_filter_type;
+
+int  sh_filter_add (const char * str, sh_filter_type * filter, int type);
+
+void sh_filter_free (sh_filter_type * filter);
+
+int  sh_filter_filter (const char * message, sh_filter_type * filter);
+
+sh_filter_type * sh_filter_alloc(void);
+
+#endif
Index: trunk/include/sh_mail_int.h
===================================================================
--- trunk/include/sh_mail_int.h	(revision 232)
+++ trunk/include/sh_mail_int.h	(revision 232)
@@ -0,0 +1,47 @@
+#ifndef SH_MAIL_INT_H
+#define SH_MAIL_INT_H
+
+extern int sh_mail_all_in_one;
+
+/* MX Resolver Struct
+ */
+typedef struct mx_ {
+  int    pref;
+  char * address;
+} mx;
+
+typedef struct dnsrep_ {
+  int    count;
+  mx   * reply;
+} dnsrep;
+
+int free_mx (dnsrep * answers);
+
+/* adress struct
+ */
+struct alias {
+  sh_string        * recipient;
+  struct alias     * recipient_list;
+  dnsrep           * mx_list;
+  int                severity;
+  int                send_mail;
+  sh_filter_type   * mail_filter;
+  struct alias     * next;
+  struct alias     * all_next;
+};
+
+extern struct alias * all_recipients;
+
+int sh_mail_msg (const char * message);
+
+/* Per recipient mail key
+ */
+
+int sh_nmail_get_mailkey (const char * alias, char * buf, size_t bufsiz,
+			  time_t * id_audit);
+
+SH_MUTEX_EXTERN(mutex_listall);
+SH_MUTEX_EXTERN(mutex_fifo_mail);
+extern SH_FIFO * fifo_mail;
+
+#endif
Index: trunk/include/sh_nmail.h
===================================================================
--- trunk/include/sh_nmail.h	(revision 232)
+++ trunk/include/sh_nmail.h	(revision 232)
@@ -0,0 +1,20 @@
+#ifndef SH_NMAIL_H
+#define SH_NMAIL_H
+
+int sh_nmail_pushstack (int level, const char * message, 
+			const char * alias);
+int sh_nmail_msg (int level, const char * message, 
+		  const char * alias);
+int sh_nmail_flush ();
+void sh_nmail_free();
+
+int sh_nmail_set_severity (const char * str);
+int sh_nmail_add_not (const char * str);
+int sh_nmail_add_and (const char * str);
+int sh_nmail_add_or  (const char * str);
+
+int sh_nmail_close_recipient(const char * str);
+int sh_nmail_add_compiled_recipient(const char * str);
+int sh_nmail_add_recipient(const char * str);
+int sh_nmail_add_alias(const char * str);
+#endif
