diff src/dnsbl.h @ 74:b7449114ebb0

start coding on new config syntax
author carl
date Sun, 10 Jul 2005 14:19:00 -0700
parents
children 81f1e400e8ab
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/dnsbl.h	Sun Jul 10 14:19:00 2005 -0700
@@ -0,0 +1,45 @@
+#ifndef dnsbl_include
+#define dnsbl_include
+
+#include "context.h"
+
+extern bool debug_syslog;
+
+class recorder;
+class url_scanner;
+
+////////////////////////////////////////////////
+// mail filter private data, held for us by sendmail
+//
+struct mlfiPriv
+{
+    // connection specific data
+    CONFIG  *pc;                    // global filtering configuration
+    int     fd;                     // to talk to dns resolvers process
+    bool    err;                    // did we get any errors on the resolver socket?
+    int     ip;                     // ip4 address of the smtp client
+    map<DNSBLP, bool> checked;      // map of dnsblp to result of (ip listed on that dnsbl)
+    // message specific data
+    char    *mailaddr;      // envelope from value
+    char    *queueid;       // sendmail queue id
+    bool    authenticated;  // client authenticated? if so, suppress all dnsbl checks
+    bool    have_whites;    // have at least one whitelisted recipient? need to accept content and remove all non-whitelisted recipients if it fails
+    bool    only_whites;    // every recipient is whitelisted?
+    context_map env_to;     // map each non-whitelisted recipient to their filtering context
+    recorder    *memory;    // memory for the content scanner
+    url_scanner *scanner;   // object to handle body scanning
+
+    mlfiPriv();
+    ~mlfiPriv();
+    void reset(bool final = false); // for a new message
+    void get_fd();
+    void return_fd();
+    int  my_read(char *buf, int len);
+    int  my_write(char *buf, int len);
+    void need_content_filter(char *rcpt, CONTEXT &con);
+};
+
+void my_syslog(mlfiPriv *priv, char *text);
+void my_syslog(char *text);
+
+#endif