<<< Date Index >>>     <<< Thread Index >>>

Re: filtering messages not always recognized



On Wed, Apr 06, 2005 at 02:55:09PM +0200, Michelle Konzack 
<linux4michelle@xxxxxxxxxx> wrote:
> 
> I use:
> 
> macro index <F6>    ":set pipe_decode=no\n:set 
> editor='$HOME/bin/tdautoedit'\ne\n:set editor=/usr/bin/mcedit\n:set 
> pipe_decode=yes\n"
>
> Am 2005-04-06 03:11:56, schrieb Eugene:
> > The problem I've run into is that if the external program does its job
> > too quickly, Mutt does not recognize that the original email has been
> > modified and so does not save the modified email in the current mailbox.
> 
> Then there is a problem with your script, because in my case:
> 
> 1)  :set pipe_decode=no
> 2)  :set editor='$HOME/bin/tdautoedit'
> 3)  e
> 4)  :set editor=/usr/bin/mcedit
> 5)  :set pipe_decode=no
> 
> If 3) is executet, then mutt do
> 
>         exec $HOME/bin/tdautoedit $1
> 
> and if you edit the file $1 the you must save it to the same file.

I do this as well.  I have a similar macro:

        macro pager \eA ":set editor='~/bin/appendmessage<return><edit>:set 
editor='/usr/local/bin/vim'<return>" 'Attach Message-ID'

Fundamentally, it does the same thing as your case (steps #2,
#3, #4), except that it does not set pipe_decode (steps #1, #5)
because I use the default boolean value of "no" at all times.

> > I've had to insert a 1-second delay into the external program to fool
> > Mutt into accepting the modified email.  Is there anything I can do to
> > remove this delay?
> 
> Never I have used a delay, even the editing is under 0.5 seconds.
> There is no problem with mutt, but with your script.

I don't agree, because the problem does not always happen.  The
problem tends to occur when the delay is short.  And the problem
tends to go away when the delay is longer (around 1 sec. for me).

> And for editing headers, i use formail inside my script.
> Nothing manuell... 

I use formail as well.  Here's the script for ~/bin/appendmessage:

============================== snip here ==============================

#!/bin/sh

mesg_file="/tmp/message-id"
mesg_id=`cat $mesg_file`
tmp_file="/tmp/mutt_$$_$PPID.tmp"
formail -A "$mesg_id" < $1 > $tmp_file
mv $tmp_file $1
sleep 1

============================== snip here ==============================

Anyways, thanks for your response Michelle.  If you have any
other suggestions, I'm willing to try them.  Oh, and I forgot
the usual debugging stuff:

---===---===---===---===---=== snip here ===---===---===---===---===---

Mutt 1.5.9i (2005-03-13)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Darwin 7.8.0 (Power Macintosh) [using ncurses 5.2] [using libiconv 1.9]
Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK   -USE_INODESORT   
-USE_POP  -USE_IMAP  -USE_GSS  -USE_SSL  -USE_GNUTLS  -USE_SASL  -USE_SASL2  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  
-BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  
+HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  -HAVE_LIBIDN  +HAVE_GETSID  -HAVE_GETADDRINFO  
-USE_HCACHE  
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/local/share/mutt"
SYSCONFDIR="/usr/local/etc"
EXECSHELL="/bin/sh"
-MIXMASTER
To contact the developers, please mail to <mutt-dev@xxxxxxxx>.
To report a bug, please use the flea(1) utility.

---===---===---===---===---=== snip here ===---===---===---===---===---