siderea: (Default)
[personal profile] siderea
Hey, *nix peeps! I have an obscure question.

I use nmh, a commandline MUA. I have been assured that I can't run nmh in a jailed shell. Not talking about installation, just execution. I don't know why. If any of you already tried explaining to me why, I've forgotten the explanation (sorry).

Well, I just talked to a vendor of VPSes that says they aren't using jailed shells, they're using "Linux-Containers (LXC)".

What I want to know is: okay, can nmh be run in LXC?

Secondarily, I would like to know what the issue is with jailed shells and nmh so that I might plausibily figure out for myself whether LXC has the same problem.

But mostly I just want to know if I could plausibly migrate to this vendor's VPS.

TIA,

Siderea

Edit: I feel the need to share this. I just found another, different company, offering managed VPS, the website for which says:
Pre-Sales:
Available:
Monday to Friday
2:30 AM to 5 PM (GMT -6, CDT)
They're in Texas, which doesn't seem like I place I want to have a company I am reliant on. Otherwise, I'd be mightily tempted just give them a call when, uh, they open.

(no subject)

Date: 2023-06-17 12:41 am (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
If your mailspool is visible in the container, and nmh can be pointed at it, it will work.

If a jailed shell does not include a mailspool, nmh won't work. Typically that means that the jail does not include /var/spool/mail/siderea.



(no subject)

Date: 2023-06-17 12:45 am (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
... also, if your mail is delivered to /home/siderea/Maildir, there is
https://github.com/leahneukirchen/mblaze
which is billed as 'mh for Maildirs'.

(no subject)

Date: 2023-06-17 07:10 am (UTC)
vatine: Generated with some CL code and a hand-designed blackletter font (Default)
From: [personal profile] vatine
It should, in theory, be possible, yes.

The main issue with jailed shells is that they tend to have a very restricted view of the file system, which generally does NOT contain vast chunks of /var. A container has many of the same constraints.

The problem with delivering mail through procmail that I can see (speaking as a hypothetical service provider here) I would not want a user who normally "lives" in a jailed shell to have unfettered access via procmail, so I would have to arrange for said user's procmail to run in an equivalent jail. It should by NO means be impossible, it "just" requires configuration. And procmail reads (IIRC, it's been a decade or two since I last seriously ran mail servers for pay) messages from stdin, so again it SHOULD be perfectly happy to work in a jail (or in a container, but it's probably SLIGHTLY more hassle getting that working).

My guess is that other "jailed shell" users use either IMAP or POP3 for mail access (if you as an nmh user cannot access the spool directory, neither can they, and there's basically four ways of getting the mail, "read the mail spool file", "read the mail spool maildir", "POP3" and "IMAP" (there may of course be more creative ways, but...) and it MAY be possible to jury-rig something that fetches via POP3, feeds that into procmail, and eventually into nmh.

(no subject)

Date: 2023-06-17 12:27 pm (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
You don't need to jury-rig that, it's pretty common. 'getmail6':

> It retrieves mail (either all messages, or only unread messages)
from one or more POP3/IMAP4/SDPS servers for one or more email
accounts, and reliably delivers into a qmail-style Maildir, mbox
file or to a command (pipe delivery) like maildrop or procmail,
specified on a per-account basis. getmail6 also has support for
domain (multidrop) mailboxes.



(no subject)

Date: 2023-06-17 09:50 pm (UTC)
vatine: Generated with some CL code and a hand-designed blackletter font (Default)
From: [personal profile] vatine
Good-oh!

(no subject)

Date: 2023-06-17 12:12 pm (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
Yes, but only someone with root powers can arrange that. If this is a commercial service they may not want to special-case you.

(no subject)

Date: 2023-06-17 02:35 am (UTC)
From: [personal profile] londo
As someone who's not an expert on nmh, but is at *least* a journeyman on containers: Yes, it is very plausible, unless nmh needs access to some really weird kernel capabilities. The likeliest one I can think of is CAP_NET_ADMIN, which they probably wouldn't give you but which nmh doesn't seem like it would need.

You'll need to mount a persistent volume, but presumably if they do all their hosting via container engines they're very accustomed to that.

You might not be able to run debuggers like gdb there.

I'm curious about the hosting service and what they offer, but that's just because I'm kind of a nerd about containers.

(no subject)

Date: 2023-06-17 02:56 am (UTC)
From: [personal profile] londo
Depending on their setup, you might need to run your own cron inside your container, but that's doable.

Re: "root and the responsibility to use it", I'm really curious what their approach is to patching CVEs in non-kernel stuff, like if there are problems with openssl or bash or something else terrifying.

(no subject)

Date: 2023-06-17 07:12 am (UTC)
vatine: Generated with some CL code and a hand-designed blackletter font (Default)
From: [personal profile] vatine
A standard "this is our container image", and comes Heartbleed 2 - The Eageling, they can then spin up the container-building pipeline (OK, it's probably one file, and one command, but...) and generate a new image with the updated things. Then all VPSes are restarted and pick up the new image.

(no subject)

Date: 2023-06-17 08:47 am (UTC)
vatine: Generated with some CL code and a hand-designed blackletter font (Default)
From: [personal profile] vatine
Things that need to persist from one startup to another are in general provided on "disk outside the container" that is then bind-mounted into the container (for VPS services, I guess either as network-attached block storage, exposed inside the container; or NFS, exposed in the container).

Things written to the file system, but outside of data areas that are explicitly persisted will simply be written to an overlay and disappear on container restart.

Technically, the difference between a BSD jail and a Linux cgroup (containers are basically built on top of cgroups) are mostly of the "well, we call different things different things", as far as I can tell.

A cgroup can go from "things in this cgroup are pinned to these CPUs, but otherwise not isolated", via dedicated process ID spaces (the processes are visible, with the PID that the actual kernel knows, but only processes within the process space are visible within the cgroup, and the process started to "pin" the cgroup shows up as PID 1), dedicated file system path namespaces, and dedicated network namespaces (so a container-local IP address and routing table, typically using either virtual ethernet ports and/or bridge groups to expose to the external world).

What is normally referred to as "a container" is basically a cgroup that has its own filesystem, process, and network namespace.

I hope that makes some sense, at least?

(no subject)

Date: 2023-06-17 12:18 pm (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
A container is some combination of:

- a chroot jail or equivalent via a namespace constraint on the filesystem
- overlay filesystems
- namespace constraints on your processes

The most common type is the OCI mostly-standard: https://opencontainers.org/ but there are others.

(no subject)

Date: 2023-06-18 11:14 pm (UTC)
From: [personal profile] londo
The other answers here are solid; if you want to dig in more feel free to hit me up over text some time. There's enough detail and enough "so if you know about X, it's like that" that it's a difficult conversation to have asynchronously, there's a lot of calibrating for how much detail is helpful.

About

Artisanal wisdom prepared by hand in small batches from only the finest, locally sourced, organic insights.

Not homogenized • Superlative clarity • Excellently thought provoking

Telling you things you didn't know you knew & pointing out things that you didn't know that you didn't know since at least 2004.

January 2026

S M T W T F S
    1 23
45 678910
11 12 1314 15 16 17
18192021222324
25262728293031