- SmtpOutMsg * SendMsg;
-
- SendMsg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg));
- memset(SendMsg, 0, sizeof(SmtpOutMsg));
-
- SendMsg->n = MsgCount;
- SendMsg->MyQEntry = MyQEntry;
- SendMsg->MyQItem = MyQItem;
- SendMsg->pCurrRelay = MyQItem->URL;
-
- SendMsg->IO.Data = SendMsg;
-
- SendMsg->IO.SendDone = SMTP_C_DispatchWriteDone;
- SendMsg->IO.ReadDone = SMTP_C_DispatchReadDone;
- SendMsg->IO.Terminate = SMTP_C_Terminate;
- SendMsg->IO.LineReader = SMTP_C_ReadServerStatus;
- SendMsg->IO.ConnFail = SMTP_C_ConnFail;
- SendMsg->IO.DNSFail = SMTP_C_DNSFail;
- SendMsg->IO.Timeout = SMTP_C_Timeout;
- SendMsg->IO.ShutdownAbort = SMTP_C_Shutdown;
-
- SendMsg->IO.SendBuf.Buf = NewStrBufPlain(NULL, 1024);
- SendMsg->IO.RecvBuf.Buf = NewStrBufPlain(NULL, 1024);
- SendMsg->IO.IOBuf = NewStrBuf();
-
- SendMsg->IO.NextState = eReadMessage;
-
- return SendMsg;
+ SmtpOutMsg * Msg;
+
+ Msg = (SmtpOutMsg *) malloc(sizeof(SmtpOutMsg));
+ memset(Msg, 0, sizeof(SmtpOutMsg));
+
+ Msg->n = MsgCount;
+ Msg->MyQEntry = MyQEntry;
+ Msg->MyQItem = MyQItem;
+ Msg->pCurrRelay = MyQItem->URL;
+
+ InitIOStruct(&Msg->IO,
+ Msg,
+ eReadMessage,
+ SMTP_C_ReadServerStatus,
+ SMTP_C_DNSFail,
+ SMTP_C_DispatchWriteDone,
+ SMTP_C_DispatchReadDone,
+ SMTP_C_Terminate,
+ SMTP_C_TerminateDB,
+ SMTP_C_ConnFail,
+ SMTP_C_Timeout,
+ SMTP_C_Shutdown);
+
+ Msg->IO.ErrMsg = Msg->MyQEntry->StatusMessage;
+
+ return Msg;