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:
+29
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user