Re: send-hook question
On Monday, May 22, 2006 at 8:52:51 +0800, phyrster wrote:
> Could you check what's wrong here?
With pleasure. There are some bad points to review:
-1) The send-hook ~t pattern is incomplete: It will not match your
mails Cced to lists.
-2) Most patterns and regular expressions are dangerously lax, or
fuzzy, with a very high risk of false positives triggering unexpected
settings.
-3) Lack of default static settings breaks direct sending.
-4) Lack of default send-hooks breaks sending a second mail after a
match. Settings unwantedly leak to the following unrelated actions.
-5) Lack of default folder-hooks breaks sending after a visit to a
matching folder.
-6) Once activated, "my_hdr From:" overrules $reverse_name feature,
breaking its action.
-7) Lack of $from/$realname breaks bouncing.
-8) All this of course interacts, probably with more unwanted effects.
And side effects of the mixed scheme break yet more functions.
If I'm not mistaken, your mailing list traffic is properly
dispatched to individual folders. Are you always inside the given folder
when you publish to a list, or privately reply to its members? Then you
can drop the send-hook scheme to adopt the pure folder-hook scheme. It
will work better, more reliably, with all Mutt functions.
Further enhancing suggestions are:
-a) Strictest possible regexps are better.
-b) Every setting set in a hook must be reset in a default hook.
-c) "my_hdr From:" should be avoided, unless absolute necessity.
-d) Static defaults are needed for when hooks are not triggered.
All this leads to a dead necessary full config rewrite, that can be
done in more than one way. I can suggest one basic example:
| alternates ^(phyrster|mabque)@gmail\\.com$
| # alternates ^example@ # probable nonsense commented out
| alternates ^bxale@yahoo\\.com$
|
| set use_from
| set from=default@address
| set realname="phyrster"
| set reverse_name=yes
|
| folder-hook . "set from=default@address; \
| set sig_dashes; \
| reset signature"
| folder-hook \\<mutt-users-foldername$ "set from=phyrster@xxxxxxxxx; \
| unset sig_dashes; \
| set
signature='~/mail/.quote_signature|'"
| folder-hook \\<other-foldername$ "blah ..."
This should write to list and members from your subscription address
provided you're inside the list folder, elsewhere write from default
address, unless replying to a mail directed to an alternate address.
Bounce "Resend-From:" is default or subscription address, depending on
current folder. But this needs to be carefully tested, eventually
amended, and completed.
> the wiki says that active my_hdr can affect alternates.
No, my_hdr doesn't affect alternates. The wiki doesn't say that.
Wiki says that "my_hdr From:" breaks $reverse_name.
Bye! Alain.
--
Microsoft Outlook Express users concerned about readability: For much better
viewing quotes in your messages, check the little freeware program OE-QuoteFix
by Dominik Jain. It'll change your life. :-) Exists also for Outlook.
See <URL:http://home.in.tum.de/~jain/software/oe-quotefix/>.