I wrote a short Tcl script to send a message to my phone through that
gateway:
#!/usr/bin/tclsh8.4
package require http
package require tls
http::register https 443 ::tls::socket
set formdata [http::formatQuery trackResponses "No" Send.x "Yes"
DOMAIN_NAME "@tmomail.com" min "1234567890" require_sender "Nagios"
text "emergency" msgTermsUse "1" Send "1"]
set token [http::geturl https://wmg.tmomail.net/customer_site/jsp/messaging_lo.jsp
-query $formdata]
exit 0
The "1234567890" should be replaced by your T-Mobile phone number.
Note that I had to add the tls package to my system, and that was a
bit of an experience because I had forgotten how Tcl knew where
packages lived. The script should have more error-checking; I'll work
on improving it and will post any updates later. I had tried a Perl
script earlier in the day, but after installing numerous layers of
dependencies, I still was not able to get things to work. The Tcl
solution was relatively easy to program.
Paul Takemura
oneIgloo.com
There's an even easier way to achieve the result you describe.
While I'm all for leaving unchanged something that already
works for you, I'll mention here for others that might want
to follow up on your work that e-mail to
12345...@tmomail.net
achieves the same result.
If there's interest, I'll publish other IP-to-SMS services.
I used to used the email method (12345...@tmomail.net) but it no
longer works, at least not reliably, and at least for me. I was
surprised to read in the Wikipedia article I cited that the service
had been discontinued in August 2007. It's still possible to use the
web, so that's what motivated me to write the script.
For completeness, here's what I did to add the necessary TLS package:
1. I downloaded the file tls1.5.0-linux-x86.tar from Sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=13248
2. There are three files within the tar file:
libtls1.50.so
pkgIndex.tcl
tls.tcl
3. I copied libtls1.50.so to /usr/lib/tcl8.4 and set the permissions
to
555 owned by root:root.
4. In the directory /usr/lib/tcl8.4, I created a directory named
tls1.5
5. I copied the pkgIndex.tcl and tls.tcl files to the
/usr/lib/tcl8.4/tls1.5 directory.
That's it!
I realize that libtls1.50.so does not belong in /usr/lib/tcl8.4, but
this
setup worked without any changes to the pkgIndex.tcl file and without
running any commands. Now I need to learn more about packages. YMMV.
Paul Takemura