Announcement

Collapse
No announcement yet.

EMail Attachments

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    EMail Attachments

    Hi Jon:

    I downloaded your plugin last night and am trying to see if I can accomplish something.

    I want to set up a event that is triggered upon the receipt of an email with a .jpg attachment (via FileTrigger). The action would be to then save the attachment in a specific folder on my network.

    What I want to accomplish is to have the ability to email a photo to Homeseer and then have that photo saved in the directory I use for my screensaver shots in.

    Thoughts/comments?
    GB

    #2
    You cannot do this directly but just using the scripting facility (CheckEmailPOP_Triggernew.vb), this should be possible.

    Please give me more details such as if the attachment comes from 1 email address, if the attachment name is the same each time etc.

    BTW, please ensure you use the latest version of the package from my site and not the updater.
    Jon

    Comment


      #3
      Hi Jon:

      The idea would be that it could come from any e-mail address. I would think that I would create an e-mail address for the night (I have my own domain, so adding Christmas1012@mydomain.com as an email address for the night would be easy).

      1. Partygoer takes photo with smartphone. File could be saved as any name, but should be a jpeg.

      2. Sends picture to Christmas2012@mydomain.com

      3. Homeseer monitors mailbox - any e-mail with attachment "*.jpg" saves attachment in \\network\public\screensaver

      3a. In the odd chance two people sends photos with the same name, filename could be appended with the current time to avoid overwriting files.

      4. PC's around the house point to \\network\public\screensaver for screensaver photos.

      5. Within x minutes of sending photo, picture is included in cycling screensaver pictures.

      I recognize the fact that setting this up this way could threaten the integrity of my network (a virus is introduced via email), but considering the fact that this would be an e-mail address literally set up for hours and then deleted, as well as the fact that none of my attendees should have a reason to try to send me an email with a virus attachment during that limited window, I think the risk is low.

      Thanks for any advice you can give.

      GB

      Comment


        #4
        I have already installed from the Updater - should I do a complete uninstall and reinstall the file from your site, or can I just overwrite the files?

        Comment


          #5
          HI GadgetBoySI,


          Just for your info I do something like this but I use dropbox. My phone auto uploads the pictures to dropbox and the screen savers are set to the camera uploads in dropbox.
          I guess you could share the dropbox link that people could upload there pictures to.

          I hope this helps.

          Greig.
          Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
          X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
          Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
          Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
          Scripts =
          Various

          Comment


            #6
            Originally posted by GadgetBoySI View Post
            Hi Jon:

            The idea would be that it could come from any e-mail address. I would think that I would create an e-mail address for the night (I have my own domain, so adding Christmas1012@mydomain.com as an email address for the night would be easy).

            1. Partygoer takes photo with smartphone. File could be saved as any name, but should be a jpeg.

            2. Sends picture to Christmas2012@mydomain.com

            3. Homeseer monitors mailbox - any e-mail with attachment "*.jpg" saves attachment in \\network\public\screensaver

            3a. In the odd chance two people sends photos with the same name, filename could be appended with the current time to avoid overwriting files.

            4. PC's around the house point to \\network\public\screensaver for screensaver photos.

            5. Within x minutes of sending photo, picture is included in cycling screensaver pictures.

            I recognize the fact that setting this up this way could threaten the integrity of my network (a virus is introduced via email), but considering the fact that this would be an e-mail address literally set up for hours and then deleted, as well as the fact that none of my attendees should have a reason to try to send me an email with a virus attachment during that limited window, I think the risk is low.

            Thanks for any advice you can give.

            GB
            If you have not set up the script, you can just overwrite with the latest version.

            After setting up your account, you need to set Trriggerscript="1" under [Settings].

            In the scripts directory, you will find a file called CheckemailPOP_Triggernew.vb.

            Just add the following code:

            Code:
            If Filecount <> "0" then
            	Dim SourcePath As String = hs.GetAppPath & "\html\TempEmail\MB" &  MailboxNumber & "\" & MessageNumber
            	Dim DestPath As String = "\\network\public\screensaver"
            	Dim Files() As String
            	Dim File As String
            	Files = System.IO.Directory.GetFiles(SourcePath, "*.jpg")
            	For Each file In files
            		System.IO.File.Copy(file, DestPath & "\" & System.IO.Path.GetFileName(file),True)
            	Next
            End if
            This will only copy jpg files found in attachments to your selected folder.
            Jon

            Comment


              #7
              Reinstalled your plugin using the instructions included with the download.
              Reconfigured mail server
              Checked email successfully

              Added the text provided above to the script at the end, but before "end sub". Only change was my actual drivepath to the screensaver folder.
              Sent email from smartphone
              Refreshed email using your plugin.
              EMail received and announced
              Attachment can be viewed within email app. Attachment is named "IMAG0564.jpg"

              Nothing is saved in \\backup\public\screensaver

              Any suggestions?

              Comment


                #8
                First thing, did you enable the triggerscript entry under [settings]?

                If it was working, you should see a number of log entries showing the received email details.

                FYI, To find your attachment, navigate to your<Homeseer dir>/html/TempEmail/MB1 folder. Within that folder should be folders starting with 1. These numbers relate to the message number of the received email. You should be able to find the attachment within the respective folder.
                Jon

                Comment


                  #9
                  Originally posted by jon00 View Post
                  First thing, did you enable the triggerscript entry under [settings]?
                  Duh - sorry about that. Made the change.

                  Script is now working!

                  Now... Since I only want to pay attention to e-mails coming into a specific email address that I will create for the night (xmas2012@mydomain.com), I will add another MessageBox with the login credentials for it.

                  How can I limit the review of the incoming e-mails to only that mailbox?

                  Thanks again Jon - I'm thinking this will be a cool thing for the guests at my upcoming XMas party.

                  Comment


                    #10
                    Would this work?

                    If lcase(MailTo)=xmas2012@mydomain.com AND Filecount <> "0" then

                    ...

                    End if

                    Comment


                      #11
                      If you only have one mailbox setup with the domain xmas2012@mydomain.com then no change is necessary.

                      If you do have more than one then the changes would be:

                      If MailboxNumber="1" and Filecount <> "0" then

                      ...

                      End if

                      This assumes mailbox one is the Xmas domain.
                      Jon

                      Comment


                        #12
                        Got it. Thanks.

                        Next process to tackle...

                        It appears that when the screensaver is triggered, it uses the current directory's contents to stream pictures. Therefore, if, after the screensaver is triggered, another file is saved in the folder, it will not be included in the cycling pictures. Only after the screensaver is stopped and then re-triggered will it include the newest shots.

                        I may need to forgo using the screensaver to view the photos and just have the PC do a slideshow - hopefully newer files will be included as they are added to the folder.

                        Thanks again, Jon

                        Comment


                          #13
                          Originally posted by GadgetBoySI View Post
                          Got it. Thanks.

                          Next process to tackle...

                          It appears that when the screensaver is triggered, it uses the current directory's contents to stream pictures. Therefore, if, after the screensaver is triggered, another file is saved in the folder, it will not be included in the cycling pictures. Only after the screensaver is stopped and then re-triggered will it include the newest shots.

                          I may need to forgo using the screensaver to view the photos and just have the PC do a slideshow - hopefully newer files will be included as they are added to the folder.

                          Thanks again, Jon
                          How about using my Remote Computer Control & Network Monitor to stop/start the screensaver?
                          Jon

                          Comment


                            #14
                            Did not know you had that. Cool concept - Looks like I just add your plugin to the HSPro and then install the client on the PC's around my network?

                            The flow would be to save the photo in the folder and the restart the screensavers on the PC's - probably with a slight delay?

                            What do you think about that?

                            Comment


                              #15
                              Originally posted by GadgetBoySI View Post
                              Did not know you had that. Cool concept - Looks like I just add your plugin to the HSPro and then install the client on the PC's around my network?

                              The flow would be to save the photo in the folder and the restart the screensavers on the PC's - probably with a slight delay?

                              What do you think about that?
                              Just what I was thinking!
                              Jon

                              Comment

                              Working...
                              X