Loading ...
Sorry, an error occurred while loading the content.

A question about Mail-to-Weblog ...

Expand Messages
  • Scott C. Lemon
    Ok ... I tried it for the first time! I just got a new cellphone, and it has a full keyboard. I figured that I would try the Mail-to-Weblog feature ... and
    Message 1 of 9 , Nov 30, 2004
    • 0 Attachment
      Message
      Ok ... I tried it for the first time!
       
      I just got a new cellphone, and it has a full keyboard.  I figured that I would try the "Mail-to-Weblog" feature ... and this is what I got:  http://the.inevitable.org/anism/2004/11/30.html
       
      I'm curious about suggestions on how to skip the mime headers ...
       
      Also, if I attach a photo ... what's going to be blogged?  I know ... I'm going to test it ... I'll let you know my results!
       
       
      Scott C. Lemon
       
       
       
    • Lawrence Lee
      You can filter it in the weblogCheckMail callback. weblogData.callbacks.weblogCheckMail Some tips here: http://radio.userland.com/discuss/msgReader$7377 If you
      Message 2 of 9 , Nov 30, 2004
      • 0 Attachment
        Message
        You can filter it in the weblogCheckMail callback.
         
        weblogData.callbacks.weblogCheckMail
         
        Some tips here:
         
         
        If you load the http://radio.weblogs.com/0001161/howtoformatemailscript.html page, you might want to view source since it won't display properly because of how the script included in the page is rendered.
         
        Lawrence


        From: Scott C. Lemon [mailto:Scott.Lemon@...]
        Sent: November 30, 2004 3:13 PM
        To: radio-dev@yahoogroups.com
        Subject: [radio-dev] A question about Mail-to-Weblog ...

        Ok ... I tried it for the first time!
         
        I just got a new cellphone, and it has a full keyboard.  I figured that I would try the "Mail-to-Weblog" feature ... and this is what I got:  http://the.inevitable.org/anism/2004/11/30.html
         
        I'm curious about suggestions on how to skip the mime headers ...
         
        Also, if I attach a photo ... what's going to be blogged?  I know ... I'm going to test it ... I'll let you know my results!
         
         
        Scott C. Lemon
         
         
         

      • Scott C. Lemon
        Lawrence, Thanks for the pointers so far ... I m reading through the code and slowly understanding how this is working. I have a question for you: 1. Where is
        Message 3 of 9 , Dec 1, 2004
        • 0 Attachment
          Message
          Lawrence,
           
          Thanks for the pointers so far ... I'm reading through the code and slowly understanding how this is working.
           
          I have a question for you:
           
          1. Where is the code that actually strips the headers from the incoming e-mail message?  I have looked around, and found the code that seems to fetch the e-mail from the server, and then it stores this in a table.  What I do not see is where the mail is parsed to locate the subject, and also the body ...
           
          I am hoping to use this code to build my parsing to strip the content type headers ...
           
          Also ... is there any sample code that can do mime decoding to a file?  I want to see if I can receive an attachment (.jpg image) and save it to the file system.  (That's the next one ... for moblogging with Radio ...)
           
          Thanks!
           
           
          Scott C. Lemon
           
           
          -----Original Message-----
          From: Lawrence Lee [mailto:lawrence@...]
          Sent: Tuesday, November 30, 2004 4:30 PM
          To: radio-dev@yahoogroups.com
          Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

          You can filter it in the weblogCheckMail callback.
           
          weblogData.callbacks.weblogCheckMail
           
          Some tips here:
           
           
          If you load the http://radio.weblogs.com/0001161/howtoformatemailscript.html page, you might want to view source since it won't display properly because of how the script included in the page is rendered.
           
          Lawrence


          From: Scott C. Lemon [mailto:Scott.Lemon@...]
          Sent: November 30, 2004 3:13 PM
          To: radio-dev@yahoogroups.com
          Subject: [radio-dev] A question about Mail-to-Weblog ...

          Ok ... I tried it for the first time!
           
          I just got a new cellphone, and it has a full keyboard.  I figured that I would try the "Mail-to-Weblog" feature ... and this is what I got:  http://the.inevitable.org/anism/2004/11/30.html
           
          I'm curious about suggestions on how to skip the mime headers ...
           
          Also, if I attach a photo ... what's going to be blogged?  I know ... I'm going to test it ... I'll let you know my results!
           
           
          Scott C. Lemon
           
           
           


        • Scott C. Lemon
          Never mind ... I ll answer my own question ... It appears that the problem is within the parseMsg2 handler in the system.verbs.builtins.tcp.getMail script. I m
          Message 4 of 9 , Dec 1, 2004
          • 0 Attachment
            Message
            Never mind ... I'll answer my own question ...
             
            It appears that the problem is within the parseMsg2 handler in the system.verbs.builtins.tcp.getMail script.
             
            I'm reading through the script now, and it appears that parseMsg2 tries to grab the message from the Content-Type part, however in my e-mail messages it is not properly recognizing the boundaries.
             
            I just found a setting called 'poundNameCompatibility" that seems to add a "#" to the Content-Type string comparison ... and I'm not sure why ...
             
            I'm going to dig some more ...
             
             
            Scott C. Lemon
             
             
            -----Original Message-----
            From: Scott C. Lemon [mailto:Scott.Lemon@...]
            Sent: Wednesday, December 01, 2004 4:38 PM
            To: radio-dev@yahoogroups.com
            Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

            Lawrence,
             
            Thanks for the pointers so far ... I'm reading through the code and slowly understanding how this is working.
             
            I have a question for you:
             
            1. Where is the code that actually strips the headers from the incoming e-mail message?  I have looked around, and found the code that seems to fetch the e-mail from the server, and then it stores this in a table.  What I do not see is where the mail is parsed to locate the subject, and also the body ...
             
            I am hoping to use this code to build my parsing to strip the content type headers ...
             
            Also ... is there any sample code that can do mime decoding to a file?  I want to see if I can receive an attachment (.jpg image) and save it to the file system.  (That's the next one ... for moblogging with Radio ...)
             
            Thanks!
             
             
            Scott C. Lemon
             
             
            -----Original Message-----
            From: Lawrence Lee [mailto:lawrence@...]
            Sent: Tuesday, November 30, 2004 4:30 PM
            To: radio-dev@yahoogroups.com
            Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

            You can filter it in the weblogCheckMail callback.
             
            weblogData.callbacks.weblogCheckMail
             
            Some tips here:
             
             
            If you load the http://radio.weblogs.com/0001161/howtoformatemailscript.html page, you might want to view source since it won't display properly because of how the script included in the page is rendered.
             
            Lawrence


            From: Scott C. Lemon [mailto:Scott.Lemon@...]
            Sent: November 30, 2004 3:13 PM
            To: radio-dev@yahoogroups.com
            Subject: [radio-dev] A question about Mail-to-Weblog ...

            Ok ... I tried it for the first time!
             
            I just got a new cellphone, and it has a full keyboard.  I figured that I would try the "Mail-to-Weblog" feature ... and this is what I got:  http://the.inevitable.org/anism/2004/11/30.html
             
            I'm curious about suggestions on how to skip the mime headers ...
             
            Also, if I attach a photo ... what's going to be blogged?  I know ... I'm going to test it ... I'll let you know my results!
             
             
            Scott C. Lemon
             
             
             



          • Lawrence Lee
            There isn t any cleaning directly in the script, you would probably want to write the code to strip the extra characters directly in the callback. If you look
            Message 5 of 9 , Dec 1, 2004
            • 0 Attachment
              Message
              There isn't any cleaning directly in the script, you would probably want to write the code to strip the extra characters directly in the callback. If you look at David Davie's script where he access the adrMsg^.text you could use the various string or regex verbs to clean it.
               
              The tcp.getMail scripts might be hard coded (no callbacks to change the behavior etc.) so you might be better off changing it in the weblogCheckMail callback.

              Lawrence Lee
              UserLand Software
              www.userland.com

               


              From: Scott C. Lemon [mailto:Scott.Lemon@...]
              Sent: December 1, 2004 3:38 PM
              To: radio-dev@yahoogroups.com
              Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

              Lawrence,
               
              Thanks for the pointers so far ... I'm reading through the code and slowly understanding how this is working.
               
              I have a question for you:
               
              1. Where is the code that actually strips the headers from the incoming e-mail message?  I have looked around, and found the code that seems to fetch the e-mail from the server, and then it stores this in a table.  What I do not see is where the mail is parsed to locate the subject, and also the body ...
               
              I am hoping to use this code to build my parsing to strip the content type headers ...
               
              Also ... is there any sample code that can do mime decoding to a file?  I want to see if I can receive an attachment (.jpg image) and save it to the file system.  (That's the next one ... for moblogging with Radio ...)
               
              Thanks!
               
               
              Scott C. Lemon
               
            • Scott C. Lemon
              Lawrence, Thanks for the tips and pointers so far ... In looking closely at the code, there is already a lot of code that is supposed to be examining the
              Message 6 of 9 , Dec 1, 2004
              • 0 Attachment
                Message
                Lawrence,
                 
                Thanks for the tips and pointers so far ...
                 
                In looking closely at the code, there is already a lot of code that is supposed to be examining the Content-Type headers in "parseMsg2" ... and it even is supposed to be detecting multipart messages ... however it is failing.
                 
                This is always where I seem to fall down working with Radio ... debugging this stuff.  ;-(
                 
                1. When I tweak the code, and then click "Compile" is seems like my changes are not accepted ... or something.  And then after a while they seem to be there.  What am I supposed to do when editing these scripts?  If I click Compile should the changes be immediately executed?
                 
                2. Is there any "debug window" or someplace where real-time messages can be output to trace the operation?  Can I put in a breakpoint and single step through the code examining variables, etc.?
                 
                The system.verbs.builtins.tcp.getMail contains the code to parse the Content-Type ... I just can't quite figure out how to debug this in Radio ...  ;-(
                 
                Thanks in advance ...
                 
                 
                Scott C. Lemon
                 
                 
                -----Original Message-----
                From: Lawrence Lee [mailto:lawrence@...]
                Sent: Wednesday, December 01, 2004 5:05 PM
                To: radio-dev@yahoogroups.com
                Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                There isn't any cleaning directly in the script, you would probably want to write the code to strip the extra characters directly in the callback. If you look at David Davie's script where he access the adrMsg^.text you could use the various string or regex verbs to clean it.
                 
                The tcp.getMail scripts might be hard coded (no callbacks to change the behavior etc.) so you might be better off changing it in the weblogCheckMail callback.

                Lawrence Lee
                UserLand Software
                www.userland.com

                 


                From: Scott C. Lemon [mailto:Scott.Lemon@...]
                Sent: December 1, 2004 3:38 PM
                To: radio-dev@yahoogroups.com
                Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                Lawrence,
                 
                Thanks for the pointers so far ... I'm reading through the code and slowly understanding how this is working.
                 
                I have a question for you:
                 
                1. Where is the code that actually strips the headers from the incoming e-mail message?  I have looked around, and found the code that seems to fetch the e-mail from the server, and then it stores this in a table.  What I do not see is where the mail is parsed to locate the subject, and also the body ...
                 
                I am hoping to use this code to build my parsing to strip the content type headers ...
                 
                Also ... is there any sample code that can do mime decoding to a file?  I want to see if I can receive an attachment (.jpg image) and save it to the file system.  (That's the next one ... for moblogging with Radio ...)
                 
                Thanks!
                 
                 
                Scott C. Lemon
                 

              • Lawrence Lee
                Radio should start to use the modified scripts after you click the Compile button. You can click the Debug button in the Script window to step through etc.
                Message 7 of 9 , Dec 1, 2004
                • 0 Attachment
                  Message
                  Radio should start to use the modified scripts after you click the Compile button.
                   
                  You can click the Debug button in the Script window to step through etc.
                   
                  Docs:
                   
                   
                  You might be able to copy out the parseMsg2 into your own script for debugging and just send it the raw mail text etc. instead of having to check the mail account with tcp.getmail etc.

                  Lawrence

                  From: Scott C. Lemon [mailto:Scott.Lemon@...]
                  Sent: December 1, 2004 8:59 PM
                  To: radio-dev@yahoogroups.com
                  Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                  Lawrence,
                   
                  Thanks for the tips and pointers so far ...
                   
                  In looking closely at the code, there is already a lot of code that is supposed to be examining the Content-Type headers in "parseMsg2" ... and it even is supposed to be detecting multipart messages ... however it is failing.
                   
                  This is always where I seem to fall down working with Radio ... debugging this stuff.  ;-(
                   
                  1. When I tweak the code, and then click "Compile" is seems like my changes are not accepted ... or something.  And then after a while they seem to be there.  What am I supposed to do when editing these scripts?  If I click Compile should the changes be immediately executed?
                   
                  2. Is there any "debug window" or someplace where real-time messages can be output to trace the operation?  Can I put in a breakpoint and single step through the code examining variables, etc.?
                   
                  The system.verbs.builtins.tcp.getMail contains the code to parse the Content-Type ... I just can't quite figure out how to debug this in Radio ...  ;-(
                   
                  Thanks in advance ...
                   
                   
                  Scott C. Lemon
                   
                   
                • Scott C. Lemon
                  It does appear that there is/was a bug in the system.verbs.builtins.tcp.getMail script ... I was able to use the dialog.notify debugging method to slowly
                  Message 8 of 9 , Dec 1, 2004
                  • 0 Attachment
                    Message
                    It does appear that there is/was a bug in the system.verbs.builtins.tcp.getMail script ...
                     
                    I was able to use the 'dialog.notify' debugging method to slowly work through this script and locate where the failure was occurring.  On this line:
                     
                          if not (aPart beginsWith "\r\n")  // This is the preamble area of a multipart message.
                                continue
                     
                    In the message that was being e-mailed from my phone, this always tested as true, and so the continue would cause the loop to skip over the parsing of the headers.
                     
                    I simply commented the 'continue' and now things are working ...
                     
                    I'm not sure why the author of this script was expecting the boundary to begin with a \r\n, but mine was not ...
                     
                     
                     
                    Scott C. Lemon
                     
                     
                    -----Original Message-----
                    From: Lawrence Lee [mailto:lawrence@...]
                    Sent: Wednesday, December 01, 2004 5:05 PM
                    To: radio-dev@yahoogroups.com
                    Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                    There isn't any cleaning directly in the script, you would probably want to write the code to strip the extra characters directly in the callback. If you look at David Davie's script where he access the adrMsg^.text you could use the various string or regex verbs to clean it.
                     
                    The tcp.getMail scripts might be hard coded (no callbacks to change the behavior etc.) so you might be better off changing it in the weblogCheckMail callback.

                    Lawrence Lee
                    UserLand Software
                    www.userland.com

                     


                    From: Scott C. Lemon [mailto:Scott.Lemon@...]
                    Sent: December 1, 2004 3:38 PM
                    To: radio-dev@yahoogroups.com
                    Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                    Lawrence,
                     
                    Thanks for the pointers so far ... I'm reading through the code and slowly understanding how this is working.
                     
                    I have a question for you:
                     
                    1. Where is the code that actually strips the headers from the incoming e-mail message?  I have looked around, and found the code that seems to fetch the e-mail from the server, and then it stores this in a table.  What I do not see is where the mail is parsed to locate the subject, and also the body ...
                     
                    I am hoping to use this code to build my parsing to strip the content type headers ...
                     
                    Also ... is there any sample code that can do mime decoding to a file?  I want to see if I can receive an attachment (.jpg image) and save it to the file system.  (That's the next one ... for moblogging with Radio ...)
                     
                    Thanks!
                     
                     
                    Scott C. Lemon
                     

                  • Lawrence Lee
                    Thanks, I ll pass along the report. Lawrence Lee UserLand Software www.userland.com _____ From: Scott C. Lemon [mailto:Scott.Lemon@HumanXtensions.com] Sent:
                    Message 9 of 9 , Dec 1, 2004
                    • 0 Attachment
                      Message
                      Thanks, I'll pass along the report.

                      Lawrence Lee
                      UserLand Software
                      www.userland.com

                       


                      From: Scott C. Lemon [mailto:Scott.Lemon@...]
                      Sent: December 1, 2004 10:13 PM
                      To: radio-dev@yahoogroups.com
                      Subject: RE: [radio-dev] A question about Mail-to-Weblog ...

                      It does appear that there is/was a bug in the system.verbs.builtins.tcp.getMail script ...
                       
                      I was able to use the 'dialog.notify' debugging method to slowly work through this script and locate where the failure was occurring.  On this line:
                       
                            if not (aPart beginsWith "\r\n")  // This is the preamble area of a multipart message.
                                  continue
                       
                      In the message that was being e-mailed from my phone, this always tested as true, and so the continue would cause the loop to skip over the parsing of the headers.
                       
                      I simply commented the 'continue' and now things are working ...
                       
                      I'm not sure why the author of this script was expecting the boundary to begin with a \r\n, but mine was not ...
                       
                       
                       
                      Scott C. Lemon
                       
                       
                    Your message has been successfully submitted and would be delivered to recipients shortly.