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

Re: Folder hooks not working.



On Tue, Jan 06, 2004 at 09:02:53AM +0100, Nicolas Rachinsky wrote:
> * Josef Karthauser <joe@xxxxxxxxxx> [2004-01-06 00:07 +0000]:
> > On Mon, Jan 05, 2004 at 09:48:16PM +0100, Nicolas Rachinsky wrote:
> > > * Josef Karthauser <joe@xxxxxxxxxx> [2004-01-05 13:50 +0000]:
> > > Do the other folder-hooks work (e.g. does record change as you want
> > > it)?
> > > 
> > 
> > When it works the record also changes.
> 
> And when it does not work? I want to verify that your hooks are not
> executed (and it's not macro which is failing).
> 

I haven't managed to tie it down as to when it works and when it
doesn't, but it doesn't work all the time that's for sure.

Playing with it now I think that I'm making a bit more sense of it.
Part of the problem is that I'm using MailDir format folders and of
course they sometimes have a trailing "/" character on the end,
especially if I use tab to complete the name.  The other bit is to do
with how the spool (inbox) folder is accessed.  I have a rule:

    set spoolfile="=INBOX"
    macro index \cx "$y|isync INBOX\n"

but it doesn't get re-triggered when I access '!' or '=INBOX' after
going to another folder.  Perhaps this needs to be replaced with a

    'folder-hook .* FOO'

directive so that it gets triggered on any folders that aren't
explicitly matched by other hooks.  It's a bit counter intuitive though,
I would expect that the correct behaviour "TM" should be that
folder-hook values over ride the current defaults, which are returned
after changing to a folder without a hook configured for it.

> My hooks seem to be executed always, it seems indepent from how I
> change the folder.
> 
> Can you show us all the folder-hooks (in order) which might apply?

I've attached my mutt configurations.
 
> Does it work, when you shorten your pattern to only a part of the
> folder's name?
> 
> Can you show us the output of 'mutt -v'?


    Mutt 1.5.5.1i (2003-11-05)
    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: FreeBSD 5.2-CURRENT (i386) [using slang 10409] [using libiconv 1.9]
    Compile options:
    -DOMAIN
    -DEBUG
    -HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
    -USE_FCNTL  +USE_FLOCK
    +USE_POP  +USE_IMAP  -USE_GSS  +USE_SSL  -USE_SASL  -USE_SASL2  
    +HAVE_REGCOMP  -USE_GNU_REGEX  +COMPRESSED  
    +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  
    ISPELL="/usr/local/bin/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.

    patch-1.5.x.dw.pgp-menu-traditional.2
    vvv.quote
    1.3.28.nr.threadcomplete
    vvv.initials
    rr.compressed

Joe
-- 
Josef Karthauser (joe@xxxxxxxxxx)              http://www.josef-k.net/
FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================
lists freebsd-stable members cert-advisory stable current freebsd-hubs 
freebsd-security-notifications freebsd-security freebsd-hackers freebsd-isp 
freebsd-announce freebsd-security vortex-l

folder-hook \! set record=!
mailboxes !

folder-hook . set record=+outbox

set postponed="=postponed"
set mbox="=mbox"
set mbox_type=Maildir
set spoolfile="=INBOX"
set check_new=yes
set maildir_trash

folder-hook +IN.freebsd set record=+IN.freebsd
mailboxes =INBOX
mailboxes =I
mailboxes =IN.freebsd

source /home/joe/.muttrc.mailboxes
mailboxes =junk

set allow_ansi

ignore *
unignore Cc:
unignore Date:
unignore From:
unignore Reply-To:
unignore Subject:
unignore To:
unignore X-Spammer:

# Urlview
macro index \cv |urlview\n
macro pager \cv |urlview\n    

# Refresh email
macro index \cx "$y|isync INBOX\n"

# Report spam
macro index X "| spamassassin -r"
macro index Z "| spamassassin -d"

# Hot keys
macro index \cn l~N\n
macro index \cu l~F\n
macro index \ca lall\n

set print_cmd='fold -w 79 | lpr -h -Plp'
set edit_hdrs
set abort_unmodified=no
set autoedit
set nomark_old
set editor=vim
set suspend=no
#set sort_aux=subject
folder-hook .* 'my_hdr From: Josef Karthauser <joe@xxxxxxxxxx>'
folder-hook =IN.freebsd.* 'my_hdr From: Josef Karthauser <joe@xxxxxxxxxxx>'
folder-hook =IN.littoralis.* 'my_hdr From: Josef Karthauser 
<jkarthauser@xxxxxxxxxxxxxx>'
folder-hook =IN.lists.vortex 'my_hdr From: Josef Karthauser <joe@xxxxxxxxxx>'
#my_hdr X-NCC-RegID: uk.pavilion
#my_hdr Organisation: Pavilion Internet plc, Lees House, 21-23 Dyke Road, 
Brighton, England
#my_hdr Phone: +44-845-333-5000
#my_hdr Fax: +44-845-333-5001
#my_hdr Mobile: +44-403-596893


color index black red '~h usb'
color index black red '~b usb'

#
# Color definitions
#
##color attachment yellow black
##color body brightyellow black [_a-z\.\$A-Z0-9-]+@[a-zA-Z0-9\./\-]+
##color body yellow black (http|ftp)://[_a-zA-Z0-9\./~\-]+
##color header brightcyan black .
##color header yellow black From:
##color header yellow black Subject:
##color header yellow black To:
##color indicator black cyan
##color indicator yellow blue
##color normal default default
##color quoted green black
##color signature brightblue black
##color status yellow blue
##color tilde blue black
##color tree red black

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# color settings
#
color attachment brightmagenta yellow
color body green yellow "(ftp|http)://[^ ]+"           # point out URLs
color body green yellow [-a-z_0-9.]+@[-a-z_0-9.]+      # e-mail addresses
color error brightred yellow
color hdrdefault red yellow
color header brightred yellow ^(From|Subject):
color indicator brightyellow blue
color markers brightcyan black
color message brightcyan black
color quoted black white
color search black green        # how to hilite search patterns in the pager
color signature white blue
color status yellow blue
color underline brightgreen black


color body green black "^gpg: Good signature from"
color body brightred black "^gpg: BAD signature from"
color body brightred black "^gpg: Note: This key has expired!"
color body brightred black "^gpg: WARNING: This key is not certified with a 
trusted signature!"
color body brightred black "^gpg: Can't check signature: public key not found"
color body brightred black "^gpg: can't handle these multiple signatures"
color body brightred black "^gpg: signature verification suppressed"
color body brightred black "^gpg: invalid node with packet of type"
color body brightred black "^gpg:          There is no indication that the 
signature belongs to the owner."

#source /usr/local/share/doc/mutt/samples/gpg.rc
#set pgp_verify_command="joegpg --keyserver pgp.mit.edu --no-verbose --batch -o 
- --verify %s %f"
set pgp_verify_command="joegpg --no-verbose --batch -o - --verify %s %f"



# Remember the pass phrase for an hour.
set pgp_timeout=3600

# decode application/pgp
set pgp_decode_command="joegpg --keyserver pgp.mit.edu %?p?--passphrase-fd 0? 
--no-verbose --batch -o - %f"

# verify a pgp/mime signature
set pgp_verify_command="joegpg --keyserver pgp.mit.edu --no-verbose --batch -o 
- --verify %s %f"

# decrypt a pgp/mime attachment
set pgp_decrypt_command="joegpg --keyserver pgp.mit.edu --passphrase-fd 0 
--no-verbose --batch -o - %f"

# create a pgp/mime signed attachment
# set pgp_sign_command="joegpg --no-verbose --batch -o - --passphrase-fd 0 
--armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_sign_command="joegpg --keyserver pgp.mit.edu --no-verbose --batch -o - 
--passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"

# create a application/pgp signed (old-style) message
# set pgp_clearsign_command="joegpg --no-verbose --batch -o - --passphrase-fd 0 
--armor --textmode --clearsign %?a?-u %a? %f"
set pgp_clearsign_command="joegpg --keyserver pgp.mit.edu --no-verbose --batch 
-o - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"

# create a pgp/mime encrypted attachment
# set pgp_encrypt_only_command="pgpewrap joegpg -v --batch -o - --encrypt 
--textmode --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_only_command="pgpewrap joegpg --keyserver pgp.mit.edu -v 
--batch -o - --encrypt --textmode --armor --always-trust -- -r %r -- %f"

# create a pgp/mime encrypted and signed attachment
# set pgp_encrypt_sign_command="pgpewrap joegpg --passphrase-fd 0 -v --batch -o 
- --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
set pgp_encrypt_sign_command="pgpewrap joegpg --keyserver pgp.mit.edu 
--passphrase-fd 0 -v --batch -o - --encrypt --sign %?a?-u %a? --armor 
--always-trust -- -r %r -- %f"

# import a key into the public key ring
set pgp_import_command="joegpg --keyserver pgp.mit.edu --no-verbose --import -v 
%f"

# export a key from the public key ring
set pgp_export_command="joegpg --keyserver pgp.mit.edu --no-verbose --export 
--armor %r"

# verify a key
set pgp_verify_key_command="joegpg --keyserver pgp.mit.edu --no-verbose --batch 
--fingerprint --check-sigs %r"

# read in the public key ring
set pgp_list_pubring_command="joegpg --keyserver pgp.mit.edu --no-verbose 
--batch --with-colons --list-keys %r" 

# read in the secret key ring
set pgp_list_secring_command="joegpg --keyserver pgp.mit.edu --no-verbose 
--batch --with-colons --list-secret-keys %r" 

# receive key from keyserver:
#set pgp_getkeys_command="wrap.sh -g %r"
set pgp_getkeys_command=""

set pgp_autosign="yes"
set pgp_sign_as="0xE6B15016"

folder-hook =IN.wwbc 'set pgp_autosign="no"'
folder-hook +junk$ set record=+junk
folder-hook +junk$ 'macro index  "$y|isync junk\n"'
mailboxes +junk

folder-hook +IN.root-periodic$ set record=+IN.root-periodic
folder-hook +IN.root-periodic$ 'macro index \cx "$y|isync IN.root-periodic\n"'
mailboxes +IN.root-periodic

folder-hook +IN.pact$ set record=+IN.pact
folder-hook +IN.pact$ 'macro index  "$y|isync IN.pact\n"'
mailboxes +IN.pact

folder-hook +IN.littoralis$ set record=+IN.littoralis
folder-hook +IN.littoralis$ 'macro index  "$y|isync IN.littoralis\n"'
mailboxes +IN.littoralis

folder-hook +IN.freebsd-admins$ set record=+IN.freebsd-admins
folder-hook +IN.freebsd-admins$ 'macro index  "$y|isync IN.freebsd-admins\n"'
mailboxes +IN.freebsd-admins

folder-hook +IN.freebsd-meister$ set record=+IN.freebsd-meister
folder-hook +IN.freebsd-meister$ 'macro index  "$y|isync IN.freebsd-meister\n"'
mailboxes +IN.freebsd-meister

folder-hook +IN.offlineimap$ set record=+IN.offlineimap
folder-hook +IN.offlineimap$ 'macro index  "$y|isync IN.offlineimap\n"'
mailboxes +IN.offlineimap

folder-hook +IN.postfix$ set record=+IN.postfix
folder-hook +IN.postfix$ 'macro index  "$y|isync IN.postfix\n"'
mailboxes +IN.postfix

folder-hook +IN.aperacing$ set record=+IN.aperacing
folder-hook +IN.aperacing$ 'macro index  "$y|isync IN.aperacing\n"'
mailboxes +IN.aperacing

folder-hook +IN.headcase$ set record=+IN.headcase
folder-hook +IN.headcase$ 'macro index  "$y|isync IN.headcase\n"'
mailboxes +IN.headcase

folder-hook +IN.ostberger$ set record=+IN.ostberger
folder-hook +IN.ostberger$ 'macro index  "$y|isync IN.ostberger\n"'
mailboxes +IN.ostberger

folder-hook +IN.ostberger-commits$ set record=+IN.ostberger-commits
folder-hook +IN.ostberger-commits$ 'macro index  "$y|isync 
IN.ostberger-commits\n"'
mailboxes +IN.ostberger-commits

folder-hook +IN.freebsd-uk$ set record=+IN.freebsd-uk
folder-hook +IN.freebsd-uk$ 'macro index  "$y|isync IN.freebsd-uk\n"'
mailboxes +IN.freebsd-uk

folder-hook +IN.opensrs$ set record=+IN.opensrs
folder-hook +IN.opensrs$ 'macro index  "$y|isync IN.opensrs\n"'
mailboxes +IN.opensrs

folder-hook +IN.docbook$ set record=+IN.docbook
folder-hook +IN.docbook$ 'macro index  "$y|isync IN.docbook\n"'
mailboxes +IN.docbook

folder-hook +IN.docbook-apps$ set record=+IN.docbook-apps
folder-hook +IN.docbook-apps$ 'macro index  "$y|isync IN.docbook-apps\n"'
mailboxes +IN.docbook-apps

folder-hook +IN.coldsync$ set record=+IN.coldsync
folder-hook +IN.coldsync$ 'macro index  "$y|isync IN.coldsync\n"'
mailboxes +IN.coldsync

folder-hook +IN.wwbc$ set record=+IN.wwbc
folder-hook +IN.wwbc$ 'macro index  "$y|isync IN.wwbc\n"'
mailboxes +IN.wwbc

folder-hook +IN.freebsd-performance$ set record=+IN.freebsd-performance
folder-hook +IN.freebsd-performance$ 'macro index  "$y|isync 
IN.freebsd-performance\n"'
mailboxes +IN.freebsd-performance

folder-hook +IN.bsd-usb$ set record=+IN.bsd-usb
folder-hook +IN.bsd-usb$ 'macro index  "$y|isync IN.bsd-usb\n"'
mailboxes +IN.bsd-usb

folder-hook +IN.freebsd-security$ set record=+IN.freebsd-security
folder-hook +IN.freebsd-security$ 'macro index  "$y|isync 
IN.freebsd-security\n"'
mailboxes +IN.freebsd-security

folder-hook +IN.freebsd-small$ set record=+IN.freebsd-small
folder-hook +IN.freebsd-small$ 'macro index  "$y|isync IN.freebsd-small\n"'
mailboxes +IN.freebsd-small

folder-hook +IN.freebsd-arch$ set record=+IN.freebsd-arch
folder-hook +IN.freebsd-arch$ 'macro index  "$y|isync IN.freebsd-arch\n"'
mailboxes +IN.freebsd-arch

folder-hook +IN.freebsd-fs$ set record=+IN.freebsd-fs
folder-hook +IN.freebsd-fs$ 'macro index  "$y|isync IN.freebsd-fs\n"'
mailboxes +IN.freebsd-fs

folder-hook +IN.freebsd-emulation$ set record=+IN.freebsd-emulation
folder-hook +IN.freebsd-emulation$ 'macro index  "$y|isync 
IN.freebsd-emulation\n"'
mailboxes +IN.freebsd-emulation

folder-hook +IN.freebsd-current$ set record=+IN.freebsd-current
folder-hook +IN.freebsd-current$ 'macro index  "$y|isync IN.freebsd-current\n"'
mailboxes +IN.freebsd-current

folder-hook +IN.freebsd-stable$ set record=+IN.freebsd-stable
folder-hook +IN.freebsd-stable$ 'macro index  "$y|isync IN.freebsd-stable\n"'
mailboxes +IN.freebsd-stable

folder-hook +IN.freebsd-audit$ set record=+IN.freebsd-audit
folder-hook +IN.freebsd-audit$ 'macro index  "$y|isync IN.freebsd-audit\n"'
mailboxes +IN.freebsd-audit

folder-hook +IN.freebsd-net$ set record=+IN.freebsd-net
folder-hook +IN.freebsd-net$ 'macro index  "$y|isync IN.freebsd-net\n"'
mailboxes +IN.freebsd-net

folder-hook +IN.freebsd-hackers$ set record=+IN.freebsd-hackers
folder-hook +IN.freebsd-hackers$ 'macro index  "$y|isync IN.freebsd-hackers\n"'
mailboxes +IN.freebsd-hackers

folder-hook +IN.freebsd-binup$ set record=+IN.freebsd-binup
folder-hook +IN.freebsd-binup$ 'macro index  "$y|isync IN.freebsd-binup\n"'
mailboxes +IN.freebsd-binup

folder-hook +IN.freebsd-qa$ set record=+IN.freebsd-qa
folder-hook +IN.freebsd-qa$ 'macro index  "$y|isync IN.freebsd-qa\n"'
mailboxes +IN.freebsd-qa

folder-hook +IN.freebsd-cvs-doc$ set record=+IN.freebsd-cvs-doc
folder-hook +IN.freebsd-cvs-doc$ 'macro index  "$y|isync IN.freebsd-cvs-doc\n"'
mailboxes +IN.freebsd-cvs-doc

folder-hook +IN.freebsd-cvs-ports$ set record=+IN.freebsd-cvs-ports
folder-hook +IN.freebsd-cvs-ports$ 'macro index  "$y|isync 
IN.freebsd-cvs-ports\n"'
mailboxes +IN.freebsd-cvs-ports

folder-hook +IN.freebsd-cvs-projects$ set record=+IN.freebsd-cvs-projects
folder-hook +IN.freebsd-cvs-projects$ 'macro index  "$y|isync 
IN.freebsd-cvs-projects\n"'
mailboxes +IN.freebsd-cvs-projects

folder-hook +IN.freebsd-cvs-www$ set record=+IN.freebsd-cvs-www
folder-hook +IN.freebsd-cvs-www$ 'macro index  "$y|isync IN.freebsd-cvs-www\n"'
mailboxes +IN.freebsd-cvs-www

folder-hook +IN.freebsd-cvs$ set record=+IN.freebsd-cvs
folder-hook +IN.freebsd-cvs$ 'macro index  "$y|isync IN.freebsd-cvs\n"'
mailboxes +IN.freebsd-cvs

folder-hook +IN.freebsd-developers$ set record=+IN.freebsd-developers
folder-hook +IN.freebsd-developers$ 'macro index  "$y|isync 
IN.freebsd-developers\n"'
mailboxes +IN.freebsd-developers

folder-hook +IN.netbsd-src$ set record=+IN.netbsd-src
folder-hook +IN.netbsd-src$ 'macro index  "$y|isync IN.netbsd-src\n"'
mailboxes +IN.netbsd-src

folder-hook +IN.freebsd-perforce$ set record=+IN.freebsd-perforce
folder-hook +IN.freebsd-perforce$ 'macro index  "$y|isync 
IN.freebsd-perforce\n"'
mailboxes +IN.freebsd-perforce

folder-hook +IN.eug$ set record=+IN.eug
folder-hook +IN.eug$ 'macro index  "$y|isync IN.eug\n"'
mailboxes +IN.eug

folder-hook +IN.storm-committers$ set record=+IN.storm-committers
folder-hook +IN.storm-committers$ 'macro index  "$y|isync 
IN.storm-committers\n"'
mailboxes +IN.storm-committers

folder-hook +IN.bsdconeurope$ set record=+IN.bsdconeurope
folder-hook +IN.bsdconeurope$ 'macro index  "$y|isync IN.bsdconeurope\n"'
mailboxes +IN.bsdconeurope

folder-hook +IN.openpackages$ set record=+IN.openpackages
folder-hook +IN.openpackages$ 'macro index  "$y|isync IN.openpackages\n"'
mailboxes +IN.openpackages

folder-hook +IN.freebsd-acpi$ set record=+IN.freebsd-acpi
folder-hook +IN.freebsd-acpi$ 'macro index  "$y|isync IN.freebsd-acpi\n"'
mailboxes +IN.freebsd-acpi

folder-hook +IN.freebsd-hubs$ set record=+IN.freebsd-hubs
folder-hook +IN.freebsd-hubs$ 'macro index  "$y|isync IN.freebsd-hubs\n"'
mailboxes +IN.freebsd-hubs

folder-hook +IN.freebsd-bugs$ set record=+IN.freebsd-bugs
folder-hook +IN.freebsd-bugs$ 'macro index  "$y|isync IN.freebsd-bugs\n"'
mailboxes +IN.freebsd-bugs

folder-hook +IN.freshports-develop$ set record=+IN.freshports-develop
folder-hook +IN.freshports-develop$ 'macro index  "$y|isync 
IN.freshports-develop\n"'
mailboxes +IN.freshports-develop

folder-hook +IN.freebsd$ set record=+IN.freebsd
folder-hook +IN.freebsd$ 'macro index  "$y|isync IN.freebsd\n"'
mailboxes +IN.freebsd

folder-hook +IN.ietf$ set record=+IN.ietf
folder-hook +IN.ietf$ 'macro index  "$y|isync IN.ietf\n"'
mailboxes +IN.ietf

folder-hook +IN.vortex-l$ set record=+IN.vortex-l
folder-hook +IN.vortex-l$ 'macro index  "$y|isync IN.vortex-l\n"'
mailboxes +IN.vortex-l

Attachment: pgpzo09G38rgJ.pgp
Description: PGP signature