jeremy-compostella / org-msg

OrgMsg is a GNU/Emacs global minor mode mixing up Org mode and Message mode to compose and reply to emails in a Outlook HTML friendly style.
GNU General Public License v3.0
276 stars 56 forks source link

Preserve the buffer-local value of user-mail-address #185

Closed morganwillcock closed 3 months ago

morganwillcock commented 4 months ago

When message-make-fqdn is called as part of constructing a message ID, the value of user-mail-address is likely to be used to provide the domain portion of the ID. Restore the killed value of user-mail-address after org-msg-edit-mode is activated, to ensure that message IDs show a domain that matches the sender.

The let binding seemed a safer option than marking the symbol as permanent-local. (I imagine that user-mail-address is likely to be referenced in other modes which are not related to sending mail.)

jeremy-compostella commented 3 months ago

Correct me if I am wrong but I am under the impression you are addressing a problem specific to a peculiar configuration. If so why don't you just add an advice around the org-msg-post-setup function to take care of this ?

morganwillcock commented 3 months ago

I would argue that:

  1. Restoring the value is done to honour the change which was already made to the buffer by the mail program, which org-msg is then undoing.
  2. The behaviour is fairly critical if you do not want to leak your default mail domain when sending as addresses from other domains.
  3. There is more value in reading the value in org-msg-post-setup as part of a configuration decision, rather than always having to write the value to prevent leaking other domain names.

I wouldn't class the problem as configuration specific because the value is currently being reverted for all configurations.

jeremy-compostella commented 3 months ago

Thank for the extra explanation, this is what I needed to fully understand your point.