SMS2Email step by step

Hello everyone, I have installed playsms + gammu on a chromebox with debian 10 everything works fine but I can’t figure out how to configure the forwarding of sms via email what should I configure? I have configured the smtp in the config.php file inside the folder / var / www / html / playsms what else should I do?
thank you very much for helping
Roy

do you mean sms to email, or email to sms ?

both not straightforward, need some tweak and tests

anton

Hi Anton, i mean sms to email
there is a step by step tutorial/guide? (in google i’ve not found it)
on some websites i’ve read that i’ve to install sendmail or postfix is correct?

thank you very much
Roy

Yes, you need to install postfix on the same server as playSMS, and then configure postfix to relay email to your mail server.

For example, if you are using company email than the postfix must be configured to relay to your smtp server.

In playSMS you need to only edit config.php and adjust SMTP param to send email to localhost (where postfix is running).

As for postfix config, you can search manual howto config it to relay email to real smtp server.

playSMS ---> postfix localhost ---> remote smtp server (gmail, your office, etc..)

You can skip postfix localhost, and configure playSMS to submit email to remote smtp server, but usually this needs more effort to make your email not marked as spam, or to just submit it successfully.

Anton

Thank you very much anton, this evening i’ll try to install postfix.

In Playsms where i “tell the system” to forward the sms to email? (it forwards all SMSs?)

thank you
Roy

Check in user config menu, that will forward inbox message for that user to email

Anton

perfect, this option is already set to yes so this is ok…
thank you very much

Roy

Hi, i’ve configured postfix as you said and sending email from command line works well but when i receive an sms to the administrator user in playsms (is the only user for now) it does not send the email. in the email.log don’t see any trace of the attempt to send mail like if playsms is not using postfix to send mail or is not trying to send the email at all)
this is my config.php (the one in /var/www/html/playsms/ folder the part of the smtp configuration)

// SMTP configuration
$core_config[‘smtp’][‘relm’] = ‘’; // yes, not realm, it’s relm
$core_config[‘smtp’][‘user’] = ‘’;
$core_config[‘smtp’][‘pass’] = ‘’;
$core_config[‘smtp’][‘host’] = ‘localhost’;
$core_config[‘smtp’][‘port’] = ‘25’;

what can i do?

Only sms on Inbox that is forwarded to email, check if the sms is in Inbox

Anton

Hi, i configured all incoming sms to be put in administrator inbox (just for testing)


and the option to forward to email in user preferences is active
but no one is forwarded… i can’t understand… if you have any idea is super appreciated… i don’t have any idea where to put my hands (is there a log i can look at?)

seeing other posts with similar problems I realized that when a text message arrives I don’t have an entry like this in the playsms.log:

PID5f4bea6c482d5 - L3 recvsms_inbox_add # send email from:noreply@playsms.org to:sms@xxxxxxxx.xxx message:[G]
Then
sendmail # start from:noreply@playsms.org to:sms@xxxxxxxxx.xxx subject:Message from +3xxxxxxxxxxx

thank you

Roy

I think I begin to understand something:
when I send a message or log in or save settings, entries are generated in playsms.log
but when I receive sms no entry in log is generated I think there is something wrong in recvsms (however the sms are moved to the inbox )
what can I do?

Check and set logstate to 3 in config.php, restart playsmsd and test again

Make sure playsmsd has access to write to playsms.log

Anton

Hi Anton, i reinstalled playsms and now the log works…
now that the log works i see this error when it tries to send the email:

L2 sendmail # start from:sms-box@webranking.it to:sistemi@webranking.it subject:Message from +39xxxxxxxxx
PID6078d3ee19d2b - L2 sendmail # end with error:it was not specified a valid From header
PID6078d3ee19d2b - L3 recvsms_inbox_add # sent email from:sms-box@webranking.it to:sistemi@webranking.it
PID6078d3ee19d2b - L3 incoming__recvsms_intercept_after # sandbox to user end u:admin

and the second problem is that playsmsd command doesent work if i’m out of the /bin folder.

any suggestion?

I’ve worked on this problem all the weekend without any result, i tried:

  • installing another mta (msmtp, sendmail, mutt) all worked sending email from command line but not one worked with playsms emails (now i reinstalled postfix)
  • i tried many email account, with and without authentication and with and without tls same problem
    (L2 sendmail # end with error:it was not specified a valid From header)
    at this point i think is a playsms problem (maybe with debian 10 or php 7.3)

someone has nay idea?
this is my playsms log

192.168.0.25 192.168.0.35 2021-04-19 00:25:56 PID607cb1f477b2b admin L3 dev__incoming # Array (     [0] => Sender ID: 629876543210     [1] => Receiver number: 1234     [2] => Sent: 2021-04-19 00:25:44     [3] => Message: andranno le mail? col cavolo ) 
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 recvsmsd # id:49 dt:2021-04-19 00:25:44 sender:629876543210 m:andranno le mail? col cavolo receiver:1234 smsc:dev
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 recvsms_process # dt:2021-04-19 00:25:44 sender:629876543210 m:andranno le mail? col cavolo receiver:1234 smsc:dev
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 recvsms_process # unhandled datetime:2021-04-19 00:25:44 sender:629876543210 receiver:1234 message:andranno le mail? col cavolo
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 incoming__recvsms_intercept_after # sandbox to user start u:admin dt:2021-04-19 00:25:44 s:629876543210 r:1234 m:[andranno le mail? col cavolo]
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L2 recvsms_inbox_add # saving sender:629876543210 receiver:1234 target:admin reference_id:
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L2 recvsms_inbox_add # saved id:46 sender:629876543210 receiver:1234 target:admin
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 recvsms_inbox_add # send email from:sms-box@webranking.it to:sistemi@webranking.it message:[andranno le mail? col cavolo]
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L2 sendmail # start from:sms-box@webranking.it to:sistemi@webranking.it subject:Message from 629876543210
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L2 sendmail # end with error:it was not specified a valid From header
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 recvsms_inbox_add # sent email from:sms-box@webranking.it to:sistemi@webranking.it
- - 2021-04-19 00:25:57 PID607c9a5dd45b6 - L3 incoming__recvsms_intercept_after # sandbox to user end u:admin

hmm… I’m not sure what it happened, my tests cannot reproduce that error so far.

anton

Hi Anton, what configuration do you have? (OS version, php version? playsms version) I think this iussue is related to php
I have Debian 10 and php 7.3 (and gammu 1.42) and playsms (1.4.3)

Thank you very much for your support
Roy

Im using Ubuntu 20.04

I received it on my email spam folder (we can fix spam later)

Anton

i tried to upgrade to 1.4.4-b4(to verify if emails works) but after login it displays page not found and localhost (instead of the machine ip i don’t use https)

looks like its browsing https://localhost
and since you dont activate SSL thats what happened

with 1.4.4 SSL is sorta mandatory

anton

ok thank you for your answer