Running a SMTP email server (e.g., exim) in Gramine #1013
Replies: 7 comments 40 replies
-
I've never used |
Beta Was this translation helpful? Give feedback.
-
At first, @boryspoplawski, thanks for your answer! However, I could not follow your thoughts completely. What do you mean by virtual and system users, especially in the context of Gramine? Besides, what is the Maybe I give it another try, what I think the problem of running exim in Gramine is and how it is affected especially with the user configuration:
So, to make exim run as fluently as possible, we must somehow reproduce the user environment of a normal Linux installation inside Gramine. Normally, Gramine uses the root user. If we apply this, exim gets into a bunch of trouble, which we can partly accommodate by uncommenting some lines of code, but this is not very elegant and did not lead to a fully working environment yet. One interesting problem originates, that the root user does not write every output to the log files; instead, exim starts a new process with the second non-root user to accomplish this (more details here: https://github.com/Exim/exim/blob/master/src/src/log.c#L393). Especially, we aren’t allowed to configure the exim user as root, otherwise, the compilation fails. We can also reconfigure the UID and GID to the currently active user. However, this didn't seem to work out properly when taking the UID and GID of the host system (practically speaking, printing those values when running exim directly and copying them into the Gramine manifest). Exim then claims that it doesn’t know this user on startup, more exactly: So the question is if there is a way to simulate the two users (root and the exim user) within Gramine. (And if that’s not possible: I’m also open to other SMTP mail server suggestions that support TLS and password authentification. ;)) |
Beta Was this translation helpful? Give feedback.
-
@gabriel2029 I would definitely follow the approach of non-root users. This particular message probably stems from the fact that you didn't specify some user-related files in the Gramine manifest, like If you'll find out that e.g.
Ideally, you probably don't want to pass-through your computer's |
Beta Was this translation helpful? Give feedback.
-
Would you like to try Postfix instead? Postfix is split between many daemons and it will easy to run only some of them in gramine. (I've never tried it though). |
Beta Was this translation helpful? Give feedback.
-
Hi, apart from simply sending emails, I also wanted to receive E-Mails with Exim. The rough concept is working, however, I encountered some issues:
Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, At first, I had no major problems letting it run inside Gramine by following the Rootless Dovecot Wiki (cmp. https://wiki.dovecot.org/HowTo/Rootless). However, it seems to me that Unix sockets are not shared between multiple processes. To be exact I see in the log (here as an example with the Unix socket file
Later, in other child processes:
So my impression is that the Unix socket is opened successfully, but cannot be accessed by the child process. For the mounting of the path, I tried different options (e.g., normal file systems, If Unix sockets are indeed not feasible in the way I want to use them, what are possible workarounds, e.g., configurations I could search in Dovecot or using another IMAP server? Apart from that, some system calls are unimplemented, however, they (currently) don't seem to do a large problem: Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi, the problems with the Unix sockets have to seem resolved now when changing to absolute paths. However, as I currently noticed, Dovecot shares file descriptors between processes via |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
I wanted to run the SMTP email server exim (https://www.exim.org/) inside Gramine. However, there seem to be some problems:
Here are some error messages that occurred:
getrlimit(RLIMIT_NOFILE) failed: Bad address
exim: getgroups() failed: Bad address
failed to write to main log: length=65 result=-1 errno=9 (Bad file descriptor)
[P1:T1:exim] warning: "struct msghdr" ancillary data is not supported
How could I fix those problems, at best in a very generic way by, e.g., adjusting the Gramine manifest, and not by changing a lot of the actual code?
Apart from that, if that is not likely to make exim make work easily within Gramine: does anyone has experience in which SMTP server might be easily adapted to be run in Gramine and has the support of TLS as well as password authentication?
Best regards,
Gabriel
(Disclaimer: I already posted this question into the Google forum (https://groups.google.com/g/gramine-users/c/2UUgGqZ054U), but reposted it here as it was recommended there for me.)
Beta Was this translation helpful? Give feedback.
All reactions