Score:1

Unattended-Upgrade sends status e-mail to wrong address

sv flag

I have a strange error that I cannot figure out myself. I want unattended upgrades to send a status e-mail to a certain address. But somehow it always changes the "to" field in that email to something else. No matter what I configure.

/etc/apt/apt.conf.d/50unattended-upgrades:

    Unattended-Upgrade::Allowed-Origins {
      "${distro_id}:${distro_codename}-security";
};

Unattended-Upgrade::Package-Blacklist {
};

Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::Mail "[email protected]";
Unattended-Upgrade::MailReport "always";

When I check the postfix mail log (setup as a smart relay) it shows the following output.

/var/log/mail.log:

Jul  4 12:49:06 T3CPSRPI01 postfix/local[32055]: 360533F9BA: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.09, delays=0.05/0/0/0.04, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")

I have no idea why it tries to send a status email to [email protected] instead of [email protected]. I use the same configuration (postfix, unattended-upgrades) on all my debian machines and it works flawlessly. Only on this raspberry pi it doesnt work.

The sendmail command works without problems:

echo "Subject: sendmail test" | sendmail -v [email protected]

Do you have any ideas?

anx avatar
fr flag
anx
Your could reduce the search space [attaching](https://serverfault.com/posts/1135656/edit) relevant output of calling `unattended-upgrade --debug` (The last lines should include `Sending mail to root` and its exit code, confirming what is passed to `sendmail` or `mailx`)
xronin avatar
sv flag
The debug output doesn't say anything about a send mail. But I checked the `/var/mail/` folder. It seems like all mails of unattended-upgrades are stored in a file called `nobody`
xronin avatar
sv flag
I still don't understand why all e-mails are delivered locally.
Score:0
fr flag
anx

If its sending to orig_to=<root> then your apt configuration may not be effective. Disregard the expansion to hostname, that after-effect is otherwise rather reasonable for incomplete recipients.

Prove it by calling apt-config dump Unattended-Upgrade::Mail - you expect that to print Unattended-Upgrade::Mail "[email protected]"; based on what is in the file you looked into, but it might be overridden in another file.

xronin avatar
sv flag
Thanks for your reply. I executed your command `apt-config dump Unattended-Upgrade::Mail` and the result is exactly the e-mail adress where I want to send the status mail to: `[email protected]`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.