4 messages in net.sourceforge.lists.courier-users[courier-users] Problem (and patch fo...
FromSent OnAttachments
Jarle AaseJan 21, 2004 8:56 pm 
Sam VarshavchikJan 22, 2004 4:24 am 
Martin ArrietaJan 22, 2004 4:49 am 
Jarle AaseJan 22, 2004 5:20 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Problem (and patch for) "534 Message header size, or ..." errorActions...
From:Jarle Aase (jg@jgaa.com)
Date:Jan 21, 2004 8:56:40 pm
List:net.sourceforge.lists.courier-users

Hi,

I'm still having problems with the hard-coded 5000 byte limit in the message header lines. Some companies insist on sending mass-emails to their relations, with all the recipients in the "To" header.

I've fixed the problem on the servers I maintain and where the owners complains for the last two years - but it would be nice if the limit was configurable in Courier.

The patch below should handle this, without breaking anything (I hope ;)

----------------------------- --- ../../orig/courier-0.44.2/courier/submit.C Sun Oct 5 06:47:50 2003 +++ submit.C Thu Jan 22 05:31:14 2004 @@ -1072,6 +1072,15 @@ size_t headercnt=500; int headerlimit=100000; const char *p; +int header_line_limit=5000; + + p = getenv("ESMTP_HEADER_LINE_LIMIT"); // Max bytes (octets) on a
single line + if (p && (atoi(p) >= 1024)) + header_line_limit = atoi(p); + + p = getenv("ESMTP_HEADERLIMIT"); // Max bytes (octets) for the entire header + if (p && (atoi(p) >= 20000)) + headerlimit = atoi(p);

my_rcptinfo.submitfile.MessageStart(); line="Received: from "; @@ -1126,7 +1135,7 @@

unsigned received_cnt=0;

- while (line.readline(cin, 5000) > 0) + while (line.readline(cin, header_line_limit ) > 0) { struct rfc822t *rfcp; struct rfc822a *rfca; @@ -1150,7 +1159,7 @@ while ( ((i=cin.get()) != EOF ? (cin.putback(i), i):i) == ' ' || i == '\t') { - line.readline(cin, 5000); + line.readline(cin, header_line_limit); if ((i=cin.get()) != EOF && i != '\n') { headercnt=0; @@ -1160,8 +1169,9 @@ if (l && line[l-1] == '\r') line.Chop(); // Strip trailing CR l=line.GetLength() + header.GetLength(); - if (l > headerlimit || l > 5000) + if (l > headerlimit || l > header_line_limit) headercnt=0; + if (headercnt == 0) continue; header += '\n'; header += line;

-----------------------------

Jarle

War FTP Daemon: http://www.warftp.org War FTP Daemon FAQ: http://www.warftp.org/faq/warfaq.htm Jgaa's PGP key: http://war.jgaa.com/pgp NB: If you reply to this message, please include all relevant information from the conversation in your reply. Thanks. <<< no need to argue - just kill'em all! >>>