LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-07-2002, 08:03 AM   #1
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Rep: Reputation: 0
E-Mail notification to users via SMS (gateway script ok, but notification script?!?)


Hi all!

I have Linux on my server. And i want to make a e-mail notification eg. "You have new mail" to my users via GSM SMS. I have sms script what send via command line.

The problem is:
How i make some script what reads the mail file and send new mail notification to registered users own GSM phone???

Thanks all for help
-Riku
 
Old 03-07-2002, 11:03 AM   #2
Eternal
Member
 
Registered: Feb 2002
Location: Austria
Distribution: LFS based opon debian or course
Posts: 38

Rep: Reputation: 15
Talking Inovate, Not Creat!

This is a script that does it for you, http://freshmeat.net/projects/pop2smswebde/
On of the best stuff in linux is that you dont need to create sutch scripts / programms download one and work on it a few days to get the results your want.
 
Old 03-07-2002, 11:26 AM   #3
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Original Poster
Rep: Reputation: 0
:)

Thanks.

But the problem is, that script does not work on my sms operador...
 
Old 03-07-2002, 11:34 AM   #4
Eternal
Member
 
Registered: Feb 2002
Location: Austria
Distribution: LFS based opon debian or course
Posts: 38

Rep: Reputation: 15
Dam but are there any web based site that offer *free* sms services? in france, austria... you can go onto sms.fr (whatever) and enter the telephone number ans the message and click send. If you look at the html code, ull see

form action="send.sms.php" method="POST"..
input type="num" name="number...."
input type="title" name="title..." etc..

then just call lynx as http://www.host.com/send.sms.php?num...YouHaveNewMail etc if not im not too shure what to do ;( maybe use an sms deamon but i really have no clue what they do ;D
 
Old 03-07-2002, 11:41 AM   #5
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Original Poster
Rep: Reputation: 0
...

ok. i see what do you mean.

I have on my site http://titanix.d2g.com the sms send. and that works to a finnish operador
i only put to the script the intranet ip addres i going to try if work..
 
Old 03-08-2002, 07:04 AM   #6
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Original Poster
Rep: Reputation: 0
GREP problem

yes
now is work via my server.
I haved to modify the script.

But this script is no good

perhaps the best solution is:

the file /var/log/maillog

tail -f to the file and take (grep?!?) the <to=USER@myserver.com> and send via that to the USER the SMS.
off course i have to make to the website a script, who wants the sms notification

the problem is how i grep? i only want the part of begin @myserver.com>.....

i havet tried a lot of, but i feel that, grep does take a part of line?!?
 
Old 03-08-2002, 07:23 AM   #7
Eternal
Member
 
Registered: Feb 2002
Location: Austria
Distribution: LFS based opon debian or course
Posts: 38

Rep: Reputation: 15
Talking in PHP? ;D

#!/usr/local/bin/php -q
#
# An eleet Script By oliver (pH)
# littlescrip.php email
#
<?

$RAW__EMAIL = $argv[1];
print("Hello, i am going to explode his email .\n");
$STAR__EMAIL = explode("@", '$RAW__EMAIL');
print("Ok, I have done it, and its $STAR__EMAIL.\n"

?>

You could make it in BASH as you wish but if your wanting to make it web based, PHP sounded better. ITs very simple. You could add what you want in it... Just ask
 
Old 03-08-2002, 07:37 AM   #8
Eternal
Member
 
Registered: Feb 2002
Location: Austria
Distribution: LFS based opon debian or course
Posts: 38

Rep: Reputation: 15
Im bord ;(

<?php

# CREATE TABLE registered (name varchar(250), mail varchar(250));
#

if (!isset($mode))
{

echo <<< __ENDOFREGISTRATION__
<form action="$PHP_SELF?mode=register" mothode="post">
Enter Your Name <input type="text" name="name">
Enter Your E-Mail <input type="text" name="mail">

__ENDOFREGISTRATION__;

}

if ($mode == "register")
{
mysql_connet("$M_HOST","M_USER","M_PASS");
mysql_select_db("$M_DB");
mysql_query("INSERT INTO registered (name,mail) VALUES ('$name','$mail')"):

if (mysql_error() == "") { echo "You are Registerd"; }

}
/* Thats For the simple registration */

?>

then it talk for itself, fdopen, system, mail, and your done. (And my boss just got in i must run (; )
 
Old 03-08-2002, 09:53 AM   #9
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Original Poster
Rep: Reputation: 0
?????

Im not undestand php language...

But i mean when to the /var/log/maillog comes new entry it sends to user sms message. (start the sending script)
 
Old 03-08-2002, 10:33 AM   #10
Eternal
Member
 
Registered: Feb 2002
Location: Austria
Distribution: LFS based opon debian or course
Posts: 38

Rep: Reputation: 15
Angry BAD!

Well, isnt linux an oputunity to learn more? If you would know php it would be done in a few minuts.

Ok let get this sorted out now.

Get this programm or any others, seach on http://www.gooogle.com/linux and http://freshmeat.net
Or get this one http://freshmeat.net/projects/pop2smswebde/

Rip it up, Find out how it checks for the mail, find out how and where it sends the sms and just change that function to your web based one, i really think php will do the job because you would need a sript that runs localy and another one calling the site and php does that. Its not only a Great powerfull web based language but also an exelent shell ;D

But im promoting PHP as alwas just continu as you feel everything is possible.
 
Old 03-08-2002, 11:16 AM   #11
Riku2015
LQ Newbie
 
Registered: Mar 2002
Location: Finland
Posts: 7

Original Poster
Rep: Reputation: 0
:)

i have alredy findet out how pop2smswebde it works
i have ripped to work on my server..

The works via pop account and sends SMS via (method POST) WWW (i have changet to my server ( http://titanix.d2g.com/sms.shtml etc.. )

That was easy to get work, but i only want a script to run on linux shell as root or noboy using sh or bash, to spy when users get a mail, then send sms to user mobile phone.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Email Notification - Perl Script jamesyreid Programming 3 07-21-2009 08:56 AM
Mail notification Maverick1182 Linux - Software 0 08-29-2004 06:45 AM
new mail notification with qmail cantrell Slackware 2 11-12-2003 08:42 AM
mozilla-mail notification ? DigitalTygrrr Linux - Software 3 09-04-2003 12:51 PM
E-Mail notification to users via SMS Riku2015 Linux - General 0 03-06-2002 03:21 PM


All times are GMT -5. The time now is 10:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration