I have a very basic script which just has a few lines of code for checking various POP3 email accounts I use. It just has the settings and everything is for the same provider, and that is followed by new lines for all the user account info.
Sometimes, for whatever reason, there is a missed connection to the server or for whatever reason a certain message isn't downloaded. I know this because I am expecting certain messages and after a certain amount of detective work I can track down which account did not have a certain email download.
Keeping in mind the account information is correct, is there any way for the script to tell me at the end of its run which accounts it couldn't access if that is what is happening?
POP3 Timeout list
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
Are you using a timeout setting? The default is only five seconds, so that might not be enough. You can increase it like this :
Let>POP3_TIMEOUT=60
Also, it might be worth fetching the POP3_RESULT and either popping up a message if it's unsuccessful, or maybe writing POP3_RESULT to a log file.
MessageModal>POP3_RESULT
I have a feeling that different mail servers might give different messages. Mine says "sayonara" when it signs off successfully. If I purposely fudge my login details, I get "bad login".
The following script will log in and retrieve email. Entering bad login details will write the following error to a txt file named errors.txt
"Account1 - 2013-09-05 at 17:35
Bad login"
Let>POP3_TIMEOUT=60
Also, it might be worth fetching the POP3_RESULT and either popping up a message if it's unsuccessful, or maybe writing POP3_RESULT to a log file.
MessageModal>POP3_RESULT
I have a feeling that different mail servers might give different messages. Mine says "sayonara" when it signs off successfully. If I purposely fudge my login details, I get "bad login".
The following script will log in and retrieve email. Entering bad login details will write the following error to a txt file named errors.txt
"Account1 - 2013-09-05 at 17:35
Bad login"
Code: Select all
Let>POP3_STATUS=1
Let>POP3_MSGSIZELIMIT=3
Let>POP3_TIMEOUT=60
RetrievePOP3>2hosts.com,[email protected],XXpasswordXX,%USERDOCUMENTS_DIR%\emailfiles
MessageModal>POP3_RESULT
if>%POP3_RESULT%<>Sayonara
year>theyear
month>themonth
day>theday
hour>thehour
min>theminute
writeln>%USERDOCUMENTS_DIR%\emailfiles\errors.txt,,Account1 - %theyear%-%themonth%-%theday% at %thehour%:%theminute%%CRLF%%POP3_RESULT%
endif
Separate>POP3_MSGFILES,;,MsgFiles
MessageModal>Files Downloaded: %MsgFiles_count%%CRLF%File List: %POP3_MSGFILES%
Last edited by Dorian (MJT support) on Fri Dec 27, 2013 12:13 am, edited 4 times in total.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am