- Notifications
You must be signed in to change notification settings - Fork2
A simple tool for parsing and sending type b messages to email.
License
groubis/typebtomail
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A simple tool to parse and send type b messages to email.
In case you have never heard of type b messaging,this is a good start! In case you do, this tool will help you a lot.
You will need the following to have the application running
- A type b client (which supports STX format)
- An email account
- AutoIT
Use AutoIT to compile typebtomail.au3 to a windows executable.
Copy all files in a folder. E.g C:\typebtomail
Create 4 folders under the folder described in step 2:
- PARSED e.g C:\typebtomail\PARSED
- UNPARSED e.g C:\typebtomail\UNPARSED
- LOG e.g C:\typebtomail\LOG
- IN e.g C:\typebtomail\IN
To configure the application you have to edit the configuration.ini accordingly. This is a sample of the configuration.ini:
[Directories]IncomingDir=C:\typebtomail\INIncomingDirFilter=*.rcvLogDir=C:\typebtomail\LOGParsedDir=C:\typebtomail\PARSEDUnParsedDir=C:\typebtomail\UNPARSED[TypeB]AllowedIdentifiers=MVT,LDM,PSMSmartParser=1[MailCommunication]MailServer=smtp.gmail.comMailPort=465MailSSL=1AccountUsername=your@email.comAccountPassword=youremailpassword[MailContent]Importance=NormalDestination=theemail@destination.comCCDestination=thecc@destination.comBCCDestination=FromName=My MessagingFromAddress=theemail@sender.com
A description of the elements folows:
Element | Description | Example(s) |
---|---|---|
IncomingDir | The folder where incoming type b files are produced from your type b client. | C:\typebtomail\IN |
IncomingDirFilter | The wildcard for matching files in IncomingDir. For more information check $sFilter remarkshere. | *.txt or *.rcv |
LogDir | The folder where logs of the applications will be stored. | C:\typebtomail\LOG |
ParsedDir | The folder where parsed and transmitted files will be stored. | C:\typebtomail\PARSED |
UnParsedDir | The folder where unparsed and not transmitted files will be stored. | C:\typebtomail\UNPARSED |
AllowedIdentifiers | The comma delimited message identifiers you want to send to email. If you want all messages to be transmitted, then leave this element blank | MVT,LDM,PSM |
SmartParser | A boolean switch for smart removal of headers and subjects before identifier parsing | 1 or 0 |
MailServer | The host name of ip of your email server | smtp.gmail.com |
MailPort | The port of your email server | 465 |
MailSSL | A boolean switch for your email server's SSL | 1 or 0 |
AccountUsername | Your email's account username | georgeroubis@gmail.com |
AccountPassword | The password of your email's account | myp@$$w0rd! |
Importance | The importance of the transmitted email. | High/Low/Normal |
Destination | The email recipient. | someone@gmail.com |
CCDestination | The cc recipient. | someoneelse@gmail.com |
BCCDestination | The bcc recipient. | ahidden@gmail.com |
FromName | The email "From". | MyMessagingSvc |
FromAddress | The email "From Address". | georgeroubis@gmail.com |
Run your compliled executable (typebtomail.exe). This can be done directly from windows explorer or from cmd or even from a scheduled task manager tool!
If for example you have received a file called incomingtest.rcv under C:\typebtomail\IN with the following content:
=HEADERRCV,2017/07/21 11:40=PRIORITYQK=DESTINATION TYPE BSTX,TSTXXXXSTX,TSTYYXXSTX,TSTZZXX=ORIGINTSTXXSS=DBLSIGXX=MSGID123456=SMIMVT=TEXTXX006/12.SXTST.ATHED211140DL00
run the application and you will see something similar to this in the log files:
2017-07-21 08:45:41;TypeBToMail.v.1.3.au3;0;1 files were found under directory C:\typebtomail\IN.*****************************************************************************************************************************2017-07-21 08:45:41;TypeBToMail.v.1.3.au3;0;Attemtping to read file C:\typebtomail\IN\incomingtest.rcv.2017-07-21 08:45:41;TypeBToMail.v.1.3.au3;0;File C:\typebtomail\IN\incomingtest.rcv is a valid type b message.2017-07-21 08:45:41;TypeBToMail.v.1.3.au3;0;File C:\typebtomail\IN\incomingtest.rcv parsed. Data were the following: Received On -> 2017-07-21 11:40 COR Indicator -> 0 PDM Indicator -> 0 Originator -> TSTXXSS Destination(s) -> TSTXXXX, TSTYYXX, TSTZZXX Message ID -> 123456 Double Signature -> XX Priority -> QK Identifier -> MVT Message Matched -> Identifier matches system configuration. Text -> [001] -> MVT [002] -> XX006/12.SXTST.ATH [003] -> ED211140 [004] -> DL002017-07-21 08:45:41;TypeBToMail.v.1.3.au3;0;Starting email transmission.2017-07-21 08:45:44;TypeBToMail.v.1.3.au3;0;Email message sent successfully.2017-07-21 08:45:44;TypeBToMail.v.1.3.au3;0;Attemtping to move file C:\typebtomail\IN\incomingtest.rcv to directory C:\typebtomail\PARSED\2017\07\21.2017-07-21 08:45:44;TypeBToMail.v.1.3.au3;0;File C:\typebtomail\IN\incomingtest.rcv moved to directory C:\typebtomail\PARSED\2017\07\21.
The following udf has been used: