SMTP-Client: add the stati of all delivery attempts to the status messages.
[citadel.git] / citadel / modules / smtp / smtpqueue.h
index be14ea5b568ffb4b2d55c8d0c56c4173239baa5c..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,19 +60,27 @@ 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);
 
+
+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);