else if (!ascii_strncasecmp ("STARTTLS", buf + 4, 8))
mutt_bit_set (Capabilities, STARTTLS);
else if (!ascii_strncasecmp ("STARTTLS", buf + 4, 8))
mutt_bit_set (Capabilities, STARTTLS);
if (mutt_bit_isset (Capabilities, DSN) && DsnNotify)
snprintf (buf, sizeof (buf), "RCPT TO:<%s> NOTIFY=%s\r\n",
a->mailbox, DsnNotify);
if (mutt_bit_isset (Capabilities, DSN) && DsnNotify)
snprintf (buf, sizeof (buf), "RCPT TO:<%s> NOTIFY=%s\r\n",
a->mailbox, DsnNotify);
snprintf (buf, sizeof (buf), "DATA\r\n");
if (mutt_socket_write (conn, buf) == -1)
{
snprintf (buf, sizeof (buf), "DATA\r\n");
if (mutt_socket_write (conn, buf) == -1)
{
return r;
}
while (fgets (buf, sizeof (buf) - 1, fp))
{
buflen = mutt_strlen (buf);
return r;
}
while (fgets (buf, sizeof (buf) - 1, fp))
{
buflen = mutt_strlen (buf);
if (buflen && buf[buflen-1] == '\n'
&& (buflen == 1 || buf[buflen - 2] != '\r'))
snprintf (buf + buflen - 1, sizeof (buf) - buflen + 1, "\r\n");
if (buflen && buf[buflen-1] == '\n'
&& (buflen == 1 || buf[buflen - 2] != '\r'))
snprintf (buf + buflen - 1, sizeof (buf) - buflen + 1, "\r\n");
{
if (mutt_socket_write_d (conn, ".", -1, M_SOCK_LOG_FULL) == -1)
{
{
if (mutt_socket_write_d (conn, ".", -1, M_SOCK_LOG_FULL) == -1)
{
return smtp_err_write;
}
}
if (mutt_socket_write_d (conn, buf, -1, M_SOCK_LOG_FULL) == -1)
{
return smtp_err_write;
}
}
if (mutt_socket_write_d (conn, buf, -1, M_SOCK_LOG_FULL) == -1)
{
/* terminate the message body */
if (mutt_socket_write (conn, ".\r\n") == -1)
/* terminate the message body */
if (mutt_socket_write (conn, ".\r\n") == -1)
mutt_error (_("SMTP session failed: read error"));
else if (ret == smtp_err_write)
mutt_error (_("SMTP session failed: write error"));
mutt_error (_("SMTP session failed: read error"));
else if (ret == smtp_err_write)
mutt_error (_("SMTP session failed: write error"));
- if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
+ if ((rc = mutt_socket_readln (buf, sizeof (buf), conn)) < 0)
+ goto fail;
+ if (smtp_code (buf, rc, &rc) < 0)