SMTP-Client: add the stati of all delivery attempts to the status messages.
[citadel.git] / citadel / modules / smtp / smtpqueue.h
index 6c6dc5311f718153220e0af88ae1ffbed96bf9ab..2bd4c2700f4921fbf3a61cb46c89386aee073f1e 100644 (file)
 /*****************************************************************************/
 
 #define MaxAttempts 15
+extern const unsigned short DefaultMXPort;
 
 typedef struct _mailq_entry {
        StrBuf *Recipient;
        StrBuf *StatusMessage;
+       StrBuf *AllStatusMessages;
        int Status;
        /**<
         * 0 = No delivery has yet been attempted
@@ -39,6 +41,8 @@ typedef struct _mailq_entry {
 
        int n;
        int Active;
+       int StillActive;
+       int nAttempt;
 }MailQEntry;
 
 typedef struct queueitem {
@@ -56,11 +60,13 @@ typedef struct queueitem {
        time_t Retry;
 
        long ActiveDeliveries;
+       long NotYetShutdownDeliveries;
        StrBuf *EnvelopeFrom;
        StrBuf *BounceTo;
        StrBuf *SenderRoom;
        ParsedURL *URL;
        ParsedURL *FallBackHost;
+       int HaveRelay;
 } OneQueItem;
 
 typedef void (*QItemHandler)(OneQueItem *Item, StrBuf *Line, const char **Pos);
@@ -70,9 +76,11 @@ typedef struct __QItemHandlerStruct {
        QItemHandler H;
 } QItemHandlerStruct;
 int     DecreaseQReference(OneQueItem *MyQItem);
+void DecreaseShutdownDeliveries(OneQueItem *MyQItem);
+int GetShutdownDeliveries(OneQueItem *MyQItem);
 void    RemoveQItem(OneQueItem *MyQItem);
-int     CountActiveQueueEntries(OneQueItem *MyQItem);
+int     CountActiveQueueEntries(OneQueItem *MyQItem, int before);
 StrBuf *SerializeQueueItem(OneQueItem *MyQItem);
-void    smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt);
+void    smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt, ParsedURL *Relay);
 
 int CheckQEntryIsBounce(MailQEntry *ThisItem);