On Sat, 07 Feb 2009, Josef Atmin wrote:
> After having discovered macros I came up with the following solution for
> moving mail from /var/mail/jatmin to ~/INBOX.
>
> macro index,pager G "\
> <enter-command>unset wait_key<enter>\
> <shell-escape>\
> if [[ -s /var/mail/$USER ]]; then\
> cat /var/mail/$USER >> ~/INBOX;\
> echo -n > /var/mail/$USER;\
> fi<return>\
> <enter-command>set wait_key<enter>\
> <fetch-mail>" "fetch local and pop3 mail"
>
> This seems to do what I want. It is a hack, and I am not quite sure
> whether it is safe (therefore my version within the if-statement looks
> like
>
> cp /var/mail/$USER ~/=var=mail=$USER-backup;\
> cp ~/INBOX ~/INBOX-backup;\
> cat /var/mail/$USER >> ~/INBOX;\
> echo -n > /var/mail/$USER;\
> echo There has been local e-Mail!;\
> sleep 2;\
Did you forget to file lock mail/$USER on entry of script?
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩312 王維 渭城曲
渭城朝雨浥輕塵 客舍青青柳色新 勸君更盡一杯酒 西出陽關無故人