LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-14-2009, 01:06 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
Is there a console gmail notifier (for crontab -e / user)?


Hello,

I am looking for a console gmail notifier
Is there already some solutions?

Best regards
 
Old 12-14-2009, 01:19 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I don't know of anything specifically for GMail, but you could use any console POP3 or IMAP tool with GMail, you just need to enable support for one (or both) protocols in the GMail settings.
 
Old 12-14-2009, 04:45 PM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
There is certainly some ways to make a backend to gmail-notifier. it has been coded in python or perl if i recall well
 
Old 12-14-2009, 04:51 PM   #4
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
You could use a desktop widget.
 
Old 12-14-2009, 09:41 PM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by worm5252 View Post
You could use a desktop widget.
I thank you, but I have not X11, so it would be console based intended.
 
Old 12-15-2009, 11:58 AM   #6
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
what about it?

Code:
#!/bin/bash
# name : checkmail.sh

# Username
echo "Eneter your gmail username: "
read login

# Password
echo ""
echo "Enter your gmail password: "
trap "stty echo; exit" 1 2 15 # able to restore stty setting, even on "Ctrl+C"
stty -echo
read passwd
stty echo
trap "" 1 2 15

if [ "$login" == "" -o "$passwd" == "" ]
then
	echo "Error: Username or password is empty."
	exit 65
fi

inbox=`wget -T 3 -t 1 -q --secure-protocol=TLSv1 --no-check-certificate \
--user=$login --password=$passwd \
https://mail.google.com/mail/feed/atom -O - | \
sed -ne '/fullcount/s:.*>\([0-9]\+\)/dev/null`
# Notice the 'x', it is from bounce shell
# to check whether it is null string or not, but it works in bash.
if [ ! x$inbox == x'' ]
then
	if [ ! $inbox -eq 0 ]
	then
		echo “$inbox new mails in your box.”
		Xdialog --msgbox "Please check your email!" 5 40 & # You may need to install Xdialog or comment it out
	else
		echo “No new mails found!”
	fi
else
	echo “Some error occurs!”
fi
 
Old 12-15-2009, 12:01 PM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
I would propose to improve this script using an SSL encoding of hte password, interested?
 
  


Reply



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
Gmail notifier ? johnnydangerous Linux - Software 7 03-21-2007 09:56 PM
Gmail Notifier cant run lihavim Linux - Desktop 1 02-27-2007 05:16 AM
Ubuntu Gmail Notifier ndwork Linux - Software 1 01-04-2006 04:20 PM
gmail notifier help needed (newb) budlightnmyhand Linux - Software 8 11-15-2005 09:37 AM
GMail Notifier dlublink Linux - Software 1 11-10-2005 02:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:04 PM.

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
Open Source Consulting | Domain Registration