Jump to content

Diagnostics exception email sent to wrong email address


Phrendo

Recommended Posts

Hello, I happened to have the logging window opened when I ran Diagnostics and noticed these lines show up in logging.

 

Dec 15 13:38:53 NAS sSMTP[23610]: Creating SSL connection to host
Dec 15 13:38:53 NAS sSMTP[23610]: SSL connection using TLS_AES_256_GCM_SHA384
Dec 15 13:38:55 NAS sSMTP[23610]: Sent mail for root@gmail.com (221 2.0.0 closing connection y16sm3292836pfl.69 - gsmtp) uid=0 username=root outbytes=556

 

Sending to [email protected] is odd, but also I did not receive any emails about it on the recipient address that I have configured in Unraid.  I checked the smtp account (which is not the same as my recipient address), to find an email about a missing diagnostic file "Output from your job 16".

 

The email shows TO: root, BCC: my smtp account address.

 

So there seems to be two issues/bugs here.

1) the [email protected] send  (this may only appear to be happening)

2) is the fact that it sent it to my smtp account rather than my recipient account (like all other unraid emails do).

 

Thanks!

Link to comment

@trurl  I appreciate the response.  Right now Diagnostics shows every detail about my shares since I just moved everything to the array so that I can replace my cache NVME.


To be clear though, I am not asking for help here.  Just unofficially reporting a bug, I guess.

Here is what was in the email sent to my SMTP account.  My point is that it sent it to the wrong email address.  Is email config contained within the diagnostics?

Warning: copy(/boot/logs/nas-diagnostics-20211215-1338.zip): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/scripts/diagnostics on line 335

 

 

Link to comment

You think a docker or plugin I have installed is sending an email to the wrong address when I run the built in diagnostics tool?

 

At any rate, I found the actual reason for the error in the diagnostics script. 

 

Line 89 of the diagnostics file runs 'mkdir -p /boot/logs' but only if running diagnostics from cli (which I am not).  It then attempts to copy files to that folder, but only if NOT running from cli on line 335.  I would assume that if a dev has previously ran from CLI, this would not show up as an error, since the folder would exist.  Mine is a new install.  This is a bug in the script.

LINE 89
if ($cli) {
// script is called from CLI
  echo "Starting diagnostics collection... ";
  exert("mkdir -p /boot/logs");
  $server = isset($var['NAME']) ? str_replace(' ','_',strtolower($var['NAME'])) : 'tower';
  $date = date('Ymd-Hi');
  $diag = "$server-diagnostics-$date";
  $zip = "/boot/logs/$diag.zip";
} else {
// script is called from GUI
  $diag = basename($zip, '.zip');
  $split = explode('-', $diag);
  $date = "{$split[2]}-{$split[3]}";
}

 

LINE 335
if ($cli) {
  echo "done.\nZIP file '$zip' created.\n";
} else {
  copy($zip,"/boot/logs/".basename($zip));
}

 

But it still doesn't solve the issue of the diagnostics script sending to the wrong email address.

Link to comment
4 minutes ago, trurl said:

Are you sure you don't have a flash drive problem?

 

 

What would indicate this being a flash drive problem? Perhaps you need to test it on a fresh install.

 

I have Docker service disabled, VM service disabled, my plugins are CA or Dynamix owned.  I installed Unraid just a few days ago on a brand new thumb drive.  I just ran it again, same syslog entry.  With the same email sent to my SMTP account.

Dec 16 10:33:55 NAS sSMTP[32004]: Creating SSL connection to host
Dec 16 10:33:55 NAS sSMTP[32004]: SSL connection using TLS_AES_256_GCM_SHA384
Dec 16 10:33:57 NAS sSMTP[32004]: Sent mail for root@gmail.com (221 2.0.0 closing connection p20sm6855462pfw.96 - gsmtp) uid=0 username=root outbytes=556

 

You seem pretty dismissive about this, I guess it doesn't really matter.  From my perspective it is clearly 2 bugs.

Thanks for the help anyway.

 

Link to comment

One last clue. Here is the original message in my gmail smtp account.  It is sending to root, BCC to my SMTP account.

 

Bcc: [email protected]
Return-Path: <XXXXXXbot@gmail.com>
Received: from NAS (ipx-x-x-x.lv.lv.cox.net. [x.x.x.x])
        by smtp.gmail.com with ESMTPSA id p20sm6855462pfw.96.2021.12.16.10.33.55
        for <XXXXXXBot@gmail.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 16 Dec 2021 10:33:57 -0800 (PST)
Message-ID: <[email protected]>
From: Console and webGui login account <XXXXXXbot@gmail.com>
X-Google-Original-From: "Console and webGui login account" <root@gmail.com>
Received: by NAS (sSMTP sendmail emulation); Thu, 16 Dec 2021 10:33:55 -0800
Date: Thu, 16 Dec 2021 10:33:55 -0800
Subject: Output from your job
       13
To: root


Warning: copy(/boot/logs/nas-diagnostics-20211216-1033.zip): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/scripts/diagnostics on line 335

 

Link to comment
22 minutes ago, Phrendo said:

my plugins are CA or Dynamix owned.

Over the years, I seem to recall some spurious emails caused by plugin updates. They are always works in progress. I have always had my sending and recipient email the same for notifications so wouldn't have noticed if it sent to the sending email.

 

You might try booting in SAFE mode to see if it happens without any plugins.

Link to comment
  • 1 year later...

Did you ever solve this?

 

I'm getting the same errors.

 

<22>Jan  4 09:00:06 SERVER  sSMTP[16696]: Creating SSL connection to host
<22>Jan  4 09:00:07 SERVER  sSMTP[16696]: SSL connection using TLS_AES_256_GCM_SHA384
<19>Jan  4 09:00:11 SERVER  sSMTP[16696]: 550 5.2.254 InvalidRecipientsException; Sender throttled due to continuous invalid recipients errors.; STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message [BeginDiagnosticData]Recipient 'root' is not resolved. All recipients must be resolved before a message can be submitted. InvalidRecipientsException: Recipient 'root' is not resolved. All recipients must be resolved before a message can be submitted.[EndDiagnosticData] [Hostname=REDACTED.namprd14.prod.outlook.com]

Link to comment

In certain conditions (usually when there is unexpected output from a cron job or the 'at' command), Linux will send an email to root of the local server.  If you have email notifications configured that message will get forwarded to your notification email account. It may look like it went to '[email protected]' but clearly it didn't, as it ended up in your account. The fact that the email was sent is not a bug, but ideally the cron job or at command would be fixed to not have unexpected output.

 

It looks like something in the 6.9.2 diagnostics is triggering this for you. There have been many improvements to the diagnostics script in the nearly two years since Unraid 6.9.2 was released. To get them you simply need to upgrade to the latest release of Unraid.

Link to comment

ljm42,

 

I have not really worried about it for over a year, I was just responding to Sunbear asking me out of the blue.  Yes, I can see that it's sending to "root" in the sent folder of my smtp account.  It's still sending the email to wrong recipient address (it's sending it to the smtp account).  Either way, I took your advice and "simply" upgraded to the latest release and now Im wondering why the heck I did that.  It never returned, no ping and the box is just beeping randomly now for 10 minutes. 

Thanks
 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...