[exim] exim4 only queues mails sent by systemd service

Top Page
Delete this message
Reply to this message
Author: Kamil Jońca
Date:  
To: exim-users
Subject: [exim] exim4 only queues mails sent by systemd service

(This is repost of
https://lists.freedesktop.org/archives/systemd-devel/2018-September/041393.html
as Lennart Poettering suggest this)

It is something strange with sending mails from systemd system service:
assume we have service file /etc/systemd/system/mailtest.service:

--8<---------------cut here---------------start------------->8---
[Unit]
Description="Test maili"
[Service]
#User=kjonca
NoNewPrivileges=false
Type=oneshot
ExecStart=-zsh -c 'echo xxx|mail news'
ExecStart=-zsh -c 'echo xxx|mutt -F /dev/null -s subject -e \'set copy=no\' kjonca'
--8<---------------cut here---------------end--------------->8---

When I call
sudo systemctl start mailtest.service
Two messages are put in exim queue, but not deliveried immediately.
Why? What am I missing?
Morevoer this service run as "--user" service works as expected - mails
are delivered at once.
Does systemd interfere with processes (suid/sgid? file access limitations?)

Moreover;
when I put strace in front of mutt - mails were delivered at once

Beside this
- mails from cron
- mails from fetchmail
- mails from "--user" services
are delivered at once - as expected.

KJ


--
http://stopstopnop.pl/stop_stopnop.pl_o_nas.html
kondensator - kondensatorych - kondensatoremu
(odmiana słowa "kondensator" według MS Word 6.0)