X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fsmtp%2Fsmtp_clienthandlers.h;fp=citadel%2Fmodules%2Fsmtp%2Fsmtp_clienthandlers.h;h=ce7f7b9e627d8f9ce7ea054f1b41e937c5a0af72;hb=7e7b550e3d5de53fdf4b8c46833af5df9a159729;hp=0000000000000000000000000000000000000000;hpb=6bb1bd7f5b355f4c4cd126e9360d78d47b7a4ec6;p=citadel.git diff --git a/citadel/modules/smtp/smtp_clienthandlers.h b/citadel/modules/smtp/smtp_clienthandlers.h new file mode 100644 index 000000000..ce7f7b9e6 --- /dev/null +++ b/citadel/modules/smtp/smtp_clienthandlers.h @@ -0,0 +1,67 @@ +typedef enum _eSMTP_C_States { + eConnect, + eEHLO, + eHELO, + eSMTPAuth, + eFROM, + eRCPT, + eDATA, + eDATABody, + eDATATerminateBody, + eQUIT, + eMaxSMTPC +} eSMTP_C_States; + + +typedef struct _stmp_out_msg { + MailQEntry *MyQEntry; + OneQueItem *MyQItem; + long n; + AsyncIO IO; + long CXFlags; + + eSMTP_C_States State; + + struct ares_mx_reply *AllMX; + struct ares_mx_reply *CurrMX; + const char *mx_port; + const char *mx_host; + const char *LookupHostname; + int iMX, nMX; + int LookupWhich; + + DNSQueryParts MxLookup; + DNSQueryParts HostLookup; + struct hostent *OneMX; + char **pIP; + + ParsedURL *Relay; + ParsedURL *pCurrRelay; + StrBuf *msgtext; + const char *envelope_from; + char user[1024]; + char node[1024]; + char name[1024]; + char mailfrom[1024]; + long Flags; +} SmtpOutMsg; + + +typedef eNextState (*SMTPReadHandler)(SmtpOutMsg *Msg); +typedef eNextState (*SMTPSendHandler)(SmtpOutMsg *Msg); + +SMTPReadHandler ReadHandlers[eMaxSMTPC]; +SMTPSendHandler SendHandlers[eMaxSMTPC]; +const ConstStr ReadErrors[eMaxSMTPC]; +const double SMTP_C_ReadTimeouts[eMaxSMTPC]; +const double SMTP_C_SendTimeouts[eMaxSMTPC]; +const double SMTP_C_ConnTimeout; + +#define F_RELAY (1<<0) /* we have a Relay host configuration */ +#define F_HAVE_FALLBACK (1<<1) /* we have a fallback host configuration */ +#define F_FALLBACK (1<<2) +#define F_HAVE_MX (1<<3) /* we have a list of mx records to go through. */ +#define F_DIRECT (1<<4) /* no mx record found, trying direct connect. */ + + +int smtp_resolve_recipients(SmtpOutMsg *SendMsg);