Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001131 [Squeak] Network minor always 04-28-05 18:55 02-16-11 00:38
Reporter murphydye View Status public  
Assigned To KenCausey
Priority normal Resolution fixed  
Status closed   Product Version 3.8
Summary 0001131: Linefeeds in mail message
Description When fetching email messages from an IMAP server, the lines end with cr/lf. MailMessage>>from: expects only cr and parses these messages incorrectly. Peeking for lf in #readStringLineFrom: fixes this:

MailMessage>>readStringLineFrom: aStream
    "Read and answer the next line from the given stream. Consume the carriage return but do not append it to the string."
    | line |
    line := aStream upTo: Character cr.
    aStream peek = Character lf ifTrue: [aStream next].
    ^ line
Additional Information
Attached Files

- Relationships

- Notes
(0002935 - 680 - 905 - 905 - 905 - 905 - 905)
murphydye
10-20-05 22:24
edited on: 10-20-05 22:25

I had problems with my initial solution under certain conditions, and chose to strip all linefeeds in the MailMessage>>from: method. I did this right after the 'text' variable is set. It seems like I also added them back in when writing the message, for example when writing the headers out, but don't see where I did this. Note, this solution is not ideal ;)

MailMessage>>from: aString
    "Parse aString to initialize myself."

    | parseStream contentType bodyText contentTransferEncoding |

    text := aString withoutTrailingBlanks, String cr.
"bmd added this to get rid of lf problems"
    text := text copyWithout: Character lf.
    parseStream := ReadStream on: text.
...

 
(0014052 - 70 - 70 - 70 - 70 - 70 - 70)
nicolas cellier
02-16-11 00:38

This was solved in Squeak 4.1 by using generic Stream utility nextLine
 

- Issue History
Date Modified Username Field Change
04-28-05 18:55 murphydye New Issue
05-24-05 02:33 KenCausey Category Any => Network
10-20-05 21:19 KenCausey Status new => assigned
10-20-05 21:19 KenCausey Assigned To  => KenCausey
10-20-05 22:24 murphydye Note Added: 0002935
10-20-05 22:25 murphydye Note Edited: 0002935
02-16-11 00:38 nicolas cellier Status assigned => closed
02-16-11 00:38 nicolas cellier Note Added: 0014052
02-16-11 00:38 nicolas cellier Resolution open => fixed
02-16-11 00:38 nicolas cellier Fixed in Version  => 4.1


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
46 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker