Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle forwarded messages #11

Closed
titaniumbones opened this issue Sep 3, 2019 · 4 comments
Closed

handle forwarded messages #11

titaniumbones opened this issue Sep 3, 2019 · 4 comments

Comments

@titaniumbones
Copy link
Contributor

titaniumbones commented Sep 3, 2019

last in a whole bunch of reports (sorry!). I'm pretty sure that org-msg chokes on forwarded messages, because of this line:

	     (temp-files (org-msg-get-prop "reply-to"))

which forwarded messages do not contain. Maybe there's a way to use References in an analogous way? Though that does seem somewhat more complex.

@jeremy-compostella
Copy link
Owner

When I want to forward, I just reply and change the recipient list.
Would that work for your mu4e based use-case ?

@titaniumbones
Copy link
Contributor Author

Yes, I think that would work, though in the long run it would be nice to have something more robust, I guess.

@guibor
Copy link

guibor commented Nov 25, 2019

My solution - rewrite org-msg-post-setup so that it includes the reply-to, and make sure the reply-to appears in the message even when forwarding - by changing mu4e~draft-forward-construct accordingly in mu4e-draft.el (though adding advice would have been a better solution)


(defun org-msg-post-setup (&rest _args)
  "Transform the current `message' buffer into a OrgMsg buffer.
If the current `message' buffer is a reply, the
`org-msg-separator' string is inserted at the end of the editing
area."
  (message-goto-body)
  (let ((new (not (and (message-fetch-field "to")
                       (message-fetch-field "subject"))))
        (with-original (not (= (point) (point-max))))
        (reply-to))
    (when (or new (org-msg-mua-call 'article-htmlp))
      (setq reply-to (org-msg-mua-call 'save-article-for-reply))
      (insert (org-msg-header reply-to))
      (when org-msg-greeting-fmt
        (insert (format org-msg-greeting-fmt
                        (if new
                            ""
                          (org-msg-get-to-first-name)))))
      (save-excursion
        (when with-original
          (save-excursion
            (insert "\n\n" org-msg-separator "\n")
            (delete-region (line-beginning-position)
                           (1+ (line-end-position)))
            (save-excursion
              (while (re-search-forward "^>+ *" nil t)
                (replace-match "")))
            (org-escape-code-in-region (point) (point-max))))
        (when org-msg-signature
          (insert org-msg-signature))
        (org-msg-edit-mode)))
    (if new
        (message-goto-to)
      (org-msg-goto-body))))

jeremy-compostella added a commit that referenced this issue Nov 29, 2019
Mail forwarding is not an easy feature to implement as it requires to
modify the Mail User Agent.  Also this is not a common use-case in my
workflow and it is low priority.

Michael-David Fiszer made some suggestion in Issue #11.  This patch is
the port of this suggestion.

Signed-off-by: Michael-David Fiszer
Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
@jeremy-compostella
Copy link
Owner

Hi Michael-David,

I tried to take your suggestion of org-msg-post-setup() into account with Add limited support for mail forwarding. Let me know if it helps in your case.

Regards,

-Jeremy
One Emacs to rule them all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants