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!
Announcement
Collapse
No announcement yet.
Delete Emails
Collapse
X
-
dsabotTags: None
-
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
-
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
-
dsabot
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
-
Originally posted by dsabot View PostThe 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
-
dsabot
Comment
-
dsabot
Originally posted by jon00 View PostThe#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.
Comment
-
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?
Comment
-
Guest
Perhaps others who use my checkemail program can confirm or not that emails are repeated when Homeseer starts?
Comment
Comment