`reverse_realname=yes` is ignored if message replied to has no name in `To:` field

Configuration:

  • reverse_name=yes
  • reverse_realname=yes
  • No send or reply hooks are used, i.e. settings which might affect generation of From: field are not changed.
  • mutt version 1.12.0

How to reproduce:

  • Select a message to reply to. The name in its To: field must be empty, i.e the field must only contain an email address.
  • Reply to the message.
  • realname is inserted into the From: field of the reply. Expected behaviour is an empty name, i.e. the empty name of the To: field of the message replied to should be reused.

A patch is attached. Note that I only checked the use case described above and additionally replying to emails which contain both a name and an address in To:. This is the first time I looked into mutt’s code. The patch might have side effects I am not aware of.

reverse_realname.patch