folder-hook in my .muttrc doesn't work
Hello everybody, it's the first time I'm posting a question here though I used to be a mutt user for a longer time. As OS I'm using debian, 2.6.24-1-686; my Mutt works in mbox_type=Maildir mode and in conjunction with fetchmail, procmail and postfix. Up to now I used a .muttrc-file which I found on the internet and it worked rather fine. Now I'd like to intend to have some changes and try the configuration command folder-hook as follows: folder-hook +fanciulla/lisa 'set use_from=no' folder-hook +fanciulla/lisa 'unmy_hdr *' folder-hook +fanciulla/lisa 'my_hdr From: [EMAIL PROTECTED]' folder-hook +fanciulla/lisa 'my_hdr To: [EMAIL PROTECTED]' folder-hook +fanciulla/lisa 'my_hdr Fcc: =fanciulla/lisa' folder-hook +fanciulla/lisa 'my_hdr Reply-To: [EMAIL PROTECTED]' Hopelessly, it doesn't work. if I answer to an e-mail in this folder, I still allways have to correct some of the header fields. Though I set and unset a lot of other parameters of which I thought they could have an impact to folder-hook, mutt doesn't honor any of the desired parameters. The only command with a certain influence to the folder-hook command with respect to the from: header field I found in the manual is the use_from command: When set, Mutt will generate the `From:' header field when sending messages. If unset, no `From:' header field will be generated unless the user explicitly sets one using the ``my_hdr'' command. Where could be my mistake? Which command prevents mutt from taking over the desired parameters? Rudolf PS.: Here my Mutt's capabilities: --- [EMAIL PROTECTED]:~$ mutt -v Mutt 1.5.18 (2008-05-17) Copyright (C) 1996-2008 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: Linux 2.6.24-1-686 (i686) ncurses: ncurses 5.6.20080503 (compiled with 5.6) libidn: 1.8 (compiled with 1.8) hcache backend: GDBM version 1.8.3. 10/15/2002 (built Apr 24 2006 03:25:20) Einstellungen bei der Compilierung: -DOMAIN +DEBUG -HOMESPOOL +USE_SETGID +USE_DOTLOCK +DL_STANDALONE +USE_FCNTL -USE_FLOCK +USE_POP +USE_IMAP +USE_SMTP -USE_GSS -USE_SSL_OPENSSL +USE_SSL_GNUTLS +USE_SASL +HAVE_GETADDRINFO +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 -EXACT_ADDRESS -SUN_ATTACHMENT +ENABLE_NLS -LOCALES_HACK +COMPRESSED +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR +HAVE_ICONV -ICONV_NONTRANS +HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE -ISPELL SENDMAIL=/usr/sbin/sendmail MAILPATH=/var/mail PKGDATADIR=/usr/share/mutt SYSCONFDIR=/etc EXECSHELL=/bin/sh MIXMASTER=mixmaster Um die Entwickler zu kontaktieren, schicken Sie bitte eine Nachricht (in englisch) an [EMAIL PROTECTED]. Um einen Bug zu melden, besuchen Sie bitte http://bugs.mutt.org/. patch-1.5.13.cd.ifdef.2 patch-1.5.13.cd.purge_message.3.4 patch-1.5.13.nt+ab.xtitles.4 patch-1.5.4.vk.pgp_verbose_mime patch-1.5.6.dw.maildir-mtime.1 patch-1.5.8.hr.sensible_browser_position.3 ---
Re: folder-hook in my .muttrc doesn't work
* Kyle Wheeler ([EMAIL PROTECTED]) [080602 16:19]: Hello Kyle, On Monday, June 2 at 12:29 PM, quoth Rudolf Bahr: folder-hook +fanciulla/lisa 'set use_from=no' folder-hook +fanciulla/lisa 'unmy_hdr *' folder-hook +fanciulla/lisa 'my_hdr From: [EMAIL PROTECTED]' Those three should work fine. Sorry, they don't, in this case, at least. The From: address is still a combination of my username and PC's hostname. folder-hook +fanciulla/lisa 'my_hdr To: [EMAIL PROTECTED]' folder-hook +fanciulla/lisa 'my_hdr Fcc: =fanciulla/lisa' Those two won't do anything (well... they will, but not what you expect). First of all, every time you compose a message, mutt asks you who the recipient is. Setting a To: header ahead of time doesn't change that, so whatever To: header you had set before will get overwritten. Secondly, the Fcc: setting isn't a *header*, it's a *setting* (that mutt displays in the compose screen as if it was a header). Here's how you'd do it the right way: folder-hook +fanciulla/lisa 'set record==fanciulla/lisa' Ok, I removed the folder-hooks which can't be preset by me and are indeed unnecessary. Instead I added as you suggested: folder-hook +fanciulla/lisa 'set record==fanciulla/lisa' But Mutt gives me still back: '[EMAIL PROTECTED]' instead of '=fanciulla/lisa'. *answer* email (r), as opposed to compose new email (m)? If you're *replying* to email (r), then the recipient (To:) is set based on the message you're replying to. What exactly are you trying to achieve? I'm entering the folder 'fanciulla/lisa' in order to answer a message there by 'r' or ',a'. Keep in mind, these hooks are only triggered when you enter the folder. If you have other hooks that override them (such as send-hooks or reply-hooks or message-hooks), they will not be re-triggered until you re-enter the folder. Yes, therefore I commented all other lines which have something to do with 'lisa' or '=fanciulla/lisa'. It seems to help nothing. Any additional ideas? Kyle, many thanks for your answer with the explanations! Rudolf
Re: folder-hook in my .muttrc doesn't work
* Kyle Wheeler ([EMAIL PROTECTED]) [080602 22:19]: ... I would have done something like this: alias -group lisagroup lisa Lisa Lady [EMAIL PROTECTED] set use_from=no send-hook '%C lisagroup' 'my_hdr From: [EMAIL PROTECTED]' fcc-save-hook '%C lisagroup' +fanciulla/lisa Hello Kyle, I think it is a good advice to write an own .muttrc from scratch. I will do that around your code suggestion above. Thank you again! Rudolf