]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/smtpqueue.h
move URL parsing / struct over into libcitadel
[citadel.git] / citadel / modules / smtp / smtpqueue.h
index a7b97cd90f150404af6abe68636be69cbc353f41..2b252899a5ba28911ec5c77bcbd1ffe15abc3609 100644 (file)
@@ -2,6 +2,8 @@
 /*               SMTP CLIENT (Queue Management) STUFF                        */
 /*****************************************************************************/
 
+
+
 #define MaxAttempts 15
 typedef struct _delivery_attempt {
        time_t when;
@@ -14,6 +16,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 +32,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 +40,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 +49,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);