Skip to content
Snippets Groups Projects
Commit 308050a5 authored by rswindell's avatar rswindell
Browse files

Added max_msg_size startup parameter.

parent f03cf82a
No related branches found
No related tags found
No related merge requests found
...@@ -1886,6 +1886,15 @@ static void smtp_thread(void* arg) ...@@ -1886,6 +1886,15 @@ static void smtp_thread(void* arg)
length=filelength(fileno(msgtxt))-ftell(msgtxt); length=filelength(fileno(msgtxt))-ftell(msgtxt);
if(startup->max_msg_size && length>startup->max_msg_size) {
lprintf("%04d !SMTP message size (%lu) exceeds maximum: %lu bytes"
,socket,length,startup->max_msg_size);
sockprintf(socket, "552 Message size (%lu) exceeds maximum: %lu bytes"
,length,startup->max_msg_size);
subnum=INVALID_SUB;
continue;
}
if((msgbuf=(char*)malloc(length+1))==NULL) { if((msgbuf=(char*)malloc(length+1))==NULL) {
lprintf("%04d !SMTP ERROR allocating %d bytes of memory" lprintf("%04d !SMTP ERROR allocating %d bytes of memory"
,socket,length+1); ,socket,length+1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment