Posts Tagged ‘email’

How to Find All Unread Messages in Gmail

Friday, January 8th, 2010

To view all (and only) unread messages in your Gmail account:

– Type “label:unread” (not including the quotation marks) in the Gmail search field.
– Click Search Mail.

If you do this search repeatedly or generally appreciate brevity, you can use “l:unread” or even “l:^u” instead of “label:unread”.

Of course, you can combine the quest for unread messages with others:

– “l:^u from:tim” finds all unread messages from “tim”,
– “l:^u l:^t” finds all unread starred mail, and
– “l:^u l:^k subject:hi” finds all unread messages with “hi” in the subject that are in the Trash.

Fax to Email to folder in Linux

Wednesday, November 18th, 2009

Needed to move away from the single fax machine and find a better solution for receiving and processing faxes. Decided to move over to fax to email service and automating the extraction of fax images from the emails.
Tested on Centos, but should work on any Linux distro with a little tweaking.
You must have fetchmail and uudeview installed. use yum to install these.
*Recent updates of Centos warn you not to run fetchmail as root. You could either ignore this or run fetchmail as a non root user.

1. Signup for a faxtoemail service i.e www.efax.com and set the faxes to be forwarded to an email address eg fax@pratheesh.com as tif attachment.
2.
Create a local user on Centos to retrieve the emails. lets suppose the user created is ‘fax’
3.
Configure fetchmail to retrieve emails for this user
create file /root/.fetchmailrc with the following content
poll pratheesh.com protocol POP3 user fax password yourpassword is fax

4.
Change permission for the created file
chmod 0710 /root/.fetchmailrc
5.
create a script to fetch the emails and extract the attachment. create file /home/fax/retrievefax.sh with following content

FAXUSERFILE=/var/spool/mail/fax
FAXFOLDER=/home/fax/somefolder
#pop the mails from faxuser account frm mailserver
/usr/bin/fetchmail -a -v >> /var/log/fetchmail 2>&1
#run uudeview to strip attachment

/usr/bin/uudeview -i +a +o -q -p $TOSPLITFOLDER   $FAXUSERFILE
#clear the mailfile
cp /dev/null $FAXUSERFILE

6.
Save the file and make it executable
chmod ugo+x /home/fax/retrievefax.sh
7.
try sending a fax to your efax number and then run the script after a few minutes
sh /home/fax/retrievefax.sh

you can automate the execution by adding it as a cron job.

explanation of commands
in uudeview
-i suppresses interactivity
+a makes it append _1 instead of overwriting already existing file
+o stops overwriting
-q suppresses output messages ( so that cron does not send u mails)
-p to specify path where the decoded attachments should be sent
references:
http://home.arcor.de/karlheinz.langguth/linuxsmalloffice/mail.html
http://linuxgazette.net/issue58/nielsen2.html