2005-03-04 [colin] 1.0.1cvs22.1
[claws.git] / src / common / smtp.c
index b064bf249e18c39244f92feca0b2996f9ed3a6b0..23087b5f0ae3cc68b0d00dcb3bfd12e0b8bddb72 100644 (file)
@@ -96,6 +96,7 @@ Session *smtp_session_new(void)
        session->avail_auth_type           = 0;
        session->forced_auth_type          = 0;
        session->auth_type                 = 0;
+       session->esmtp_flags               = 0;
 
        session->error_val                 = SM_OK;
        session->error_msg                 = NULL;
@@ -126,7 +127,7 @@ static gint smtp_from(SMTPSession *session)
 
        session->state = SMTP_FROM;
        
-       if (session->is_esmtp)
+       if (session->is_esmtp && (session->esmtp_flags & ESMTP_SIZE)!=0)
                mail_size = g_strdup_printf(" SIZE=%d", session->send_data_len);
        else
                mail_size = g_strdup("");
@@ -299,6 +300,7 @@ static gint smtp_ehlo_recv(SMTPSession *session, const gchar *msg)
                if (g_ascii_strncasecmp(p, "SIZE", 4) == 0) {
                        p += 5;
                        session->max_message_size = atoi(p);
+                       session->esmtp_flags |= ESMTP_SIZE;
                }
                return SM_OK;
        } else if ((msg[0] == '1' || msg[0] == '2' || msg[0] == '3') &&