bugThe nmh Mail Handling System - Bugs: bug #66407, inc using POP cannot handle long...

 
 

bug #66407: inc using POP cannot handle long lines in message body

Submitter:  Stephen Gildea <gildea>
Submitted:  Mon 04 Nov 2024 08:24:12 PM UTC
   
 
Category:  Bug Severity:  3 - Normal
Priority:  * 5 - Normal Status:  None
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Nov 2024 11:46:48 PM UTC, comment #1: 

I know about this, but I'm not sure what the obvious solutions is (I am assuming the image/jpeg part is base64 encoded; if it is something like binary then we don't actually handle that).

In my experience such messages are free to be (and often are) chopped up by intervening MTAs and/or POP servers which generally then destroy the message structure.

Internally that message is coming from sbr/netsec.c; it wants to get a single "line" (which ends in CR LF) and write that out in Unix file format (just a LF as terminator).

It might be useful to discuss this on nmh-workers; given the current structure of the code even if you were able to retrieve the message then I am not sure the rest of nmh could handle it.

Ken Hornstein <kenh>
Group administrator
Mon 04 Nov 2024 08:24:12 PM UTC, original submission:  

When I try to "inc" some messages with NMH 1.8 from my POP
server, if a message contains a very long line, then inc says:

inc: Unable to find a line terminator after 33376 bytes

Excessively long lines appear in some delivery-confirmation
messages.  These messages include a photo of my package sitting
on the front porch.  The problem seems to be that the image/jpeg
part has no newlines.  (Yes, this is in violation of the
standards that put limits on the length of a message text line,
but here we are.)


To reproduce:

Enhance the "test-pop" test to include a message with a long
line, and run that enhanced test.


Here is a patch to add a long line to a test message:

diff --git a/test/inc/test-pop b/test/inc/test-pop
index 8b3fbe03..3fc27ff7 100755
--- a/test/inc/test-pop
+++ b/test/inc/test-pop
@@ -49,6 +49,16 @@ Hey man, how's it going?
 .
 Hope you're doing better.
 EOM
+# Ensure inc can handle a message body with a long line.
+# At least one mailer (incorrectly) generates image/jpeg parts with
+# no newlines, resulting in an encoded line of about 45000 bytes.
+i=45000
+while [ "$i" -gt 0 ]; do
+    printf abcdefghijklmnopqrstuvwxyz >> "$testmessage"
+    arith_eval "$i" - 26
+    i=$arith_val
+done
+echo >> "$testmessage"
 
 cat > "${testmessage}.2" <<EOM
 Received: From somewhere



Now run that test:
$ make check-TESTS TESTS=test/inc/test-pop


Running the enhanced test gets me the following output:

inc: abortcpy: would overflow, aborting: 8192 "abcdefghijklmnopqrst"


Stephen Gildea <gildea>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kenh (Posted a comment)
  • -email is unavailable- added by gildea (Submitted the item)
  •  

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-26b0.
    Corresponding source code