sync smtp size verification with head
This commit is contained in:
parent
6c1b19c884
commit
9c0bfcfdc6
5 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-07-08 [colin] 0.9.11cvs17.12
|
||||
|
||||
* src/common/smtp.c
|
||||
* src/common/smtp.h
|
||||
Sync smtp size verification with HEAD
|
||||
|
||||
2004-07-08 [colin] 0.9.11cvs17.11
|
||||
|
||||
* src/summaryview.c
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
1.1.4.1
|
||||
1.87.2.5 -r 1.2.4.1 1.1.4.1 1.87.2.6 src/folder.h; cvs diff -u -r 1.149.2.6 -r 1.149.2.7 src/inc.c; cvs diff -u -r 1.94.2.7 -r 1.94.2.8 src/messageview.c; cvs diff -u -r 1.47.2.5 -r 1.47.2.6 src/procheader.c; cvs diff -u -r 1.150.2.3 -r 1.150.2.4 src/procmsg.c; cvs diff -u -r 1.60.2.4 -r 1.60.2.5 src/procmsg.h; ) > 0.9.11cvs17.10.patchset
|
||||
( cvs diff -u -r 1.395.2.15 -r 1.395.2.16 src/summaryview.c; cvs diff -u -r 1.204.2.11 -r 1.204.2.12 src/prefs_common.c; cvs diff -u -r 1.103.2.5 -r 1.103.2.6 src/prefs_common.h; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/gtk/quicksearch.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/gtk/quicksearch.h; ) > 0.9.11cvs17.11.patchset
|
||||
( cvs diff -u -r 1.11.2.1 -r 1.11.2.2 src/common/smtp.c; cvs diff -u -r 1.6 -r 1.7 src/common/smtp.h; ) > 0.9.11cvs17.12.patchset
|
||||
|
|
|
@ -11,7 +11,7 @@ MINOR_VERSION=9
|
|||
MICRO_VERSION=11
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
EXTRA_VERSION=17.11
|
||||
EXTRA_VERSION=17.12
|
||||
EXTRA_RELEASE=
|
||||
|
||||
if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
|
||||
|
|
|
@ -90,6 +90,8 @@ Session *smtp_session_new(void)
|
|||
session->send_data = NULL;
|
||||
session->send_data_len = 0;
|
||||
|
||||
session->max_message_size = -1;
|
||||
|
||||
session->avail_auth_type = 0;
|
||||
session->forced_auth_type = 0;
|
||||
session->auth_type = 0;
|
||||
|
@ -276,6 +278,10 @@ static gint smtp_ehlo_recv(SMTPSession *session, const gchar *msg)
|
|||
if (strcasestr(p, "DIGEST-MD5"))
|
||||
session->avail_auth_type |= SMTPAUTH_DIGEST_MD5;
|
||||
}
|
||||
if (g_strncasecmp(p, "SIZE", 4) == 0) {
|
||||
p += 5;
|
||||
session->max_message_size = atoi(p);
|
||||
}
|
||||
return SM_OK;
|
||||
} else if ((msg[0] == '1' || msg[0] == '2' || msg[0] == '3') &&
|
||||
(msg[3] == ' ' || msg[3] == '\0'))
|
||||
|
@ -492,6 +498,16 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
|
|||
smtp_ehlo_recv(smtp_session, msg);
|
||||
if (cont == TRUE)
|
||||
break;
|
||||
if (smtp_session->max_message_size > 0
|
||||
&& smtp_session->max_message_size <
|
||||
smtp_session->send_data_len) {
|
||||
log_warning(_("Message is too big "
|
||||
"(Maximum size is %dKB)\n"),
|
||||
smtp_session->max_message_size / 1024);
|
||||
smtp_session->state = SMTP_ERROR;
|
||||
smtp_session->error_val = SM_ERROR;
|
||||
return -1;
|
||||
}
|
||||
#if USE_OPENSSL
|
||||
if (session->ssl_type == SSL_STARTTLS &&
|
||||
smtp_session->tls_init_done == FALSE) {
|
||||
|
|
|
@ -103,6 +103,8 @@ struct _SMTPSession
|
|||
guchar *send_data;
|
||||
guint send_data_len;
|
||||
|
||||
guint max_message_size;
|
||||
|
||||
SMTPAuthType avail_auth_type;
|
||||
SMTPAuthType forced_auth_type;
|
||||
SMTPAuthType auth_type;
|
||||
|
|
Loading…
Reference in a new issue