Hello, I'm trying to configure dnf-automatic to automatically upgrade my system on a daily basis and send me a summary via mailx using my mailgun account. I have mailx configured and functioning as expected; I can use the 'mail' cmd to send mail, and have other services using it to send mail.
The following gist[1] has my /etc/dnf/automatic.conf; all I've really changed about it is to specify to use 'command_email' and uncommented the default 'command_format' and 'stdin_format', along with setting the from/to emails. I've dropped some debug logs into the python it runs, and I can see it gets to the emitter fine. I was even able to send an example email with the emmitter that was constructed by manually setting the subject and body and running `emitters[0].commit()`[2]!
The error I'm seeing in the dnf-automatic.service logs is:
Jul 29 06:45:16 <host>dnf-automatic[6226]: . . . message not sent.
Is this is a bug or do I have something misconfigured? Would be much appreciated if someone could point me in the right direction.
[1] https://gist.githubusercontent.com/gunnarniels/7e29720adf654fee698c33d931564... [2] https://github.com/rpm-software-management/dnf/blob/4.2.23/dnf/automatic/mai...
-GN
On 7/29/20 9:43 PM, Gunnar Niels wrote:
Hello, I'm trying to configure dnf-automatic to automatically upgrade my system on a daily basis and send me a summary via mailx using my mailgun account. I have mailx configured and functioning as expected; I can use the 'mail' cmd to send mail, and have other services using it to send mail.
The following gist[1] has my /etc/dnf/automatic.conf; all I've really changed about it is to specify to use 'command_email' and uncommented the default 'command_format' and 'stdin_format', along with setting the from/to emails. I've dropped some debug logs into the python it runs, and I can see it gets to the emitter fine. I was even able to send an example email with the emmitter that was constructed by manually setting the subject and body and running `emitters[0].commit()`[2]!
The error I'm seeing in the dnf-automatic.service logs is:
Jul 29 06:45:16 <host>dnf-automatic[6226]: . . . message not sent.
Is this is a bug or do I have something misconfigured? Would be much appreciated if someone could point me in the right direction.
[1] https://gist.githubusercontent.com/gunnarniels/7e29720adf654fee698c33d931564... [2] https://github.com/rpm-software-management/dnf/blob/4.2.23/dnf/automatic/mai...
-GN
Is there a more specific mailing list or recommended forum for such a specific dnf question?
On Wed, 29 Jul 2020 at 23:13, Gunnar Niels gunnar.s.niels@gmail.com wrote:
Hello, I'm trying to configure dnf-automatic to automatically upgrade my system on a daily basis and send me a summary via mailx using my mailgun account. I have mailx configured and functioning as expected; I can use the 'mail' cmd to send mail, and have other services using it to send mail.
You don't mention how you are dealing with mail sent by other user ID's. Do the the services that work run as "root"? In the vaguely remembered past I have used aliases to have mails delivered to a local user, e.g., "operator", using a .forward file so messages end up on another machine.
On 7/29/20 9:43 PM, Gunnar Niels wrote:
Hello, I'm trying to configure dnf-automatic to automatically upgrade my system on a daily basis and send me a summary via mailx using my mailgun account. I have mailx configured and functioning as expected; I can use the 'mail' cmd to send mail, and have other services using it to send mail.
The following gist[1] has my /etc/dnf/automatic.conf; all I've really changed about it is to specify to use 'command_email' and uncommented the default 'command_format' and 'stdin_format', along with setting the from/to emails. I've dropped some debug logs into the python it runs, and I can see it gets to the emitter fine. I was even able to send an example email with the emmitter that was constructed by manually setting the subject and body and running `emitters[0].commit()`[2]!
The error I'm seeing in the dnf-automatic.service logs is:
Jul 29 06:45:16 <host>dnf-automatic[6226]: . . . message not sent.
Is this is a bug or do I have something misconfigured? Would be much appreciated if someone could point me in the right direction.
[1] https://gist.githubusercontent.com/gunnarniels/7e29720adf654fee698c33d931564... [2] https://github.com/rpm-software-management/dnf/blob/4.2.23/dnf/automatic/mai...
-GN
Hi folks. Wanted to follow up because we found it is a bug in the example command, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1862739
"This will not ever work with systemd. All you'll see is ". . . message not sent" in the dnf-automatic service status and no email will be delivered. The reason for this is that mailx will fork, dnf-automatic will exit, and systemd will kill the mail process."
The solution is to add "-Ssendwait", which prevents mailx from forking.
I've confirmed the fix and applied to my systems.
-GN