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

Interaction with signed messages? #24

Open
ndw opened this issue Dec 29, 2019 · 11 comments
Open

Interaction with signed messages? #24

ndw opened this issue Dec 29, 2019 · 11 comments

Comments

@ndw
Copy link

@ndw ndw commented Dec 29, 2019

Hi,

I use gnus so I thought I'd give org-msg a try. It took a little time to sort out some weird incompatibility in bbdb, but I got there. I composed a test message and sent it to myself.
All well and good...except: whereas gnus usually signs my messages with pgp, with org-msg, I get this line literally at the top of my HTMLified mail:

<#secure method=pgpmime mode=sign>

Is this a bug, a limitation, or user error on my part?

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 13, 2020

Hi Norman Walsh,

Sorry for the delay.

It took a little time to sort out some weird incompatibility in bbdb, but I got there

Could you share some details ? Perhaps some improvement in org-msg could help.

All well and good...except: whereas gnus usually signs my messages with pgp, with org-msg, I get this line literally at the top of my HTMLified mail:...

Do you mind sharing you gnus configuration so that I can experiment ?

Regards,
Jeremy

@ndw

This comment has been minimized.

Copy link
Author

@ndw ndw commented Jan 15, 2020

Alas, I cannot reproduce the bbdb issue. I fixed it by adding org-msg-edit-mode for gnus:

(defconst bbdb-mua-mode-alist
  '((vm vm-mode vm-virtual-mode vm-summary-mode vm-presentation-mode)
    (gnus gnus-summary-mode gnus-article-mode gnus-tree-mode org-msg-edit-mode)
    (rmail rmail-mode rmail-summary-mode)
    (mh mhe-mode mhe-summary-mode mh-folder-mode)
    (mu4e mu4e-view-mode)
    (wl wl-summary-mode wl-draft-mode mime-view-mode)
    (message message-mode mu4e-compose-mode notmuch-message-mode)
    (mail mail-mode)))

But when I remove that fix, the problem doesn't recur. :-(

I'll email my config to you. Unfortunately, my gnus config is the work of 25 years and so it's a bit...messy.

@ndw

This comment has been minimized.

Copy link
Author

@ndw ndw commented Jan 15, 2020

Sent. It occurred to me that it might be the order of hooks in gnus-message-setup-hook, but reversing them didn't have any effect.

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 15, 2020

Hi Norman Walsh,

I looked at your configuration to understand better how you enable the encryption. I think I figured out a way to make it work with a simple patch in org-msg. I pushed that patch to the experimental branch. Could you give it a try ?

Regarding bbdb, the org-msg-mode function adds org-msg-edit-mode to list if bbdb has been loaded.

Regards,
Jeremy

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 17, 2020

Hi Norman Walsh,

Any update ?

Regards,
Jeremy

@ndw

This comment has been minimized.

Copy link
Author

@ndw ndw commented Jan 17, 2020

Sorry. Have been on my honeymoon and am now traveling. Will attempt to grab the experimental branch and try it before I get on a plane tomorrow. Otherwise, over the weekend.

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 17, 2020

ok, no rush.

@ndw

This comment has been minimized.

Copy link
Author

@ndw ndw commented Jan 17, 2020

Ok. I gave it a try. It's an improvement, but it's still problematic.

It looks like an empty, or nearly empty, text/plain entity has been signed, but the main text/html one has not.

From: Norman Walsh <ndw@example.com>
To: normanwalsh@example.com
Subject: Testing again (again)
Date: Fri, 17 Jan 2020 21:52:26 +0000
Message-ID: <m2iml9wy1x.fsf@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Lines: 69
Xref: hackmatack.local misc:350921

--=-=-=
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html xmlns=3D"http://www.w3.org/1999/xhtml" lang=3D"en" xml:lang=3D"en"><h=
ead><!-- 2020-01-17 Fri 21:52 --><meta http-equiv=3D"Content-Type" content=
=3D"text/html;charset=3Dutf-8"/><meta name=3D"viewport" content=3D"width=3D=
device-width, initial-scale=3D1"/><meta name=3D"generator" content=3D"Org m=
ode"/><meta name=3D"author" content=3D"Norman Walsh"/></head><body>
<div style=3D"font-family:&quot;Arial&quot;;font-size:10pt;line-height:11pt=
;" id=3D"content">
<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;max-width:100ch;">
Hi <b>Norm</b>,
</p>

<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;max-width:100ch;">
This one should be signed!
</p>



<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;max-width:100ch;">
Regards,
</p>

<div style=3D"font-family:&quot;Arial&quot;;font-size:10pt;margin-bottom:20=
px;font-family:&quot;Arial&quot;;font-size:10pt;line-height:11pt;">
<p style=3D"text-decoration:none;margin-bottom:0px;margin-top:10px;line-hei=
ght:11pt;font-size:10pt;font-family:&quot;Arial&quot;;max-width:100ch;">
=E2=80=93 <b>Jeremy</b> <br/><i>One Emacs to rule them all</i>
</p>

</div>
</div>
</body></html>
--=-=-=
Content-Type: multipart/signed; boundary="==-=-=";
	micalg=pgp-sha256; protocol="application/pgp-signature"

--==-=-=
Content-Type: text/plain


--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE1ury//rzuvqf7fN/hVWfHhJMAHkFAl4iLJoACgkQhVWfHhJM
AHn23xAAgW2R7rBF1y146WPBwb+LnKkhN0W/cUtO6DknrMVgXWG+SCZNSteVJw7f
E+Acp+NCyhbVyXD7J5FIZSdns326Soi90cc5+Nn5XrlZlpUJpxKiKKLuUPnval9y
bIh8hkGycSlxRNvy/H03QScmZFYnNKIsc70J05t9zfpJd763wGBoA7zsNd23EDY8
eOKIrVoF3uWrjRqN0LgBk0KJjgdflfuluOihlB6UEJa3VcJlDxDQumAM2Iz1gvcc
6GdK+rKDYd8p5ZQ7k2s41ltBl60zomgVeiiJDQLCrr/crPJpBbCthLmgGWUY25OG
RZemaNaPO0uH0CSsyNqjKyLYuiODDZlLABzUNdkVlCycWF2fYaVneHpp79wVUhpE
jqbAZcKE4f527/bPxC4UVzmwh5mOQUKGEFwlWBtTF/S3pRCdVsPLw3JACMHvNzBU
cvLJ6WAI2sVtCdHkT33n5Oz6FoVnZDUN/3suSXibu8XY3skcZ90Q7B7+P7yUbLHI
O+muA3kkdUjJv2IW8k4J2QdOEUJ9OnS+P1JjHNQnBTlHMs6GXFogozLMTOGmJrCb
swF1+rU/NyO6F9OdPMJ5Lp1/sqd8QqCwMyshsrWGbLq5MYax8hjrOIxJKBcXKzUz
JponY3VgkAudnQsCQDyg1wzqn8waL0gcbSWC8B4ix3uxl65PHhg=
=/yaC
-----END PGP SIGNATURE-----
--==-=-=--

--=-=-=--
@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 17, 2020

Hi Norman Walsh,

I have been able to reproduce locally and fix an order issue. It works for me.

However, it breaks the HTML inline images and the attachment features. This is probably going to be a little bit more painful to make this part work as this is mostly handled outside of org-msg.

Regards,
Jeremy

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 19, 2020

Hi Norman Walsh,

I pushed the update to the experimental branch. Could you please test it ? As I said it works to send or reply in HTML. However, features like inline images or attachment are broken. This is not going to be easy to fixed because this is a limitation of the mml package.

I'll have to come up with a solution but this is going to take a while.

Regards,
Jeremy

@jeremy-compostella

This comment has been minimized.

Copy link
Owner

@jeremy-compostella jeremy-compostella commented Jan 19, 2020

Hi Norman Walsh,

If you evaluate the following version of mml-generate-mime + use the experimental branch, it should work. This is a PoC/hack, I need to implement a recursive solution for mml-generate-mime and submit a patch.

(defun mml-generate-mime (&optional multipart-type)
  "Generate a MIME message based on the current MML document.
MULTIPART-TYPE defaults to \"mixed\", but can also
be \"related\" or \"alternate\"."
  (let ((cont (mml-parse))
	(mml-multipart-number mml-multipart-number)
	(options message-options))
    (if (not cont)
	nil
      (when (and (consp (car cont))
		 (= (length cont) 1)
		 (fboundp 'libxml-parse-html-region)
		 (equal (cdr (assq 'type (car cont))) "text/html"))
	(setq cont (mml-expand-html-into-multipart-related (car cont))))
      (when (and (consp (car cont))
		 (= (length cont) 1)
		 (fboundp 'libxml-parse-html-region)
		 (equal (cdr (assq 'type (assq 'part (car cont)))) "text/html"))
	(let ((res (mml-expand-html-into-multipart-related (assq 'part (car cont))))
	      (html-part (assq 'part (car cont))))
	  (setq cont (nconc (assq-delete-all 'part (car cont)) (list res)))))
      (prog1
	  (with-temp-buffer
	    (set-buffer-multibyte nil)
	    (setq message-options options)
	    (cond
	     ((and (consp (car cont))
		   (= (length cont) 1))
	      (mml-generate-mime-1 (car cont)))
	     ((eq (car cont) 'multipart)
	      (mml-generate-mime-1 cont))
	     (t
	      (mml-generate-mime-1
	       (nconc (list 'multipart (cons 'type (or multipart-type "mixed")))
		      cont))))
	    (setq options message-options)
	    (buffer-string))
	(setq message-options options)))))

Regards,
Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.