<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 11:35 AM Lennart Poettering <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On So, 23.09.18 22:48, Kamil Jońca (<a href="mailto:kjonca@o2.pl" target="_blank">kjonca@o2.pl</a>) wrote:<br>
<br>
> It is something strange with sending mails from systemd system service:<br>
> assume we have service file /etc/systemd/system/mailtest.service:<br>
> <br>
> --8<---------------cut here---------------start------------->8---<br>
> [Unit]<br>
> Description="Test maili"<br>
> [Service]<br>
> #User=kjonca<br>
> NoNewPrivileges=false<br>
> Type=oneshot<br>
> ExecStart=-zsh -c 'echo xxx|mail news'<br>
> ExecStart=-zsh -c 'echo xxx|mutt -F /dev/null -s subject -e \'set copy=no\' kjonca'<br>
> --8<---------------cut here---------------end--------------->8---<br>
> <br>
> When I call<br>
> sudo systemctl start mailtest.service<br>
> Two messages are put in exim queue, but not deliveried immediately.<br>
> Why? What am I missing?<br>
<br>
Uh, this looks like something you need to ask the exim community,<br>
systemd can't make exim mail queueing decisions, that's entirely<br>
internal to exim.<br>
<br>
One question though: are you sure you have started the exim service<br>
properly beforehand? I am pretty sure exim won't process the mail<br>
queue if it's not running...<br></blockquote><div><br></div><div>exim's a bit oldschool, and whenever you pipe a message to 'sendmail', it immediately forks a worker to deliver the message synchronously, regardless of the main daemon running.</div><div><br></div><div>(I think this behavior is slightly ugly. It can be disabled by setting 'queue_only=yes', but... it's probably necessary because the main daemon only processes its queue every x minutes and won't notice queued messages for a while.)</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>