fetchmail/procmailrc filter by date

1.8k Views Asked by At

I have fetchmail grab my email from a pop account and send it to procmail. I have 'keep' set in my fetchmailrc file because i also use the email for outlook and i cant have fetchmail taking all my emails.

My problem is i want to download just todays emails or at lease since last time fetchmail ran.

right now i am trying to filter by date in the procmail file but it is not working.

I am using fedora14

contents of .procmailrc

SHELL=/bin/bash  
DATEZ="date +'%a, %d %m %Y'"  

:0
*^From.*\<(blah@blah\.com|blah2@blah2\.ca)\>
*^Content-Type:*
*^      name.*\.(xls|doc)
*$ ^Date:.*$DATEZ
{
:0fw
| uudeview -p $HOME/Inbound/Received -
:0
| $HOME/Inbound/Start.bash 2> /dev/null
}
1

There are 1 best solutions below

0
On

Well it pays to read. In the fetchmail manual it explains in detail to use the -U flag. This then only downloads the emails from when you last polled the server. so the command is:

fetchmail -k -U