On Sun, Apr 09, 2023 at 02:28:00PM -0700, Kevin J. McCarthy wrote:
> On Sun, Apr 09, 2023 at 08:23:55PM +0100, [email protected] wrote:
> >I'm trying to sort out why something that used to work for me no
> >longer works. I just went and tried out an older installation that
> >still runs mutt 1.10.4 and there my send-hook/my_hdr configuration
> >works. It doesn't work on my current mutt 2.1.4.
>
> Not knowingly, but a lot of the sending code has been modified in that
> period of time.
>
> >I see the documentation now says "Also note that my_hdr commands which
> >modify recipient headers, or the message's subject, don't have any
> >effect on the current message when executed from a send-hook.". Is
> >this a recent change?
>
> That applies to a my_hdr that adds a recipient header, such as To, Cc,
> Bcc. It didn't change; the documentation for the behavior was just
> added.
>
> >This appears to no longer work.
>
> It's working in my simple testing, so perhaps there is something more
> involved. Can you create a small reproducing muttrc file and a list of
> exact instructions to trigger the change in behavior?
>
OK, it's not taken as long as I feared.
If I send a message to the mutt mailing list from the old (version
1.10.1) mutt the headers I see are:-
From: Chris Green <[email protected]>
To: [email protected]
Cc:
Bcc:
Subject: test
Reply-To:
Fcc: ~/mail/Tm/sentmail
Mix: <no chain defined>
Security: None
If I send a message to mutt from version 2.1.4 of mutt I see:-
From: Chris Green <[email protected]>
To: [email protected]
Cc:
Bcc:
Subject: test
Reply-To:
Fcc: ~/mail/Tm/sentmail
Mix: <no chain defined>
Security: None
Both the above are using the following muttrc (somewhat truncated but still
rather long I'm afraid but I have made the my_hdr and send-hook
settings very simple) :-
#
#
# mutt configuration
#
#
#
# Mailboxes (where new mail can arrive), the important stuff hopefully
# arrives in ~/mail/inbox, then we check lists mail, then check other
# mailboxes in ~/mail/In. I don't think anything will ever arrive in
# /var/mail/chris, it's there just in case.
#
mailboxes /var/mail/chris ~/mail/In/inbox `echo ~/mail/Li/*` `echo
~/mail/In/*`
#
#
# Mailing lists, see ~/.mutt/filter and ~/mutt/bin/filter.py for details.
#
lists [email protected]
subscribe [email protected]
#
#
# getAliases.py gets aliases for mailing lists from the filter file
#
source ~/.mutt/bin/getAliases.py|
source ~/.mutt/aliases
#
#
# Set my_addr (user variable) for esprimo or cheddar
#
set my_addr = '[email protected]'
#
#
# alternates - addresses that are 'me'
#
alternates $my_addr [email protected]
#
#
# set default my_hdr according to which host we're on
#
send-hook . 'my_hdr From: Chris Green <$my_addr>'
#
#
# set From: address for mailing lists, not sure if it actually works on
cheddar
#
send-hook ~l 'my_hdr From: Chris Green <[email protected]>'
#
#
# I can't remember why this is necessary/useful
#
source ~/.mutt/gpg
#
#
# tell mutt not to use the .mailcap entry for application/octet-stream
#
mime_lookup application/octet-stream
#
#
# Key bindings and macros
#
bind compose \n send-message # rather than 'y'
bind index n next-unread-mailbox # replaces <search-next>
bind index N search-next # so we can still search-next
#
#
# sidebar configuration
#
macro index in <sidebar-next>
macro index io <sidebar-open>
macro index ip <sidebar-prev>
macro index it <sidebar-toggle-visible>
set sidebar_new_mail_only = yes
set sidebar_short_path = yes
set sidebar_width = 15
#
#
# Colours
#
color header blue default .
color body magenta default [_a-z\.\$A-Z0-9-]+@[a-zA-Z0-9\./\-]+
color body magenta default (http|ftp)://[_a-zA-Z0-9\./~\-]+
color quoted blue default
color signature red default
color attachment magenta default
color tree red default
color indicator white cyan
color status brightwhite cyan
color tilde blue default
color normal default default
color message green default
#
#
# Header lines to ignore
#
ignore *
unignore to from date subject cc x-mailer X-source-folder
#
#
# Replies to messages for [email protected] need to be from [email protected]
#
reply-hook '~t [email protected]' 'my_hdr From: Chris Green <[email protected]>'
#
#
# Set sort to 'threads' except for sentmail
#
folder-hook . 'set sort=threads;set hostname=""'
folder-hook sentmail set sort=date-sent
#
#
# Mutt variable settings
#
set alias_file=~/.mutt/aliases
set arrow_cursor
set assumed_charset="iso-8859-1"
# set certificate_file=~/.mutt/certificates
# set charset=utf-8
# set check_mbox_size=yes
# set display_filter=$HOME/bin/crtocrlf
set confirmappend=no
set delete=yes
set editor=~/.mutt/bin/vimutt
set fast_reply=yes
set folder=~/mail/folder # not really used
set folder_format="%N%t %-32.32f %4m %4n"
set hidden_host=yes
set mailcap_sanitize=no
set mime_forward=yes
set mime_forward_rest=yes
set index_format="%3C %Z %{%d-%b-%y} %-15.15L (%5c) %s"
set mail_check_stats=yes
set mail_check_stats_interval=10
# set mail_check_recent=no
# set mark_old=no
set mbox=~/mail # I don't think this is used really
set mbox_type=maildir
set nomove
set nomarkers
# set pager="/usr/bin/less -c"
set pipe_decode=yes
set prompt_after=no
set postponed=~/mail/Ju/postponed
set query_command="/home/chris/bin/am '%s'"
set record=~/mail/Tm/sentmail
set reply_to=ask-yes
set rfc2047_parameters=yes
set save_empty=no
set signature=~/.sig
set sleep_time=0
set sort_re=no
set spoolfile=~/mail/In/inbox
set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o?
Old:%o?%?d? De>
set status_on_top=yes
set timeout=15
set tmpdir=/tmp
set reflow_text=no
unset forward_decode
unset wait_key
--
Chris Green