Secure Email Detection

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Secure Email Detection

Post by JRL » Wed May 22, 2019 8:33 pm

Back in aught eight, I wrote a Macro Scheduler program to detect new emails sitting on our email server for each of about 100 users. The process takes from 30 seconds to 10 minutes depending on how many email messages the users leave sitting in their In Boxes. The program uses the Macro Scheduler telnet commands.

The old server is being replaced. Our email is moving to an on-line provider. I would still like to detect new emails for the 100 or so users for whom I'm currently providing new email alerts. I've acquired the server name and the pop3 port and using the SSL libraries I can use Macro Scheduler's RetrievePOP3 function to download email successfully. Telnet does not work at all.

What I want is to be able to alert a user if there are any unread messages waiting for them in their In Box without having to download everything from the In Box. Is there a method to do that using RetrievePOP3? Is there a way to use SSH or a way to make telnet work with SSL?

Any other ideas?
Thank you for reading and for your thoughtful consideration of the post.
Dick

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Secure Email Detection

Post by Dorian (MJT support) » Thu May 23, 2019 10:01 am

Hi Dick,

I've made Marcus aware of this post, for his insight.

Kind regards,

Dorian.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Secure Email Detection

Post by Marcus Tettmar » Thu May 23, 2019 10:18 am

Unfortunately as far as I am aware POP3 does not have the ability to know which emails have been read and which haven't.

There's no SSL support for the Telnet commands. The server would probably want SSH for that anyway. But you could perhaps script winscp or putty or some other SSH client (winscp can take a text 'script file' which could be autogenerated by Macro Scheduler). I'm assuming here that you there is some command line you can use to get the unread mail count when connected to the server console and hence that's why you've asked?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Secure Email Detection

Post by JRL » Thu May 23, 2019 2:10 pm

Thank you for your reply.
I have already tried putty and could not make a telnet or ssh connection to the "cloud" email server. I'll look into winscp though it will likely have the same result as putty

As I stated prior, I wrote this ten years ago. It is a series of macros that do different things so its taken me a little time to try to figure out what I did.

1) Each user has a folder that contains log files. One of the files is the count of their email messages on the email server. This is acquired using the POP3 STAT command.

2) A program I called "Email Count" runs at an interval (30 min) all day every day and updates each users log files. After comparison with the previous email count, If the email count increases, the user is alerted they have new email.

3) Another Macro Scheduler program is used by each user to initiate the email client and open their account. That program stays active until they close the email client. It then deletes their email count log file and runs POP3 STAT creating an updated email count log file.

Would it be possible to have something like POP3_SESSIONLOG system variable that provides the STAT command data and a POP3_COUNT=1 that causes RetrievePOP3 to only run the STAT command?

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Secure Email Detection

Post by JRL » Thu May 23, 2019 4:06 pm

WinSCP is not working either. The only thing I've found that will connect other than actual email client software is Macro Scheduler's RetrievePOP3 function. RetrievePOP3 and email clients want to download all of the mail each time they check. This would not be terrible if I could delete the mail from the server after download but the folks hierarchically above me want to keep all email on the server.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Secure Email Detection

Post by Marcus Tettmar » Wed May 29, 2019 5:35 pm

I'll look into the STAT thing.

Unfortunately that's how POP3 works. Could you maybe make another POP3 account somewhere else, set up some kind of auto-forward (in Outlook or otherwise) so that email from the real account goes to the special account, then RetrievePOP3 from the new forwarded account and delete there? That way the email is still left on the main server, to satisfy the powers that be, but you get to know how many new emails there are because you're controlling the deletion and download on the account it was forwarded to?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Re: Secure Email Detection

Post by rullbandspelare » Fri May 31, 2019 8:06 am

I( havent comprehended all of Your problems. But stunnel can convert Your Telnet traffic to communicate over TLS/SSL
I have used it and it is very good.

https://www.stunnel.org/
https://messageops.com/connecting-non-s ... ft-online/

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts