[GH-ISSUE #1457] Unable to write mail in mutt (using emacsclient) #981

Closed
opened 2026-05-05 07:15:18 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @Boruch-Baum on GitHub (Aug 11, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1457

For firejail version 0.9.48 in debian, using mutt configured to edit with emacs client, with the command line invocation:

firejail --debug --noblacklist=/usr/bin/emacsclient --noblacklist=/tmp mutt

When attempting to open an edit buffer, mutt displays an error message about being unable to open emacsclient for a temp file in /tmp, and mangles the ncurses screen display. Upon exiting, the terminal display shows the following additional message:

emacsclient: could not get terminal name
emacsclient: error executing alternate editor ""

emacsclient is a popular way of calling emacs, because it connects to an already running instance, saving what can be a wait for us impatient people as emacs loads.

It may even be a good idea to add a profile for emacsclient. Maybe it would be sufficient to just be call to the already-existing emacs profile.

Originally created by @Boruch-Baum on GitHub (Aug 11, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1457 For firejail version 0.9.48 in debian, using mutt configured to edit with emacs client, with the command line invocation: firejail --debug --noblacklist=/usr/bin/emacsclient --noblacklist=/tmp mutt When attempting to open an edit buffer, mutt displays an error message about being unable to open emacsclient for a temp file in /tmp, and mangles the ncurses screen display. Upon exiting, the terminal display shows the following additional message: emacsclient: could not get terminal name emacsclient: error executing alternate editor "" emacsclient is a popular way of calling emacs, because it connects to an already running instance, saving what can be a wait for us impatient people as emacs loads. It may even be a good idea to add a profile for emacsclient. Maybe it would be sufficient to just be call to the already-existing emacs profile.
Author
Owner

@chiraag-nataraj commented on GitHub (Dec 8, 2017):

Hmmm...I have the same setup (I use emacsclient within mutt). And yet it works for me. Can you post the mutt profile you're using?

<!-- gh-comment-id:350300546 --> @chiraag-nataraj commented on GitHub (Dec 8, 2017): Hmmm...I have the same setup (I use emacsclient within mutt). And yet it works for me. Can you post the `mutt` profile you're using?
Author
Owner

@Boruch-Baum commented on GitHub (Dec 8, 2017):

No, I'm not going to start redacting all the personal information from that file.

Since my report was four months ago, and you report that it is now working for you, I tried it again. The situation is only slightly better in that the ncurses display isn't being corrupted and upon exit, the terminal display does not need to be reset after exiting mutt. However, for me, mutt still fails to launch the emacsclient.

BTW, in the intervening four months, not only has firejail been under development but debian has upgraded its versions of mutt, and has changed the underlying codebase from neomutt back to the original mutt project. I'm using debian's latest-and-greatest version of mutt, 1.9.1 (2017-09-22). At this point, the version of firejail that I have installed is not the latest-and-greatest git development version; it's the debian version 0.9.50.

<!-- gh-comment-id:350321247 --> @Boruch-Baum commented on GitHub (Dec 8, 2017): No, I'm not going to start redacting all the personal information from that file. Since my report was four months ago, and you report that it is now working for you, I tried it again. The situation is only slightly better in that the ncurses display isn't being corrupted and upon exit, the terminal display does not need to be reset after exiting mutt. However, for me, mutt still fails to launch the emacsclient. BTW, in the intervening four months, not only has firejail been under development but debian has upgraded its versions of mutt, and has changed the underlying codebase from neomutt back to the original mutt project. I'm using debian's latest-and-greatest version of mutt, 1.9.1 (2017-09-22). At this point, the version of firejail that I have installed is not the latest-and-greatest git development version; it's the debian version 0.9.50.
Author
Owner

@chiraag-nataraj commented on GitHub (Dec 18, 2017):

By the mutt profile, I meant the firejail profile, not your mutt configuration. My apologies if there was a misunderstanding. I am on Debian sid/experimental, so I most likely have the same versions of the programs you have. Let's figure this out. Also, another question: are you using emacs in the terminal or in an X11 window?

<!-- gh-comment-id:352312830 --> @chiraag-nataraj commented on GitHub (Dec 18, 2017): By the mutt profile, I meant the firejail profile, not your mutt configuration. My apologies if there was a misunderstanding. I am on Debian sid/experimental, so I most likely have the same versions of the programs you have. Let's figure this out. Also, another question: are you using emacs in the terminal or in an X11 window?
Author
Owner

@Boruch-Baum commented on GitHub (Dec 18, 2017):

  1. We're good - there was a misunderstanding, but no need to apologize.

  2. There is no mutt profile in my ~/.config/firejail directory, and /etc/firejail/mutt.profile is attached. It needed to renamed to foo.txt in order for github to allow it to be uploaded. Performing a stat on the original shows it was modified last on 2017-09-23 22:18, which matches the time-stamp of the last apt update for the firejail package on my system, so it should be an unmodified version, but have a look.

  3. As of today, my firejail version is debian 0.9.50-3, and in a few minutes my mutt version should bump up to neomutt 20171215+dfsg.1-1 (remember: up until a few weeks ago, debian's version of mutt was really neomutt).

  4. My emacs loads as either 'emacs-nox' or 'emacs -nw', and starts an emacs server daemon. The clients run either in a true linux terminal (often within tmux), or in a terminal emulator similar to xterm (and pretty much always within tmux).

<!-- gh-comment-id:352473964 --> @Boruch-Baum commented on GitHub (Dec 18, 2017): 1) We're good - there was a misunderstanding, but no need to apologize. 2) There is no mutt profile in my ~/.config/firejail directory, and /etc/firejail/mutt.profile is attached. It needed to renamed to foo.txt in order for github to allow it to be uploaded. Performing a stat on the original shows it was modified last on 2017-09-23 22:18, which matches the time-stamp of the last apt update for the firejail package on my system, so it should be an unmodified version, but have a look. 3) As of today, my firejail version is debian 0.9.50-3, and in a few minutes my mutt version should bump up to neomutt 20171215+dfsg.1-1 (remember: up until a few weeks ago, debian's version of mutt was really neomutt). 4) My emacs loads as either 'emacs-nox' or 'emacs -nw', and starts an emacs server daemon. The clients run either in a true linux terminal (often within tmux), or in a terminal emulator similar to xterm (and pretty much always within tmux).
Author
Owner

@Boruch-Baum commented on GitHub (Dec 18, 2017):

mutt_profile.txt

<!-- gh-comment-id:352474268 --> @Boruch-Baum commented on GitHub (Dec 18, 2017): [mutt_profile.txt](https://github.com/netblue30/firejail/files/1568679/mutt_profile.txt)
Author
Owner

@chiraag-nataraj commented on GitHub (Jan 7, 2018):

There is no mutt profile in my ~/.config/firejail directory, and /etc/firejail/mutt.profile is attached. It needed to renamed to foo.txt in order for github to allow it to be uploaded. Performing a stat on the original shows it was modified last on 2017-09-23 22:18, which matches the time-stamp of the last apt update for the firejail package on my system, so it should be an unmodified version, but have a look.

Cool. Just wanted to make sure you're not using a custom profile.

As of today, my firejail version is debian 0.9.50-3, and in a few minutes my mutt version should bump up to neomutt 20171215+dfsg.1-1 (remember: up until a few weeks ago, debian's version of mutt was really neomutt).

I presume you're following all the default updates, so you probably have mutt version 1.9.2 (compiled on 2017-12-15) and firejail version 0.9.52.

My emacs loads as either 'emacs-nox' or 'emacs -nw', and starts an emacs server daemon. The clients run either in a true linux terminal (often within tmux), or in a terminal emulator similar to xterm (and pretty much always within tmux).

Okay, so there's the difference. I usually load emacs in an X11 window. I also start a server daemon. Let me try loading emacs within the terminal instead of using the graphical version and see if it works.

<!-- gh-comment-id:355838261 --> @chiraag-nataraj commented on GitHub (Jan 7, 2018): > There is no mutt profile in my ~/.config/firejail directory, and /etc/firejail/mutt.profile is attached. It needed to renamed to foo.txt in order for github to allow it to be uploaded. Performing a stat on the original shows it was modified last on 2017-09-23 22:18, which matches the time-stamp of the last apt update for the firejail package on my system, so it should be an unmodified version, but have a look. Cool. Just wanted to make sure you're not using a custom profile. > As of today, my firejail version is debian 0.9.50-3, and in a few minutes my mutt version should bump up to neomutt 20171215+dfsg.1-1 (remember: up until a few weeks ago, debian's version of mutt was really neomutt). I presume you're following all the default updates, so you probably have mutt version 1.9.2 (compiled on 2017-12-15) and firejail version 0.9.52. > My emacs loads as either 'emacs-nox' or 'emacs -nw', and starts an emacs server daemon. The clients run either in a true linux terminal (often within tmux), or in a terminal emulator similar to xterm (and pretty much always within tmux). Okay, so there's the difference. I usually load `emacs` in an X11 window. I also start a server daemon. Let me try loading `emacs` within the terminal instead of using the graphical version and see if it works.
Author
Owner

@chiraag-nataraj commented on GitHub (Jan 7, 2018):

I just got emacs to load perfectly well in the terminal using my profile. Can you try using the profile I've attached and see what happens?
mutt.txt

<!-- gh-comment-id:355838489 --> @chiraag-nataraj commented on GitHub (Jan 7, 2018): I just got `emacs` to load perfectly well in the terminal using my profile. Can you try using the profile I've attached and see what happens? [mutt.txt](https://github.com/netblue30/firejail/files/1609997/mutt.txt)
Author
Owner

@chiraag-nataraj commented on GitHub (Jan 7, 2018):

This updated profile also works (and re-enables a lot of crap I had disabled at some point...)
mutt.txt

<!-- gh-comment-id:355838733 --> @chiraag-nataraj commented on GitHub (Jan 7, 2018): This updated profile also works (and re-enables a lot of crap I had disabled at some point...) [mutt.txt](https://github.com/netblue30/firejail/files/1610000/mutt.txt)
Author
Owner

@chiraag-nataraj commented on GitHub (Mar 29, 2018):

Hey @Boruch-Baum! Just wondering if you ever had the chance to try the profiles I attached (or if this is still an issue for you).

<!-- gh-comment-id:377263078 --> @chiraag-nataraj commented on GitHub (Mar 29, 2018): Hey @Boruch-Baum! Just wondering if you ever had the chance to try the profiles I attached (or if this is still an issue for you).
Author
Owner

@Boruch-Baum commented on GitHub (Mar 29, 2018):

Sorry, no, it got to be too much of a hassle, so I dropped firejail from use with mutt, and never got back to testing it.

<!-- gh-comment-id:377306154 --> @Boruch-Baum commented on GitHub (Mar 29, 2018): Sorry, no, it got to be too much of a hassle, so I dropped firejail from use with mutt, and never got back to testing it.
Author
Owner

@chiraag-nataraj commented on GitHub (Mar 29, 2018):

No worries. If you want to debug this further, feel free to reply after testing the profiles 🙂

<!-- gh-comment-id:377308076 --> @chiraag-nataraj commented on GitHub (Mar 29, 2018): No worries. If you want to debug this further, feel free to reply after testing the profiles :slightly_smiling_face:
Author
Owner

@chiraag-nataraj commented on GitHub (May 6, 2018):

I'm going to go ahead and close this, but @Boruch-Baum: feel free to re-open if you still have this issue and want to debug further.

<!-- gh-comment-id:386847547 --> @chiraag-nataraj commented on GitHub (May 6, 2018): I'm going to go ahead and close this, but @Boruch-Baum: feel free to re-open if you still have this issue and want to debug further.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#981
No description provided.