[GH-ISSUE #4283] Can't send email from local MTA (exim4) #1837

Closed
opened 2026-03-03 02:12:38 +03:00 by kerem · 2 comments
Owner

Originally created by @zevilz on GitHub (Jan 29, 2024).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4283

I have working exim4 on server. Vaultwarden installed without Docker.

  • vars USE_SENDMAIL=true and SMTP_FROM=user@mysite.com defined in /etc/vaultwarden.env;
  • user vaultwarden added to group Debian-exim
  • changed rights to directory /var/spool/exim4 from 750 to 770 (owner Debian-exim and group Debian-exim).

But i have error during in "Test SMTP" section:

Error sending SMTP test email
Sendmail client error: internal client error: 2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system
2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system
2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system

Then i add folowing lines to vaultwarden systemd service like this:

RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_LOCAL AF_NETLINK
ReadWritePaths=/var/lib/vaultwarden /var/spool/exim4

But have error:

Error sending SMTP test email
Sendmail client error: internal client error: 2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391
2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391
2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391
drwxrwx--- 2 Debian-exim Debian-exim 4096 Jan 29 12:48 .
drwxr-x--- 5 Debian-exim Debian-exim 4096 Jan 26 16:22 ..
-rw-r----- 1 Debian-exim Debian-exim  464 Jan 28 00:00 1rTpmX-000Ybz-2p-D
-rw-r----- 1 Debian-exim Debian-exim  845 Jan 29 04:25 1rTpmX-000Ybz-2p-H
-rw-r----- 1 Debian-exim Debian-exim  313 Jan 27 00:00 1rTTJ0-0003WB-2H-D
-rw-r----- 1 Debian-exim Debian-exim  845 Jan 28 22:25 1rTTJ0-0003WB-2H-H
-rw-r----- 1 Debian-exim Debian-exim 1628 Jan 28 22:25 1rUAmO-0014ua-0N-D
-rw-r----- 1 Debian-exim Debian-exim  981 Jan 28 22:25 1rUAmO-0014ua-0N-H
-rw-r----- 1 Debian-exim Debian-exim  615 Jan 29 00:00 1rUCG5-0016Q7-3C-D
-rw-r----- 1 Debian-exim Debian-exim  845 Jan 29 00:25 1rUCG5-0016Q7-3C-H
-rw-r----- 1 Debian-exim Debian-exim 1628 Jan 29 04:25 1rUGOo-0016jp-0W-D
-rw-r----- 1 Debian-exim Debian-exim  981 Jan 29 04:25 1rUGOo-0016jp-0W-H
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:18 1rULuE-001acW-0s-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:18 1rULuw-001ahT-0J-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:19 1rULvj-001ahd-1Q-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:20 1rULwL-001ahg-0q-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:22 1rULym-001aik-1F-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:24 1rUM0C-001ais-0J-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 10:28 1rUM4b-001ajq-2K-D
-rw-r----- 1 vaultwarden vaultwarden    0 Jan 29 12:31 1rUNz5-001azQ-1t-D

Why does he send emails on his own behalf and not on behalf of exim?

Emails is sent without problems via sendmail (sendmail is symlink to exim4):

echo "Subject: sendmail test" | sendmail -v user@mysite.com`

Environment:

  • Debian 12
  • Exim 4.96
  • Vaultwarden:
    • Server Installed - 1.30.1-edf7484a
    • Server Latest - 1.30.1-4b9384cb
    • Web Installed - 2024.1.2
    • Web Latest - 2024.1.2
    • Database - SQLite: 3.44.0
Originally created by @zevilz on GitHub (Jan 29, 2024). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/4283 I have working exim4 on server. Vaultwarden installed without Docker. - vars `USE_SENDMAIL=true` and `SMTP_FROM=user@mysite.com` defined in /etc/vaultwarden.env; - user `vaultwarden` added to group `Debian-exim` - changed rights to directory `/var/spool/exim4` from 750 to 770 (owner `Debian-exim` and group `Debian-exim`). But i have error during in "Test SMTP" section: ``` Error sending SMTP test email Sendmail client error: internal client error: 2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system 2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system 2024-01-29 12:32:11 1rUNzv-001b0k-31 Failed to create spool file /var/spool/exim4//input//1rUNzv-001b0k-31-D: Read-only file system ``` Then i add folowing lines to vaultwarden systemd service like [this](https://github.com/dani-garcia/vaultwarden/wiki/SMTP-Configuration#using-sendmail-without-docker): ``` RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_LOCAL AF_NETLINK ReadWritePaths=/var/lib/vaultwarden /var/spool/exim4 ``` But have error: ``` Error sending SMTP test email Sendmail client error: internal client error: 2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391 2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391 2024-01-29 10:28:53 1rUM4b-001ajq-2K exim.c:878: chown(/var/spool/exim4//input//1rUM4b-001ajq-2K-D, 103:110) failed (Operation not permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391 ``` ``` drwxrwx--- 2 Debian-exim Debian-exim 4096 Jan 29 12:48 . drwxr-x--- 5 Debian-exim Debian-exim 4096 Jan 26 16:22 .. -rw-r----- 1 Debian-exim Debian-exim 464 Jan 28 00:00 1rTpmX-000Ybz-2p-D -rw-r----- 1 Debian-exim Debian-exim 845 Jan 29 04:25 1rTpmX-000Ybz-2p-H -rw-r----- 1 Debian-exim Debian-exim 313 Jan 27 00:00 1rTTJ0-0003WB-2H-D -rw-r----- 1 Debian-exim Debian-exim 845 Jan 28 22:25 1rTTJ0-0003WB-2H-H -rw-r----- 1 Debian-exim Debian-exim 1628 Jan 28 22:25 1rUAmO-0014ua-0N-D -rw-r----- 1 Debian-exim Debian-exim 981 Jan 28 22:25 1rUAmO-0014ua-0N-H -rw-r----- 1 Debian-exim Debian-exim 615 Jan 29 00:00 1rUCG5-0016Q7-3C-D -rw-r----- 1 Debian-exim Debian-exim 845 Jan 29 00:25 1rUCG5-0016Q7-3C-H -rw-r----- 1 Debian-exim Debian-exim 1628 Jan 29 04:25 1rUGOo-0016jp-0W-D -rw-r----- 1 Debian-exim Debian-exim 981 Jan 29 04:25 1rUGOo-0016jp-0W-H -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:18 1rULuE-001acW-0s-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:18 1rULuw-001ahT-0J-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:19 1rULvj-001ahd-1Q-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:20 1rULwL-001ahg-0q-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:22 1rULym-001aik-1F-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:24 1rUM0C-001ais-0J-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 10:28 1rUM4b-001ajq-2K-D -rw-r----- 1 vaultwarden vaultwarden 0 Jan 29 12:31 1rUNz5-001azQ-1t-D ``` Why does he send emails on his own behalf and not on behalf of exim? Emails is sent without problems via sendmail (sendmail is symlink to exim4): ``` echo "Subject: sendmail test" | sendmail -v user@mysite.com` ``` Environment: - Debian 12 - Exim 4.96 - Vaultwarden: - Server Installed - 1.30.1-edf7484a - Server Latest - 1.30.1-4b9384cb - Web Installed - 2024.1.2 - Web Latest - 2024.1.2 - Database - SQLite: 3.44.0
kerem closed this issue 2026-03-03 02:12:39 +03:00
Author
Owner

@BlackDex commented on GitHub (Jan 29, 2024):

Well, the vaultwarden user is the one executing the exim or sendmail command.
So, not really strange i think.

I do not have the exact workings, but it just executes the command provided in the config.
Best way to simulate this is by running it like this via the shell.

echo "Subject: sendmail test" | sudo -u vaultwarden sendmail -v user@mysite.com
<!-- gh-comment-id:1914613168 --> @BlackDex commented on GitHub (Jan 29, 2024): Well, the `vaultwarden` user is the one executing the `exim` or `sendmail` command. So, not really strange i think. I do not have the exact workings, but it just executes the command provided in the config. Best way to simulate this is by running it like this via the shell. ```bash echo "Subject: sendmail test" | sudo -u vaultwarden sendmail -v user@mysite.com ```
Author
Owner

@BlackDex commented on GitHub (Jan 30, 2024):

I did some quick tests locally. And it seems to work fine for me, and I'm running Vaultwarden via a normal user.

This doesn't really seem like a bug/issue on the Vaultwarden side, but more a configuring issue with exim4 (Which is a hell in my opinion).

Maybe other users here know something, and therefor I'm moving this to Discussions.

<!-- gh-comment-id:1917564092 --> @BlackDex commented on GitHub (Jan 30, 2024): I did some quick tests locally. And it seems to work fine for me, and I'm running Vaultwarden via a normal user. This doesn't really seem like a bug/issue on the Vaultwarden side, but more a configuring issue with exim4 (Which is a hell in my opinion). Maybe other users here know something, and therefor I'm moving this to Discussions.
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
starred/vaultwarden#1837
No description provided.