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

-- 
Jarle Aase                      email: [EMAIL PROTECTED]
Author of freeware.             http://www.jgaa.com
                                news:alt.comp.jgaa

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! >>> 



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to