Hi,
On Fri, Feb 25, 2022 at 1:06 PM Marvin Renich wrote:
>
> create a default From address that is useful when root's mail is being
> forwarded off the current system
We just released 4.2-2 in order to address this issue in part.
Hoping to improve the default MAILFROM value for all users we merely added the
host name for now. That value was readily available in upstream's code. The
patch has a better chance of being accepted upstream.
The /etc/mailname mechanism is specific to Debian. A later release of mdadm in
Debian may bring the MAILFROM value into compliance with Debian mail customs.
I tried to test the change but my local mail server replaces all From addresses
with meaningful values. (It was my fix for the reporter's issue.) Please let us
know if this patch does not work as expected.
Salsa is currently down. The patch is instead attached for your review.
Kind regards
Felix Lechner
Description: Add host name to default MAILFROM
The host on which the error occurred is mentioned in the subject and also in
the message body, but some may find it useful in the From address, as well.
Author: Felix Lechner
Bug-Debian: https://bugs.debian.org/1006464
Forwarded: no
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Monitor.c
+++ b/Monitor.c
@@ -440,8 +440,8 @@ static void alert(char *event, char *dev
if (info->mailfrom)
fprintf(mp, "From: %s\n", info->mailfrom);
else
-fprintf(mp, "From: %s monitoring \n",
- Name);
+fprintf(mp, "From: %s monitoring \n",
+ Name, hname);
fprintf(mp, "To: %s\n", info->mailaddr);
fprintf(mp, "Subject: %s event on %s:%s\n\n",
event, dev, hname);