Re: SMART error messages being sent to the wrong address

2023-10-05 Thread Michel Verdier
On 2023-10-05, Gary Dale wrote:

> Other mail from that server is being sent properly. It's just the SMART
> messages that are going to the wrong place.

smartd.conf can have a -M exec option to call another script instead of
simple mail. Do you have one?
smartd can get some options from /etc/default/smartmontools
and /etc/smartmontools can hold scripts called for sending mail.
(perhaps /etc/smartmontools/run.d/10mail)
check all this



Re: SMART error messages being sent to the wrong address

2023-10-05 Thread Gary Dale

On 2023-10-04 02:43, Jeffrey Walton wrote:

On Tue, Oct 3, 2023 at 9:32 PM Gary Dale  wrote:

I'm running Debian/Bookworm on a headless server. The box has had a
variety of roles and names. At one time it was called fanny after the
groundbreaking rock band and because it had a lot of fans in it. This
latter attribute led to it being made into a file server and renamed
BigData.

The problem I'm having is that SMART error messages are being sent to
root@fanny. instead of to me. /etc/aliases has all mail to
root going to me, but because this addressed to root on a machine with a
different name, it goes out and I only get the message when it bounces
(because the machine name no longer exists).

I can't find where the e-mail address is being set. Tracing down the
smartmontools config files didn't turn up any obvious problems.

Can anyone point in the right direction?

If Greg and Charles' suggestions do not work, I would grep for it.

 $ sudo su -
 $ grep -iIR fanny /etc

That should uncover places the old name shows up.

Jeff

Thanks Jeff. It looks like it came from /etc/mailname.



Re: SMART error messages being sent to the wrong address

2023-10-05 Thread Gary Dale

On 2023-10-04 03:22, to...@tuxteam.de wrote:

On Wed, Oct 04, 2023 at 02:43:36AM -0400, Jeffrey Walton wrote:

[...]


 $ sudo su -

...better spelt these days as "sudo -i" (or "sudo -s"), see sudo(1)'s
man page.


Or sudo bash - or whatever your preferred shell is.




Re: SMART error messages being sent to the wrong address

2023-10-05 Thread Gary Dale

On 2023-10-03 22:31, Greg Wooledge wrote:

On Tue, Oct 03, 2023 at 09:02:39PM -0500, John Hasler wrote:

Add a CNAME record to your DNS.

Mail delivery is supposed to ignore CNAME records.  Perhaps you meant
to say an MX record.  But either way, the OP's question is still not
answered -- where is the recipient address configured?

My guess would be "in the system's MTA".  I'm guessing the SMART tools
are simply sending to "root" with no domain, and relying on the system's
MTA to fill in the recipient domain.  I'm guessing this MTA is not
configured properly.

The OP should verify this by running something like:

 echo test | mailx -s test root

And see how the message headers get written, and where the message goes.
If it turns out my guesses are right and the MTA is misconfigured, then
we'll know the next steps.

If it turns out my guesses are wrong, and the MTA is fine, then we'll
have to figure out how these SMART tools are configured.
Other mail from that server is being sent properly. It's just the SMART 
messages that are going to the wrong place.




Re: SMART error messages being sent to the wrong address

2023-10-05 Thread Gary Dale

On 2023-10-03 23:39, Charles Curley wrote:

On Tue, 3 Oct 2023 20:57:57 -0400
Gary Dale  wrote:


I can't find where the e-mail address is being set. Tracing down the
smartmontools config files didn't turn up any obvious problems.

The email address is set with the -m option in the file
/etc/smartd.conf. I'd check that to see if you changed it from the
default ('root'). And you should be able to set it to what you want.

No. The -m option is "root".



Re: SMART error messages being sent to the wrong address

2023-10-04 Thread tomas
On Wed, Oct 04, 2023 at 02:43:36AM -0400, Jeffrey Walton wrote:

[...]

> $ sudo su -

...better spelt these days as "sudo -i" (or "sudo -s"), see sudo(1)'s
man page.

> $ grep -iIR fanny /etc

If you are sudoing just for one command, even better:

  sudo grep ...

will do. Besides saving quite a few keystrokes, it has other upsides.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: SMART error messages being sent to the wrong address

2023-10-04 Thread Jeffrey Walton
On Tue, Oct 3, 2023 at 9:32 PM Gary Dale  wrote:
>
> I'm running Debian/Bookworm on a headless server. The box has had a
> variety of roles and names. At one time it was called fanny after the
> groundbreaking rock band and because it had a lot of fans in it. This
> latter attribute led to it being made into a file server and renamed
> BigData.
>
> The problem I'm having is that SMART error messages are being sent to
> root@fanny. instead of to me. /etc/aliases has all mail to
> root going to me, but because this addressed to root on a machine with a
> different name, it goes out and I only get the message when it bounces
> (because the machine name no longer exists).
>
> I can't find where the e-mail address is being set. Tracing down the
> smartmontools config files didn't turn up any obvious problems.
>
> Can anyone point in the right direction?

If Greg and Charles' suggestions do not work, I would grep for it.

$ sudo su -
$ grep -iIR fanny /etc

That should uncover places the old name shows up.

Jeff



Re: SMART error messages being sent to the wrong address

2023-10-03 Thread Charles Curley
On Tue, 3 Oct 2023 20:57:57 -0400
Gary Dale  wrote:

> I can't find where the e-mail address is being set. Tracing down the 
> smartmontools config files didn't turn up any obvious problems.

The email address is set with the -m option in the file
/etc/smartd.conf. I'd check that to see if you changed it from the
default ('root'). And you should be able to set it to what you want.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/



Re: SMART error messages being sent to the wrong address

2023-10-03 Thread Greg Wooledge
On Tue, Oct 03, 2023 at 09:02:39PM -0500, John Hasler wrote:
> Add a CNAME record to your DNS.

Mail delivery is supposed to ignore CNAME records.  Perhaps you meant
to say an MX record.  But either way, the OP's question is still not
answered -- where is the recipient address configured?

My guess would be "in the system's MTA".  I'm guessing the SMART tools
are simply sending to "root" with no domain, and relying on the system's
MTA to fill in the recipient domain.  I'm guessing this MTA is not
configured properly.

The OP should verify this by running something like:

echo test | mailx -s test root

And see how the message headers get written, and where the message goes.
If it turns out my guesses are right and the MTA is misconfigured, then
we'll know the next steps.

If it turns out my guesses are wrong, and the MTA is fine, then we'll
have to figure out how these SMART tools are configured.



Re: SMART error messages being sent to the wrong address

2023-10-03 Thread John Hasler
Add a CNAME record to your DNS.
-- 
John Hasler 
j...@sugarbit.com
Elmwood, WI USA



SMART error messages being sent to the wrong address

2023-10-03 Thread Gary Dale
I'm running Debian/Bookworm on a headless server. The box has had a 
variety of roles and names. At one time it was called fanny after the 
groundbreaking rock band and because it had a lot of fans in it. This 
latter attribute led to it being made into a file server and renamed 
BigData.


The problem I'm having is that SMART error messages are being sent to 
root@fanny. instead of to me. /etc/aliases has all mail to 
root going to me, but because this addressed to root on a machine with a 
different name, it goes out and I only get the message when it bounces 
(because the machine name no longer exists).


I can't find where the e-mail address is being set. Tracing down the 
smartmontools config files didn't turn up any obvious problems.


Can anyone point in the right direction?

Thanks