Announcement

Collapse
No announcement yet.

Delete Emails

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

    Delete Emails

    I am using the POP3 module. Is there a way to have homeseer delete an email after it is read rather than keep it on the mail server? I use the module so I can send emails to Homeseer and have it run events, like alarm on, lights off, etc. Since it is not deleting the emails, if Homeseer restarts, it downloads all the emails again and runs all the events, ack!

    #2
    I'm confused! My email package keeps a database of all recieved emails and should not re-trigger anything again.

    Anyway, yes, you can delete emails. This is a segment from the help files to assist you:

    Automatic Email deletion

    You can automatically delete certain emails from the mail server on arrival. This can be by matching the email address or detecting a text string within the subject line or from line. These are achieved by entries to the DeleteOnAddress, DeleteOnSubject and/or DeleteOnFrom lists.

    Because of the potential risk of email deletion, these lists are not included in the checkpop.ini by default.

    To activate email deletion on a specific email address, add the following entry to your checkpop.ini file:

    [DeleteOnAddress1]
    Emailaddress="TheEmailYouWantDeleted@123.com"

    If you receive an email from TheEmailYouWantDeleted@123.com
    Jon

    Comment


      #3
      hs.MailDelete


      PHP Code:
      sub main()
      killing 1
      index 
      hs.MailTrigger 
      subject 
      trim(hs.MailSubject(index))
      lcsubject =  lcase(subject)
      ucsubject =  ucase(subject)
      body =  trim(hs.MailText(index))
      lcbody lcase(body)
      ucbody ucase(body)
      from =  trim(hs.MailFrom(index))
      lcfrom =  lcase(from)
      from_name =  trim(hs.MailFromDisplay(index))
      '===========================


      if killing = 1 then
         killit = hs.MailDelete(index)
      end if

      end sub 


      ~Bill

      Comment


        #4
        Bill,

        I'm not sure why you just posted that code but it would not work using my email package. It does not use Homeseer's email functions for receive.
        Jon

        Comment


          #5
          Ya know, I just read the post title and not the category.

          You're right - I was just doing basic scripting.

          See ya!


          ~Bill

          Comment


            #6
            The problem that I am running into is that homeseer is reading the mail off the POP server, but doesn't delete it from the server so if homeseer is restarted all the emails that haven't been deleted from the Pop server start to download again. If those emails have triggers in them, they get executed all over again.

            Comment


              #7
              Originally posted by dsabot View Post
              The problem that I am running into is that homeseer is reading the mail off the POP server, but doesn't delete it from the server so if homeseer is restarted all the emails that haven't been deleted from the Pop server start to download again. If those emails have triggers in them, they get executed all over again.
              I appreciate that but can you confirm that you are using my Checkemail package for this?
              Jon

              Comment


                #8
                Originally posted by jon00 View Post
                I appreciate that but can you confirm that you are using my Checkemail package for this?
                Jon00_Email is what I am using.

                Comment


                  #9
                  So when you restart homeseer, are all the emails announced again or is it only the triggers that fire?

                  Also, what method are you using to trigger events?
                  Jon

                  Comment


                    #10
                    Yes, all emails are announced again.



                    The arm and disarm are subjects the script checks for.

                    Comment


                      #11
                      The#2 post shows you how to delete on subject, however I think running the script every 30 seconds may be a bit excessive and not allowing the database to work. Can you change it to 1 minute and see if that makes a difference.
                      Jon

                      Comment


                        #12
                        Originally posted by jon00 View Post
                        The#2 post shows you how to delete on subject, however I think running the script every 30 seconds may be a bit excessive and not allowing the database to work. Can you change it to 1 minute and see if that makes a difference.
                        Sure I can change it but it seems to me that the script should have a tag like all email programs do to either keep or delete a copy on the email server. If I have to delete on subject it will never delete the spam emails I get unless I speciifically enter those subjects into the database.

                        Comment


                          #13
                          I don't understand what you are saying? How on earth would the script know it was a spam email or something you want to keep?

                          There is something wrong here as the script does keep a database of all emails read. If it did not, there would be loads of complaints. If you are running at such a short interval, when Homeseer shuts down, it cannot do so within this 30 sec time frame. Therefore the script can be in action during the shutdown process and could upset the database.

                          Perhaps others who use my checkemail program can confirm or not that emails are repeated when Homeseer starts?
                          Jon

                          Comment


                            #14
                            Perhaps others who use my checkemail program can confirm or not that emails are repeated when Homeseer starts?
                            I have checkmail running at 10 min intervals and never had the emails repeated when Homeseer starts.

                            Comment

                            Working...
                            X