JF Mezei <jfmezei.spamnot@teksavvy.com> wrote on 06/16/2006 02:52:25 PM: > Syltrem wrote: > > > $ cr[0,8]=13 > > > $ lf[0,8]=10 > > > $ subject="[BACKUP] VMS Backup Summary" + cr + lf + - > > > "Mime-Version: 1.0" + cr + lf + - > > > "Content-Type: text/HTML" > > > $ mail/sub="''subject'" 'summary_file support_dist > > > > That works great ! > > > It may work today, but I am not sure this is garanteed to work forever. Okay, I'll bite. Why does it work? Why is that stuff in the subject and what/why/how is it processed - since it obviously gets used up somehow, i.e., what's going on? Then, Why would it break? What would break it?
In article <OF55F5EFB3.31E24B7F-ON8525718F.006A5CD9-8525718F.006AA067@metso.com>, norm.raphael@metso.com writes: > > >JF Mezei <jfmezei.spamnot@teksavvy.com> wrote on 06/16/2006 02:52:25 PM: > >> Syltrem wrote: >> > > $ cr[0,8]=13 >> > > $ lf[0,8]=10 >> > > $ subject="[BACKUP] VMS Backup Summary" + cr + lf + - >> > > "Mime-Version: 1.0" + cr + lf + - >> > > "Content-Type: text/HTML" >> > > $ mail/sub="''subject'" 'summary_file support_dist >> >> >> > That works great ! >> >> >> It may work today, but I am not sure this is garanteed to work forever. > >Okay, I'll bite. > >Why does it work? >Why is that stuff in the subject and what/why/how is it processed - since >it obviously gets used up somehow, i.e., what's going on? This works because the value in the "subject" has line breaks in it. The result is that mail clients get to interpret what the mail user agent thought was only one header, the subject header, as Subject: [BACKUP] VMS Backup Summary Mime-Version: 1.0 Content-Type: text/HTML thereby advising it to process the contents of the message as HTML. The CR & LF values are carriage-return and linefeed. There are no blank lines between the Subject: header and the injected headers, so they are properly processed; if you put your content-type header in the message body, there's a blank line (unless you use a speical mail transport to prevent that) and the header isn't processed. Hope this helps! > Why would it break? A message transport might at some point decide to escape the CRLF value in the header and make it a long subject line. I don't know how likely that is. -- Alan
norm.raphael@metso.com wrote: > Why does it work? > Why is that stuff in the subject and what/why/how is it processed - since > it obviously gets used up somehow, i.e., what's going on? Here is a header generated by the MAIL command to a internet email address: Date: Fri, 16 Jun 2006 16:06:36 -0400 Message-Id: <06061616063660@vuxination.cake> From: jfmezei@vuxination.cake (Jean-Fran�ois Mezei) To: JFMEZEI@vuxination.cake Subject: Chocolate cookie X-VMS-To: jfmezei@vuxination.cake <blank line> contents of message With the trick: the above header would become: Date: Fri, 16 Jun 2006 16:06:36 -0400 Message-Id: <06061616063660@vuxination.cake> From: jfmezei@vuxination.cake (Jean-Fran�ois Mezei) To: JFMEZEI@vuxination.cake Subject: Chocolate cookie Mime-Version: 1.0 Content-Type: text/HTML X-VMS-To: jfmezei@vuxination.cake <blank line> contents of message aka: subject = "Chocoolate cookie" + CRLF + "Mime-Version: 1.0" + CRLF + "Content-Type: text/HTML" causes the mail foreign protocol to blindly write the CRLFs to the temporary file. The symbiont and recipient don't see those tricks because by that time, the single subject has become "Chocolate cookie" followed by totally separate lines which happen to be bona-fide RFC header lines.
norm.raphael@metso.com wrote: > > JF Mezei <jfmezei.spamnot@teksavvy.com> wrote on 06/16/2006 02:52:25 PM: > > >>Syltrem wrote: >> >>>>$ cr[0,8]=13 >>>>$ lf[0,8]=10 >>>>$ subject="[BACKUP] VMS Backup Summary" + cr + lf + - >>>> "Mime-Version: 1.0" + cr + lf + - >>>> "Content-Type: text/HTML" >>>>$ mail/sub="''subject'" 'summary_file support_dist >> >> >>>That works great ! >> >> >>It may work today, but I am not sure this is garanteed to work forever. > > > Okay, I'll bite. > > Why does it work? > Why is that stuff in the subject and what/why/how is it processed - since > it obviously gets used up somehow, i.e., what's going on? > > Then, Why would it break? What would break it? > > I'd say that it works because it provides a way to get unsupported stuff into the message headers. It might break because it does unsupported things in unsupported ways. You still have to provide your own html text for the message body.
On 2006-06-16 21:40, "Alan Winston - SSRL Central Computing" wrote: > [...] > > The CR & LF values are carriage-return and linefeed. There are no blank > lines between the Subject: header and the injected headers, so they are > properly processed; if you put your content-type header in the message body, > there's a blank line (unless you use a speical mail transport to prevent > that) and the header isn't processed. > > [...] > > A message transport might at some point decide to escape the CRLF value > in the header and make it a long subject line. I don't know how likely > that is. Putting the three lines together into a long "Subject:" line would require standards-compliant "header folding" (RFC 2822, section 2.2.3), i.e., (at least) one _space_ character at the very beginning of the continuation lines. Michael -- Real names enhance the probability of getting real answers. My e-mail account at DECUS Munich is no longer valid.