bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] patches for discussion - new escapes and atime fix for c


From: Damon Harper
Subject: [bug-mailutils] patches for discussion - new escapes and atime fix for comsatd
Date: Tue, 22 Aug 2006 20:47:50 -0700
User-agent: Mutt/1.4.2.2i

hi there!

i'm currently looking into replacing some old packages on my system
with the versions in mailutils.  i started with comsatd - i love the
ability to run arbitrary programs, which is something i started
hacking into the old biff+comsat package ages ago but never got around
to finishing.

i ran into a few issues which i've attempted to fix in the attached
patch.  the patch may not be ideal and should probably a launching
point for discussion more than anything else.


1. in my setup, i have procmail notify comsat for a set of mailboxes
to which mail can be delivered, not just my main inbox.  i had hacked
biff+comsat to accept the new style protocol giving the mailbox
filename, and also modified its output to print hte mailbox name on
the terminal so i would know where to look for the new mail.

in the attached patch, i've modified the various expand_* functions to
accept the mailbox pathname and a stringified offset, so that these
can be inserted into commands as $f (folder/filename) and $o (offset)
respectively.  This way i can use $f in my .biffrc to show which
mailbox the new mail has arrived in.  $o might be useful for an exec'd
program that wants to examine the mailbox file directly.

i'm not sure if there was a more efficient way to do this than to pass
these two strings down the chain of functions (can they already be
gleaned from the mu_message_t object somehow?) so if there's a better
way, feel free to let me know and i'll modify this.


2. i use mutt to read mail, and mutt indicates that a folder has new
mail based on its access time being earlier than its modification
time.  the old biff+comsat in.comsat seemed to preserve this, but as
soon as i switched to the mailutils comsatd, i stopped seeing new mail
in folders that comsatd was accessing.

to work around this, the patch stats the mailbox file before the first
mu_mailbox_create call, then uses utime(2) to restore the access and
modification times after it finishes doing its thing.  i suppose this
might not be ideal (maybe better to save/restore the times while the
mailbox is locked, to prevent resetting *after* newer mail has come
in?) but it was a quick way to fix this and seems to work fine for
practical purposes.


3. (not included in the patch) - should a standard biff(1) command be
included in the mailutils package?  i'm currently using the one from
biff+comsatd, which i still find useful in some situations.  it lets
me quickly turn off the notifications in a particular terminal if i
don't want comsat messing up my screen there.  i notice that comsat
already includes logic to look for the first WRITABLE tty, skipping
over any that are not writable, so it seems to me it would still be
useful to include a biff(1) in the package?


thanks!

-damon

Attachment: mailutils-1.0-comsatd-escapes+times-0.1.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]