Author |
Post |
|
#1 Fri Aug 21, 2009 09:40, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
|
Hi everyone, I have a problem .. Should receive an email on a mailbox and can then forward a number of mobile phone. I installed qmail and smstools and both work, but I do not understand how to send mail through sms. I read the script email2sms but I do not understand how to use it, someone can help me? ps. sorry for my bad English bye
|
|
#2 Fri Aug 21, 2009 10:12, 187 months ago.
|
Member
Registered: Jun 2009
Location: Russian Federation
|
Quote from the script :
# If you use QMail and vpopmail you need the file # /home/vpopmail/domains/your-domain/.qmail-sms with this content:
# | /usr/local/bin/email2sms
|
|
#3 Fri Aug 21, 2009 10:55, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
ok.. created the file / home/vpopmail/domains/mydomain.st/.qmail-sms containing only this string: | / usr/local/bin/email2sms with permits: ls -l /home/vpopmail/domains/mydomain.st/ -rw-r--r-- 1 vpopmail vchkpw 28 Jul 23 17:41 .qmail-sms I don't understand how to operate, the email can be sent to any account in the folder mydomain.st or to a specific user? the email should have a special syntax? many thanks
|
|
#4 Fri Aug 21, 2009 11:11, 187 months ago.
|
Member
Registered: Jun 2009
Location: Russian Federation
|
I think you should also place email2sms script into /usr/local/bin e-mail should has format of sms file used by smsd , i.e. :
|
|
#5 Fri Aug 21, 2009 11:16, 187 months ago.
|
Member
Registered: Jun 2009
Location: Russian Federation
|
Quote again :
# The eMail must include the phone number in the To: field, for example: # To: "Herbert +491721234567" <sms@localhost>
|
|
#6 Fri Aug 21, 2009 14:09, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
I tried to send an email to an account type sms@mydomains.st but nothing sms .. I do not understand the file. qmail-sms can read the email into the box .. thanks for the help
|
|
#7 Sat Aug 22, 2009 13:07, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Have you checked that the file /usr/local/bin/email2sms is executable and it has suitable permissions?
Also, what account is used to run smsd and who owns the /var/spool/sms/outgoing directory?
Probably qmail (or whoever runs a mailer daemon) cannot create outgoing SMS file. Perhaps you should chmod 777 /var/spool/sms/outgoing.
You could temporarily change /usr/local/bin/email2sms to create a file to the /tmp directory: OUTFILE=$(mktemp /tmp/smsgw.out.XXXXXX)
With this change you can see if the qmail side works as expected.
If the smsd is running as an unpriviledged user, you might need to change permissions of a file created by email2sms script: chmod 666 $OUTFILE ( after a mktemp line ).
|
|
#8 Mon Aug 24, 2009 08:47, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
keke wrote Have you checked that the file /usr/local/bin/email2sms is executable and it has suitable permissions?
Yes.. -r-xr-xr-x 1 root wheel 898 Jul 28 10:18 /usr/local/bin/email2sms keke wrote Also, what account is used to run smsd and who owns the /var/spool/sms/outgoing directory?
drwxr-xr-x 2 uucp dialer 512 Aug 21 16:33 outgoing ..smsd_user="uucp" keke wrote Probably qmail (or whoever runs a mailer daemon) cannot create outgoing SMS file. Perhaps you should chmod 777 /var/spool/sms/outgoing.
..try keke wrote You could temporarily change /usr/local/bin/email2sms to create a file to the /tmp directory: OUTFILE=$(mktemp /tmp/smsgw.out.XXXXXX) With this change you can see if the qmail side works as expected. I also tried this but does not create a file smsgw.out.XXXXXX This means that qmail is not working well? email can be sent to any existing account on a specific or vpopmail? thanks always for the help
|
|
#9 Tue Aug 25, 2009 09:43, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
pardon the insistence, this is my setup.. # ls -l /usr/home/vpopmail/domains/mydomain.st/ -rw------- 1 vpopmail vchkpw 34 Jul 23 12:43 .dir-control -rw------- 1 vpopmail vchkpw 59 Jul 23 12:42 .qmail-default -rw-r--r-- 1 vpopmail vchkpw 27 Aug 25 11:11 .qmail-sms -rw------- 1 vpopmail vchkpw 92 Jul 23 12:42 .qmailadmin-limits -rw------- 1 vpopmail vchkpw 0 Jul 23 12:43 .vpasswd.lock drwx------ 3 vpopmail vchkpw 512 Jul 23 12:43 sms drwx------ 3 vpopmail vchkpw 512 Jul 23 12:42 postmaster# cat /usr/home/vpopmail/domains/mydomain.st/.qmail-sms | /usr/local/bin/email2sms# ls -l /usr/home/vpopmail/domains/mydomain.st/sms/Maildir/ drwx------ 2 vpopmail vchkpw 512 Aug 25 11:24 cur drwx------ 2 vpopmail vchkpw 512 Aug 25 11:24 new drwx------ 2 vpopmail vchkpw 512 Aug 25 11:23 tmp # ls -l /usr/local/bin/email2sms -r-xr-xr-x 1 root wheel 939 Aug 25 11:20 /usr/local/bin/email2smsscript email2sms remained unchanged as the original! # ls -l /var/spool/sms/ drwxr-xr-x 2 uucp dialer 512 Aug 21 15:37 checked drwxr-xr-x 2 uucp dialer 512 Aug 21 15:37 incoming drwxrwxrwx 2 uucp dialer 512 Aug 21 16:33 outgoing emails arrive regularly to maildir SMS, but it is then forwarded to the outgoing folder.. I can do? thanks again
|
|
#10 Tue Aug 25, 2009 18:35, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
cicchio wrote keke wrote You could temporarily change /usr/local/bin/email2sms to create a file to the /tmp directory: OUTFILE=$(mktemp /tmp/smsgw.out.XXXXXX) With this change you can see if the qmail side works as expected. I also tried this but does not create a file smsgw.out.XXXXXX This means that qmail is not working well? email can be sent to any existing account on a specific or vpopmail? thanks always for the help
If you did not get any smsgw.out.XXXXXX file (where XXXXXX was replaced with an unique code) to the /tmp directory, your setup is not working well. The e-mail should be sent to the sms account. Have you checked that there is sms account existing also in the vpopmail?
|
|
#11 Wed Aug 26, 2009 09:10, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
ok solved all .. or almost now the problem is related to the created file folder Outgoing: ls -l /var/spool/sms/outgoing/smsgw.out.cSkdhf -rw------- 1 vpopmail uucp 1139 Aug 26 10:47 /var/spool/sms/outgoing/smsgw.out.cSkdhf vpopmail that is the problem .. when run manually chown -R uucp:uucp /var/spool/sms/outgoing message is read.. ..But then I read the logs: GSM1: <- +CMS ERROR: 38 (Network out of order) GSM1: The modem answer was not OK: +CMS ERROR: 38 (Network out of order) I have the feeling that it is wrong formatting 'email .. from command line, with sendsms 3912345678 'Message Body' works fine Instead this is an example of how to send email: To: 3912345678
Message: this is an examplealways thanks
|
|
#12 Wed Aug 26, 2009 09:50, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
cicchio wrote ok solved all .. or almost
How did you fix the qmail side? Please publish your information, it might be very valuable for other users using qmail and vpopmail. And it will make my life easier when someone else has this kind of problem later... cicchio wrote now the problem is related to the created file folder Outgoing:
ls -l /var/spool/sms/outgoing/smsgw.out.cSkdhf -rw------- 1 vpopmail uucp 1139 Aug 26 10:47 /var/spool/sms/outgoing/smsgw.out.cSkdhf vpopmail that is the problem .. when run manually chown -R uucp:uucp /var/spool/sms/outgoing message is read..
The command mktemp used in the script email2sms creates a file with 600. You could add this command to the end of a script: chmod 666 $OUTFILEIt's quick-and-dirty, but should help. cicchio wrote ..But then I read the logs:
Please show the message file which was created. Also show the log using loglevel = 7. Send two messages, one from the command line and one from the email.
|
|
#13 Wed Aug 26, 2009 10:04, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
keke wrote How did you fix the qmail side? Please publish your information, it might be very valuable for other users using qmail and vpopmail. And it will make my life easier when someone else has this kind of problem later...
..I had just realized that the email should be sent to the user sms@mydomain.st .. I realized when I tried to create it and I returned the error address already in use! How stupid! keke wrote The command mktemp used in the script email2sms creates a file with 600. You could add this command to the end of a script: chmod 666 $OUTFILE
It's quick-and-dirty, but should help.
now it works just, perfect! keke wrote Please show the message file which was created. Also show the log using loglevel = 7. Send two messages, one from the command line and one from the email. Using loglevel = 7 comes back to me this error message (the same that I pasted before): 2009-08-26 11:58:40,7, GSM1: Command is sent, waiting for the answer 2009-08-26 11:58:43,7, GSM1: <- +CMS ERROR: 38 (Network out of order) 2009-08-26 11:58:43,3, GSM1: The modem answer was not OK: +CMS ERROR: 38 (Network out of order) 2009-08-26 11:58:43,5, GSM1: Waiting 10 sec. before retrying
seems not like the formatting, can it be? bye « Last edit by cicchio on Wed Aug 26, 2009 10:05, 187 months ago. »
|
|
#14 Wed Aug 26, 2009 10:10, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
cicchio wrote keke wrote Please show the message file which was created. Also show the log using loglevel = 7. Send two messages, one from the command line and one from the email. Using loglevel = 7 comes back to me this error message (the same that I pasted before): 2009-08-26 11:58:40,7, GSM1: Command is sent, waiting for the answer 2009-08-26 11:58:43,7, GSM1: <- +CMS ERROR: 38 (Network out of order) 2009-08-26 11:58:43,3, GSM1: The modem answer was not OK: +CMS ERROR: 38 (Network out of order) 2009-08-26 11:58:43,5, GSM1: Waiting 10 sec. before retrying
seems not like the formatting, can it be? bye
Still not enough information I need to see a content of the message file, and all lines from the log, starting from the line containing "I have to send...". You can use the Private tag to protect your information.
|
|
#15 Wed Aug 26, 2009 10:31, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
sorry but I can't send pvt message.. Body Message: less /var/spool/sms/checked/smsgw.out.XXXXXX Hidden private text. This is the log: Hidden private text. « Last edit by keke on Wed Aug 26, 2009 10:33, 187 months ago. »
|
|
#16 Wed Aug 26, 2009 10:42, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
So there.. Hidden private text. Hidden private text.
|
|
#17 Wed Aug 26, 2009 10:51, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
VVV wrote Quote again :
# The eMail must include the phone number in the To: field, for example: # To: "Herbert +491721234567" <sms@localhost>
You did not notify this post on friday ? You have sent an e-mail to sms@smstools.mydomain.st. The correct recipient is: "cicchio +3912345678" <sms@smstools.mydomain.st>It's not meant to include To header in the message body. This email2sms script just copies the whole e-mail message to the outgoing folder without altering it. This will work because there is a To field and it has a plus sign and a destination number in the international format.
|
|
#18 Wed Aug 26, 2009 11:15, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
I'm confused.. from what I understand the problem are the headers in the smsgw.out.XXXXX What wrong? is there some other script that cleans the files from the headers? This is the file /var/spool/sms/checked/smsgw.out.mcknPx Hidden private text. « Last edit by cicchio on Wed Aug 26, 2009 11:19, 187 months ago. »
|
|
#19 Wed Aug 26, 2009 11:39, 187 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
The recipient number for SMS is taken from the headers of the e-mail, not from the message body of the e-mail. It's the whole idea of the email2sms script. Another methods can be used, but not with this script. You can modify the script of write a new one from the scratch if you need to change the functionality. So, you have sent an e-mail to: sms@smstools.mydomain.st. This is not correct. The correct format is: "Herbert +491721234567" <sms@localhost>
Please try once again: - Open your favorite e-mail client. - There are at least two fields: To and Message. - Write this into the To field: "cicchio +3912345678" <sms@smstools.mydomain.st>- And this to the Message field: No number of a recipient here, just a text.- Send and be surprised Of course use the real GSM number and e-mail address in the To field... I assume that you are not confused anymore...
|
|
#20 Wed Aug 26, 2009 13:51, 187 months ago.
|
Member
Registered: Aug 2009
Location: Italy
Topic owner
|
embarrassed.. I didn't understand was how the script works! Now it works ..now remains to run everything. Meanwhile, thanks very much for your help and patience
|