Open Bug 208230 Opened 21 years ago Updated 2 years ago

message compose window couldn't interpret '\n' in the body passed by -compose commandline

Categories

(MailNews Core :: Composition, defect)

defect

Tracking

(Not tracked)

People

(Reporter: joey.shen, Unassigned)

References

Details

Attachments

(4 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507 mozilla compose window cannot interpret '\n' or %0A or &#10 correctly when the body passed by -compose commandline contains the character. Reproducible: Always Steps to Reproduce: 1.run the following commandline $mozilla -compose body="firstline\nsecondline" or $mozilla -compose body=firstline%0Asecondline 2. 3. Actual Results: '\n' is displayed as whitespace in the compose window launched. Expected Results: display two separate lines in the body. This problem could also be produced by calling mozMapi APIs, say, set mozilla mail as the default mailer on windows, then call MapiSendMail with a MapiMessage structure whose lpszNoteText field contains '\n'. However mozilla mailto: commandline seems to interpret \n correctly by hex encoding the character as %0A.
I found this same problem after upgrading to 1.4Rc1. This bug is a duplicate of 207925.
I'm using <a href="mailto:al@mail.com?body=line1%0Aline2"> and the line break is shown as a space with all in a single line. This worked before 1.4rc1.
Under Windows 2000, the following work as expected for me, with 1.4RC1: mozilla -compose body=firstline%0Asecondline mozilla -mail mailto:al@mail.com?body=line1%0Aline2 mozilla mailto:al@mail.com?body=line1%0Aline2 Executing the mailto: link in Mozilla or in Opera also works; on my system, that's configured to execute the mozilla -mail <url> command. The alternate form from the original report: mozilla -compose body="firstline\nsecondline" does not work; the \n is displayed verbatim within the mail body. I think this is as expected; I don't believe Windows tries to parse for escaped characters like that. Alonso, which platform are you running?
I just updated my mozilla to 1.4rc1(WinXP). %0A dosen't work for mailto either. I do think it's reasonable that \n is displayed verbatim when using -compose. But the problem is, there should be some way to accept multi-lines bodies by -compose and mailto URL. Actually, I debug the MsgComposeCommand.js, which contains the onload method of the compose window, from the dump, '%0A' has been interpreted correctly. So I guess the format might be lost somewhere when initializing the editor.
*** Bug 207925 has been marked as a duplicate of this bug. ***
Sorry, I made a mistake to file the same bug twice. since there are more comments here, I mark 207925 as a duplicate of this bug. add cc.
Reporter: Two people have reported WFM on win2000 and winXP. Could you please get a screenshot that shows *both* the command line argument and the compose window it opens, so we can see it first-hand? Also, make sure you're using the right newline code (%, followed by numeral 0, followed by capital A)
I just realized my problem is different but may be related to the same bug. I am not running mozilla from the command line. I have a page that has a mailto: link with body and now the email composer window opens but the body does not retain the line breaks set in the link. It was working on 1.4b. Example: <a href="mailto:noone@yahoo.com?body=line1%0Aline2">Email</a> This opened a mail with 2 separate lines, now it says "line1 line" on single line. I am using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030529. I also tested on Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5a) Gecko/20030610 and same thing happens.
Acutally, there're two different problems here. one is for -compose commandline, about which I cared more. it looks to me that -compose commandline never interpret %0A or \n correctly no matter what versions of mozilla or what platforms it was working on. the other is about mailto URL handling, as I know, it worked well with %0A before mozilla 1.4_rc1, there might be some regression. Anyway, I pasted both commandline screenshots for your reference. I'm using WinXP(Chinese version) and Mozilla 1.4 rc1
I wonder if this could be a problem with the chinese version of Windows. I simply cannot reproduce this problem on 2003061008. However, that doesn't matter, since I see screenshots and have confirmations from somebody else.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Jason: this has nothing to do with the Chinese version of windows. I have the problem on Linux and English version of Windows 98
I think the issue is that reporter is configured to compose in HTML by default (as seen in the screenshots), and HTML considers newlines and spaces to be identical. I guess that the data is not parsed so that newlines are converted to <br>, as they would be if you typed the enter key. When I posted that it works for me, but I'm using plain-text mail composition. Alonso, are you also using HTML mail by default?
I looked in the preferences and was not able to find out if I'm using HTML mail by default. But I probably I am. So I tried with this HTML mailto: link: <a href="mailto:noone@yahoo.com?body=line1<br>line2">Email</a> And it does separate in two lines. That's an easy fix for the problem I had. What I wonder is why did the behaviour changed on rc1? Anyway I think it should interpret %0A line breaks as such even when composing in HTML by default. Because if not someone placing a mailto: link in his website would not know which one to use %0A or <br> and neither would not work for everybody, which is awful.
I was wondering if there is any standard on how line breaks are to be specified in mailto: (either in HTML pagfe or in command line). I feel it shouldn't interpret the "\n" as a line break in any case. When composing in HTML %0A and <br> should both work as line breaks and \n should not be tratead speacially since it is HTML, it should appear as "\n". Also in the command line one should be able to specify the format in which one is passing the information (plain or HTML) or maybe the type of email that one wants to compose. Not that I care really I didn't even know that existed :-) But the mailto: needs to be fixed to handle %0A in all cases as a new line.
Product: MailNews → Core
sorry for the spam. making bugzilla reflect reality as I'm not working on these bugs. filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Filter on "Nobody_NScomTLD_20080620"
QA Contact: esther → composition
Product: Core → MailNews Core
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: