enaiman Posted February 3, 2012 Share Posted February 3, 2012 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.aspxThe 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 :) Link to comment Share on other sites More sharing options...
water Posted February 3, 2012 Share Posted February 3, 2012 (edited) Please have a look at this It displays SenderName and Subject when a new mail arrives.Details can be found here. Edited February 3, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
enaiman Posted February 5, 2012 Author Share Posted February 5, 2012 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 :) Link to comment Share on other sites More sharing options...
water Posted February 6, 2012 Share Posted February 6, 2012 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. enaiman 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
rover Posted February 6, 2012 Share Posted February 6, 2012 enaimanCheck 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 fileRun 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) enaiman 1 I see fascists... Link to comment Share on other sites More sharing options...
enaiman Posted February 6, 2012 Author Share Posted February 6, 2012 @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 :) Link to comment Share on other sites More sharing options...
water Posted February 6, 2012 Share Posted February 6, 2012 Good luck! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 6, 2012 Share Posted February 6, 2012 This 'new email notifier' will run an executable on event.. PopTray Mail Notifier. enaiman 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
enaiman Posted February 7, 2012 Author Share Posted February 7, 2012 @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 :) Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 7, 2012 Share Posted February 7, 2012 @somdcomputerguyThanks 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now