Back to index

citadel  8.12
smtpqueue.h
Go to the documentation of this file.
00001 /*
00002  *
00003  * Copyright (c) 1998-2012 by the citadel.org team
00004  *
00005  *  This program is open source software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 3 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 /*****************************************************************************/
00021 /*               SMTP CLIENT (Queue Management) STUFF                        */
00022 /*****************************************************************************/
00023 
00024 #define MaxAttempts 15
00025 extern const unsigned short DefaultMXPort;
00026 
00027 typedef struct _mailq_entry {
00028        StrBuf *Recipient;
00029        StrBuf *StatusMessage;
00030        int Status;
00041        int n;
00042        int Active;
00043 }MailQEntry;
00044 
00045 typedef struct queueitem {
00046        long SendBounceMail;
00047        long MessageID;
00048        long QueMsgID;
00049        long Submitted;
00050        int FailNow;
00051        HashList *MailQEntries;
00052 /* copy of the currently parsed item in the MailQEntries list;
00053  * if null add a new one.
00054  */
00055        MailQEntry *Current;
00056        time_t ReattemptWhen;
00057        time_t Retry;
00058 
00059        long ActiveDeliveries;
00060        long NotYetShutdownDeliveries;
00061        StrBuf *EnvelopeFrom;
00062        StrBuf *BounceTo;
00063        StrBuf *SenderRoom;
00064        ParsedURL *URL;
00065        ParsedURL *FallBackHost;
00066 } OneQueItem;
00067 
00068 typedef void (*QItemHandler)(OneQueItem *Item, StrBuf *Line, const char **Pos);
00069 
00070 
00071 typedef struct __QItemHandlerStruct {
00072        QItemHandler H;
00073 } QItemHandlerStruct;
00074 int     DecreaseQReference(OneQueItem *MyQItem);
00075 void DecreaseShutdownDeliveries(OneQueItem *MyQItem);
00076 int GetShutdownDeliveries(OneQueItem *MyQItem);
00077 void    RemoveQItem(OneQueItem *MyQItem);
00078 int     CountActiveQueueEntries(OneQueItem *MyQItem);
00079 StrBuf *SerializeQueueItem(OneQueItem *MyQItem);
00080 void    smtpq_do_bounce(OneQueItem *MyQItem, StrBuf *OMsgTxt);
00081 
00082 int CheckQEntryIsBounce(MailQEntry *ThisItem);