Sign in to follow this  
Followers 0
enaiman

New email notification

10 posts in this topic

I am trying to put together a sort of SMS gateway. Before trying to reinvent the wheel, I had a look at whatever was available on the market and I found them lacking in features or too damn expensive.

The only way I can go is email to SMS (for integration purposes)

Finally I've decided to give it a go.

I wrote a script to send the necessary commands to my GSM module via its serial interface.

Now I need a mailbox to catch all undelivered emails (the emails intended to be sent out as SMS will be addressed to xxxxxxxx@mydomain.local, where xxxxxx is the phone number), because obviously there isn't such an email account. I've managed to find how to do this in Exchange 2010 ("postmaster" mailbox) http://technet.microsoft.com/en-us/library/bb430765.aspx

The above parts I can do them, no problem - the tricky part is the one I am asking for help.

I need a "trigger" (to detect when new email arrived in the postmaster mailbox) and a way for my script to get that email (the address and the body).

Speaking about the "trigger" - I found something on msdn - MAPI Notifications Events - New mail (fnevNewMail) http://msdn.microsoft.com/en-us/library/cc840027.aspx - the problem is, I have no idea how can I use that.

Next part: getting the content of the new email - no idea again.

I would really appreciate any help.

Thanks


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please have a look at this It displays SenderName and Subject when a new mail arrives.

Details can be found here.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi water,

Thank you very much for your help. I knew about your Outlook UDF and everything would work perfectly if I had Outlook installed on that machine.

I don't know if I should spend about $300 for a copy of MS Office just to have this functionality; it does look expensive :)

This weekend I had a look at other mail clients (free ones) and Mozilla Thunderbird seem to be the best out there but unfortunately none of the mail clients I found can't "do something" (run a script/executable) when new mail arrives.

So, I am not in a very fortunate position.

Any other ideas?


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Hi enaiman,

I don't know anything about Thunderbird. But a quick Google search led me to the assumtion that Thunderbird supports events by a construct called "listeners" as well.

Maybe this is a good start: Subscribe to new mail event in Thunderbird or Getting notified when new mail arrives in Thunderbird.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

enaiman

Check the message filtering options of the mail clients you looked at, some can run an application as a filter option.

The FiltaQuilla Thunderbird extension adds new message filter options.

Run or Launch a file, Save Message as File (use with Move Later option if moving messages from InBox), run javascript, etc.

http://mesquilla.com/extensions/filtaquilla/

It has a filter option to run a file with command line params - Subject, Sender, Date, etc, but header only info,

apparently there is an issue with mozilla core code not supporting streaming the message.

http://mesquilla.com/forum/filtaquilla/h...ess-body-of-email-with-externa)

http://mesquilla.com/forum/filtaquilla/how-to-get-message-body/

http://mesquilla.com/forum/filtaquilla/run-file/

You can check a filter option to save the message as an eml file in the folder of your choice,

the file is named with the subject line (duplicates have subject line with added number)

You could then read the message from the script instance using something like @TempDir & "\MyMsgFolder\" & $CmdLine[X] & ".eml"

delete the file, then parse the message to remove the header.

example InBox filter: check sender field, run script with subject,sender and date strings, save message to eml file

Run File: thunderbird-runtest.exe,@SUBJECT@,@AUTHOR@,@DATE@

Save Message as File: "your message folder"

#include <Array.au3>
Local $sMsg = FileRead(@TempDir & "\MyMsgFolder\" & $CmdLine[1] & ".eml")
FileDelete(@TempDir & "\MyMsgFolder\" & $CmdLine[1] & ".eml")
Local $aCmd = $CmdLine
Local $aArray = StringSplit($sMsg, @CRLF, 3)
_ArrayConcatenate($aCmd, $aArray)
_ArrayDisplay($aCmd)
1 person likes this

I see fascists...

Share this post


Link to post
Share on other sites

@water, @rover

Thank you very much for your help - it looks like I do have a good starting point here.

Now it's up to me :)


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Good luck!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

This 'new email notifier' will run an executable on event.. PopTray Mail Notifier.

1 person likes this

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

@somdcomputerguy

Thanks alot :)


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

@somdcomputerguy

Thanks alot :)

You bet. Good luck with your project.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0