No extra space between ':' and '<' in MAIL FROM and RCPT TO. Wait for server response after QUIT and before closing connection.
This commit is contained in:
parent
9fa185b454
commit
20ba86512f
@ -516,6 +516,7 @@ void SMTPTransport::internalDisconnect()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
sendRequest("QUIT");
|
sendRequest("QUIT");
|
||||||
|
readResponse();
|
||||||
}
|
}
|
||||||
catch (exception&)
|
catch (exception&)
|
||||||
{
|
{
|
||||||
@ -565,7 +566,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
|
|||||||
// Emit the "MAIL" command
|
// Emit the "MAIL" command
|
||||||
ref <SMTPResponse> resp;
|
ref <SMTPResponse> resp;
|
||||||
|
|
||||||
sendRequest("MAIL FROM: <" + expeditor.getEmail() + ">");
|
sendRequest("MAIL FROM:<" + expeditor.getEmail() + ">");
|
||||||
|
|
||||||
if ((resp = readResponse())->getCode() != 250)
|
if ((resp = readResponse())->getCode() != 250)
|
||||||
{
|
{
|
||||||
@ -578,7 +579,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients
|
|||||||
{
|
{
|
||||||
const mailbox& mbox = *recipients.getMailboxAt(i);
|
const mailbox& mbox = *recipients.getMailboxAt(i);
|
||||||
|
|
||||||
sendRequest("RCPT TO: <" + mbox.getEmail() + ">");
|
sendRequest("RCPT TO:<" + mbox.getEmail() + ">");
|
||||||
|
|
||||||
if ((resp = readResponse())->getCode() != 250)
|
if ((resp = readResponse())->getCode() != 250)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user