1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 11:43:12 +02:00

Merge pull request #203 from MrGadget1024/patch-1

Fix mail sending for reliability.
This commit is contained in:
Adam
2018-06-12 10:39:17 -04:00
committed by GitHub
+29 -1
View File
@@ -411,12 +411,40 @@ int smtp_send_email()
return 0;
}
if (!smtp_read(buf, 1024))
{
alog("SMTP: error reading buffer");
return 0;
}
code = smtp_get_code(buf);
if (code != 250)
{
alog("SMTP: error expected code 250 got %d",code);
return 0;
}
return 1;
}
void smtp_disconnect()
{
smtp_send("QUIT\r\n");
if (!smtp_send("QUIT\r\n"))
{
alog("SMTP: error writing to socket");
}
if (!smtp_read(buf, 1024))
{
alog("SMTP: error reading buffer");
}
code = smtp_get_code(buf);
if (code != 221)
{
alog("SMTP: error expected code 221 got %d",code);
}
ano_sockclose(smail.sock);
}