I write e-mails with mu4e and sign them with an s/mime certificate by default. Do this end, I have defined mu4e with

:enter-func (lambda () (mu4e-message "Switch to work context") (add-hook 'mu4e-compose-mode-hook 'mml-secure-message-sign-smime) )

So that whenever I enter mu4e-compose-mode to write a new message, or a reply to one, mml-secure-message-sign-smime is executed. When I reply to an e-mail from, say, [email protected], then I get an e-mail compose buffer, which looks like this:

From: My Name <[email protected]>
To: [email protected]
Subject: Re: hi!
Date: Mon, 29 Jan 2024 17:15:39 +0100
--text follows this line--
<#secure method=smime mode=sign>

On 2024-01-29 at 17:11 +01, "Alice" <[email protected]> wrote...
> Hi!

It is now very annoying that whenever I reply to an e-mail, then the point, i.e. the cursor, is now right before the <#secure. Hence, when I start typing, I write the text immediately before the <#secure...>. However, it seems that it is important that the e-mail body begins with the string <#secure method=smime mode=sign>, it cannot be anywhere else in the e-mail body, as otherwise it is interpreted as text that is sent along with the rest of the message.

I tried to fix this by additionally adding the following code to the mu4e-compose-mode-hook:

:enter-func (lambda () (mu4e-message "Switch to work context") (add-hook 'mu4e-compose-mode-hook 'mml-secure-message-sign-smime) (add-hook 'mu4e-compose-mode-hook (lambda () (forward-line 1))))

With this I want to move the cursor to the next line after <#secure ... >. Unfortunately, this has no effect, the cursor remains before the <#secure ... > sting.

Does anyone have an idea how to fix this? Thank you very much for your help!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.