]> git.ipfire.org Git - people/ms/dma.git/blobdiff - dma.h
debian: build with consistent flags
[people/ms/dma.git] / dma.h
diff --git a/dma.h b/dma.h
index cd9214ef5a6cb2cdc4cf3ee97b167b879b53d8d0..03139dc25677de083982e9af62090968581a0332 100644 (file)
--- a/dma.h
+++ b/dma.h
 #include <openssl/ssl.h>
 #include <netdb.h>
 
-#define VERSION        "DragonFly Mail Agent"
+#define VERSION        "DragonFly Mail Agent " DMA_VERSION
 
 #define BUF_SIZE       2048
+#define ERRMSG_SIZE    200
+#define USERNAME_SIZE  50
 #define MIN_RETRY      300             /* 5 minutes */
 #define MAX_RETRY      (3*60*60)       /* retry at least every 3 hours */
 #define MAX_TIMEOUT    (5*24*60*60)    /* give up after 5 days */
@@ -54,7 +56,7 @@
 #define PATH_MAX       1024            /* Max path len */
 #endif
 #define        SMTP_PORT       25              /* Default SMTP port */
-#define CON_TIMEOUT    120             /* Connection timeout */
+#define CON_TIMEOUT    (5*60)          /* Connection timeout per RFC5321 */
 
 #define STARTTLS       0x002           /* StartTLS support */
 #define SECURETRANS    0x004           /* SSL/TLS in general */
 #define DEFER          0x010           /* Defer mails */
 #define INSECURE       0x020           /* Allow plain login w/o encryption */
 #define FULLBOUNCE     0x040           /* Bounce the full message */
+#define TLS_OPP                0x080           /* Opportunistic STARTTLS */
 
 #ifndef CONF_PATH
 #define CONF_PATH      "/etc/dma/dma.conf"     /* Default path to dma.conf */
 #endif
 
+#ifndef LIBEXEC_PATH
+#error Please define LIBEXEC_PATH
+#endif
+
+#define DMA_ROOT_USER  "mail"
+#define DMA_GROUP      "mail"
+
+
 struct stritem {
        SLIST_ENTRY(stritem) next;
        char *str;
@@ -110,7 +121,6 @@ struct config {
        const char *certfile;
        int features;
        const char *mailname;
-       const char *mailnamefile;
 
        /* XXX does not belong into config */
        SSL *ssl;
@@ -140,10 +150,12 @@ extern struct aliases aliases;
 extern struct config config;
 extern struct strlist tmpfs;
 extern struct authusers authusers;
-extern const char *username;
+extern char username[USERNAME_SIZE];
+extern uid_t useruid;
 extern const char *logident_base;
 
-extern char neterr[BUF_SIZE];
+extern char neterr[ERRMSG_SIZE];
+extern char errmsg[ERRMSG_SIZE];
 
 /* aliases_parse.y */
 int yyparse(void);
@@ -166,7 +178,7 @@ int dns_get_mx_list(const char *, int, struct mx_hostentry **, int);
 char *ssl_errstr(void);
 int read_remote(int, int, char *);
 ssize_t send_remote_command(int, const char*, ...);
-int deliver_remote(struct qitem *, const char **);
+int deliver_remote(struct qitem *);
 
 /* base64.c */
 int base64_encode(const void *, int, char **);
@@ -185,7 +197,7 @@ int acquirespool(struct qitem *);
 void dropspool(struct queue *, struct qitem *);
 
 /* local.c */
-int deliver_local(struct qitem *, const char **errmsg);
+int deliver_local(struct qitem *);
 
 /* mail.c */
 void bounce(struct qitem *, const char *);
@@ -198,6 +210,7 @@ void errlog(int, const char *, ...);
 void errlogx(int, const char *, ...);
 void set_username(void);
 void deltmp(void);
+int do_timeout(int, int);
 int open_locked(const char *, int, ...);
 char *rfc822date(void);
 int strprefixcmp(const char *, const char *);