1. create ~/.fetchmailrc with this configurations:
poll mail.someserver.ca
proto IMAP
user "your_username"
pass "your_password"
2. have this perl script in your ~/bin/ directory:
#!/usr/bin/perl
$_ = `fetchmail -c`;
s/(.*\)).*/$1/;
print;name it get_mail (chmod +x get_mail)
3. add this line into your crontab (scheduled for every 5 minutes):
*/5 * * * * ~/bin/get_mail > ~/bin/get_mail.out
4. edit your ~/.screenrc file to contain 2 lines like this:
caption always "%{+b bk}$USER@%{wk}%H | %{yk}(load: %l |%{rk} cpu: %1` | %{Gk}net: %2` | %{mk}mail: %3`) %-21=%{wk}%D %d.%m.%Y %0c"
backtick 3 150 150 cat /home/your_username/bin/get_mail.outthe important part is: "%{mk}mail: %3`". The 150 means 150 seconds.
With this, you will see the number of new emails in your screen status bar (within 5 minutes interval at most).
0 comments:
Post a Comment