SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Tue Mar 19, 2024 02:03
SMSTools3 Community » Sample scripts / setups Bottom

MailSMSGateway

Login and Post Reply

Page:  1  2  3  Next  Last

Author Post
Member
Registered:
Oct 2012
Location: Austria
If someone is interested in "MailSMSGateway".

SMS is one of the most preferred mode of communication and therefore it would be nice to send an email notification directly to an sms receiver. This gateway retrieves the mails and place it to the sms spool directory for sending.

MailSmsGateway is a simple interface between mailing and sms services (like smstools3).

How does it work ?
An email client sends mail messages to an email account. The email account can be located under a linux server (sendmail), Microsoft Exchange or any other email server.
You have now 4 possibilities to retrieve the emails and pass it over to the sms service (at the moment smstools3 is supported).

Under *nix systems:
- mailbox
- maildir

system independent:
- pop3/pop3s
- imap4

Further details:
http://sourceforge.net/projects/mailsmsgateway/

Member
Registered:
Nov 2012
Location: Germany
Great work! :)

But would it be possible to have the mailbody incorporated into the sms text aswell and not only the subject?

Member
Registered:
Nov 2012
Location: Germany
Hi Herbert.

I'm really really new to Perl so please don't be mean if I don't get things right in th beginning :oops:
I did some research on parsing mail with perl and stumbled across Mail::MboxParser that should provide all the different fileds (from, to, subject, msg_text)

This script provides all the fields when run like:
./decmail.pl < mail



Found this on Perl Monks.

Member
Registered:
Oct 2012
Location: Austria
Topic owner
Hi,

as already mentioned in my mail, it would be possible but on very large mails a lot of sms would be sent. With the subject of the mail it is more manageable.

Concerning "Mail::MboxParser", it is another possibility to process the mailbox, but keep an eye to the (further) development of this module (version from 2005).

Member
Registered:
Oct 2012
Location: Austria
Topic owner
Hi,

I added now the possibility to send the mail body instead of the subject.

have fun!

Member
Registered:
Nov 2012
Location: Germany
Sweet :) Thank your very much.

I will have a look at it and keep you posted.

Regards,
Daniel

Member
Registered:
Nov 2012
Location: Germany
Herbert.

This works great! :o

Do you think you could make it possible to send subject+mailbody? I know I seem very demanding :oops:

Regards,
Daniel

Member
Registered:
Oct 2012
Location: Austria
Topic owner
yes, I try it to get it ready till next week

Member
Registered:
Oct 2012
Location: Austria
Topic owner
Now it is possible to send both (subject & body), to find in version 1.11 on sourceforge. Details how to customize in pdf document under FAQ.

Member
Registered:
Nov 2012
Location: Germany
Works like a charm :mrgreen:

Great work! Thank you very much!

Member
Registered:
Mar 2013
Location: United Kingdom
Hi Herbet,

this is a magnificent application that you have developed, thank you very much, exactly what i was looking for.

i have installed and configured as per your document and receiving and converting perfectly, and log file showing moved to spool folder.
My problem is the files are not moving into that folder. what are the file names that are moved so that i can try and establish where they are being moved to?

i have checked all the paths and they are correct in the config file and do exist.
any help, advice or assistance would be greatly appreciated.

Thanks again.

PS: Ubuntu 12.04 server, with apache2, postifx, dovecot, ispconfig 3, smstools 3 and playsms amongst numerous other components. the latest and most important, MailSmsGateway!


« Last edit by tips on Thu Mar 21, 2013 19:39, 133 months ago. »
Member
Registered:
Oct 2012
Location: Austria
Topic owner
Hi,

I will give you a short description about the flow of the processed mail message.

- opening of the mailbox and start reading of mails
- arranging SMS Message (text from subject or mailbody)
- creation of a temporary file in directory "/tmp" (temporary file like: /tmp/SMS_send_<XXXXXX>)
- after creation the file is moved to the SMS spool directory (normally /var/spool/sms/outgoing) if not changed in MailSmsGateway.cfg (Parameter SMS_SPOOLDIR)
- deletion of processed mail

You have 2 files to look for hints/errors:
1) the standard logfile "/var/log/MailSmsGateway.log"
2) and "/var/log/MailSmsGateway_STDERR_<XXXXXX>" for possible program/module errors

Member
Registered:
Mar 2013
Location: United Kingdom
Working great, thank you so much.

Member
Registered:
May 2013
Location: Italy
Thank you hstadler for your job.
Just a little question: in my organization we send a message to many phone at the same time (es: 12345@sms.com; 78901@sms.com).

Your software intercept only the first number :-(

I have multi way to solve the problem but the best is that your software check this case.

I'm not a developer, sorry, I can try to modify your script but I'm very scary!

Can you help me?

Thank,

Alessandro

Member
Registered:
Oct 2012
Location: Austria
Topic owner
hi,
i will try to find a solution,
bye

Member
Registered:
May 2013
Location: Italy
Oh, thank you.
I have seen the script, the method you use is Mail::Address (http://search.cpan.org/~markov/MailTools-2.12/lib/Mail/Address.pod) but it seems that catch only the first address.
Is necessary write a loop, I think.

Thank you very muche,
Alessandro

Member
Registered:
Oct 2012
Location: Austria
Topic owner
Hi,

have a look at http://sourceforge.net/projects/mailsmsgateway/ for the new version (1.12). It should work now with all receivers in the "To:" field.

Bye

Member
Registered:
May 2013
Location: Italy
Fantastic!!!

It works perfectly, thank you very much!!!

I was solved with a complex rule in my mail server but this is the better solution.

Thank you again!

Alessandro

Member
Registered:
May 2013
Location: Italy
There is a little problem now: in /var/log I have some file MailSMSgateway_STDERR_xxxx.log, the files contains:

utf8 "\xE0" does not map to Unicode at /usr/local/bin/MailSmsGateway/MailSmsGateway line 975, <TH> line 24.
Malformed UTF-8 character (unexpected non-continuation byte 0x4d, immediately after start byte 0xe0) in substitution (s///) at /usr/local/bin/MailSmsGateway/MailSmsGateway line 900, <TH> line 24.

One file every time I use the script (every 1 minute).

There's not problem for me, is working fine and I can delete dei log.

Thank you again, if you came in Caorle for your holiday (http://turismo.caorle.eu/) I can give you a little present (a book of very old people lived in Caorle, in Italian!!! very cool!!!).

Bye

Member
Registered:
Oct 2012
Location: Austria
Topic owner
hi,

this message has something to to with your configuration file in /etc directory. Please check with a hexeditor or with "od" and search for the hex code "e0" and "4d". the file should be in an "utf8" format.

may be this link helps:
http://stackoverflow.com/questions/5477565/how-to-setup-vim-properly-for-editing-in-utf-8

Thank you for your offer.

Bye

Member
Registered:
Nov 2012
Location: Germany
Hi Herbert,

we are currently implementing Cisco ISE. One aspect is to provide wifi guest accounts. Wifi credentials can be provided via SMS, well basically via SMTP-to-SMS funtionality. Details

Cisco uses a globally configured SMTP server to deliver a mail to an already implemented Mail2SMS gateway. A template editor can be used to design the mail body. The problem is that Cisco doesn't support putting target mobile number into RCPT TO field and put everything into mail body like this:



I was thinking about using procmail and formail in combination to extract body and the needed information like "to:" and everything marked with "text:" and then build a new message in supported MailSMSGateway format.

What do you think? Do you have a better or more clever solution? Any help would be appreciated :oops:


« Last edit by schindld on Mon Nov 25, 2013 19:47, 125 months ago. »
Member
Registered:
Oct 2012
Location: Austria
Topic owner
Hi,

I think with no adaption of the code there is no chance to get a simple solution. I try to build a solution in the next 2 weeks.

bye

Member
Registered:
Nov 2012
Location: Germany
This is great news, thanks! Sorry for bothering you :oops:

Looking forward hearing from you.

Member
Registered:
Oct 2012
Location: Austria
Topic owner
hi,

now I have "designed" a solution for you, please have a look at page 17 in the pdf document on sourceforge.

bye

Member
Registered:
Jan 2014
Location: Russian Federation
Hi! Thank you for your project!
I did not have Unicode support for sending messages in Russian. I added the changes to the code. Also added a run from another user in init-script for Centos. I want to share with the community. If you add the changes to the main branch. I will be very grateful.
Maybe you can implement it more beautiful, it did for me =)

MailSmsGateway with unicode message support v.1.13

Login and Post Reply

Page:  1  2  3  Next  Last

SMSTools3 Community » Sample scripts / setups Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.