]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/smtpqueue.h
Add busines logic for toggling multiple mx records etc.
[citadel.git] / citadel / modules / smtp / smtpqueue.h
index a7b97cd90f150404af6abe68636be69cbc353f41..1ae1034b4eac942ba886bdce7d18aeb65e8dcf23 100644 (file)
@@ -2,6 +2,23 @@
 /*               SMTP CLIENT (Queue Management) STUFF                        */
 /*****************************************************************************/
 
+typedef struct ParsedURL ParsedURL;
+struct ParsedURL {
+       StrBuf *URL;
+       unsigned Port;
+       const char *Host;
+       const char *User;
+       const char *Pass;
+       const char *LocalPart;
+       int IsIP;
+       int IPv6;
+       int af;
+       struct hostent *HEnt;
+       struct in6_addr Addr;
+       ParsedURL *Next;
+};
+
+
 #define MaxAttempts 15
 typedef struct _delivery_attempt {
        time_t when;
@@ -14,6 +31,15 @@ typedef struct _mailq_entry {
        StrBuf *Recipient;
        StrBuf *StatusMessage;
        int Status;
+       /**<
+        * 0 = No delivery has yet been attempted
+        * 2 = Delivery was successful
+        * 4 = A transient error was experienced ... try again later
+        * 5 = Delivery to this address failed permanently.  The error message
+         *     should be placed in the fourth field so that a bounce message may
+        *     be generated.
+        */
+
        int n;
        int Active;
 }MailQEntry;
@@ -21,6 +47,7 @@ typedef struct _mailq_entry {
 typedef struct queueitem {
        long MessageID;
        long QueMsgID;
+       long Submitted;
        int FailNow;
        HashList *MailQEntries;
        MailQEntry *Current; /* copy of the currently parsed item in the MailQEntries list; if null add a new one. */
@@ -28,6 +55,8 @@ typedef struct queueitem {
        long ActiveDeliveries;
        StrBuf *EnvelopeFrom;
        StrBuf *BounceTo;
+       ParsedURL *URL;
+       ParsedURL *FallBackHost;
 } OneQueItem;
 typedef void (*QItemHandler)(OneQueItem *Item, StrBuf *Line, const char **Pos);
 
@@ -35,3 +64,5 @@ int DecreaseQReference(OneQueItem *MyQItem);
 void RemoveQItem(OneQueItem *MyQItem);
 int CountActiveQueueEntries(OneQueItem *MyQItem);
 StrBuf *SerializeQueueItem(OneQueItem *MyQItem);
+
+void smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt);