procmail
[Top] [All Lists]

Re: Mail notification not working

2001-06-14 22:44:25
Just a little feedback on this.  Dont know if this happens to your or not,
but on my system, it would always tell me I have new mail when I log on,
even though I didn't because the access time on /var/spool/mail/chris was
the same as the modification time.

I changed the line in my .procmailrc to this:

TRAP='test -s $ORGMAIL && touch -m $ORGMAIL || echo >> $ORGMAIL'
                                ^^^
                                
Then I added this line to my .bash_profile to update the access time only:

touch -a /var/spool/mail/chris

Now fingerd and bash reports new mail when I have new mail, but the access
time on my spoolfile gets updated so bash dosen't think I have new mail all
the time when in fact I dont.

I think thats what I'm trying to say.  Anyway, it works like I want it to :)

Thanks again.


On Wed, Jun 13, 2001 at 03:15:08PM -0500, "David W. Tamkin" 
<dattier(_at_)ripco(_dot_)com> wrote:

I'm wondering if this will do it (assuming $SHELL is set to /bin/sh or some-
thing compatible); it seems to work here:

 # apostrophes, not backticks
 TRAP='test -s $ORGMAIL && touch $ORGMAIL || echo >> $ORGMAIL'

In other words, if the spool is non-empty, update its modification time;
if the spool is empty (of if the touch command didn't work), append a
newline to it.  That will make sure that whenever you receive mail your spool
file is non-empty (just a newline in it, not any mail) and freshly marked as
modified.

If your fingerd reports unread mail if the spool is empty but freshly
touched, you can do this:

 TRAP='touch $ORGMAIL' # setting of $SHELL won't matter

Attachment: pgpPzwNvuUSPl.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>