NAS540 - Troubleshooting email settings

Options
MV10
MV10 Posts: 13  Freshman Member
edited July 2020 in Personal Cloud Storage
As far as I can tell, the NAS540 can only send email to the unencrypted SMTP port 25 (which is ridiculous). Because of this, I set up E-Mail Relay on a Raspberry Pi to forward to GMail's TLS SMTP. I know it works, I did a quick telnet test from my Windows desktop. I don't currently have it configured to require credentials which means the NAS configuration ought to be dead easy:

To: me@gmail.com
From: backup-NAS@foo.com
Server: raspberrypi.local

But all I get is that terse, useless, "Error" message. Is there a log somewhere, maybe something I can ssh into and tail follow?

#NAS_July_2020
«1

All Replies

  • MV10
    MV10 Posts: 13  Freshman Member
    Options
    For what it's worth, I can telnet from the NAS to the mail relay over ssh so it isn't basic connectivity -- which I knew since the Pi writes to the NAS itself, but I wasn't having ideas about anything else to try.
  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    You can run tcpdump on the Pi, or something like that, to read the SMTP conversation.
  • MV10
    MV10 Posts: 13  Freshman Member
    edited July 2020
    Options
    Running this on the Pi shows nothing, which suggests the NAS isn't even trying to connect (that IP is the NAS).

    sudo tcpdump -i any -nn src 192.168.1.200 and port 25

    Pretty sure that command is ok, if I ssh to the NAS and telnet to port 25, the Pi does respond with the 220 Email Relay message, and tcpdump does show traffic in the Pi terminal:

    07:23:32.037167 IP 192.168.1.200.35326 > 192.168.1.16.25: Flags [S], seq 418944381, win 14600, options [mss 1460,nop,nop,TS val 68997187 ecr 0,nop,wscale 5], length 0<br>07:23:32.039579 IP 192.168.1.200.35326 > 192.168.1.16.25: Flags [.], ack 1790121067, win 457, options [nop,nop,TS val 68997196 ecr 1190322094], length 0<br>07:23:32.045267 IP 192.168.1.200.35326 > 192.168.1.16.25: Flags [.], ack 56, win 457, options [nop,nop,TS val 68997197 ecr 1190322097], length 0<br><br>

    (Wow, this forum software is truly awful ... the above only shows part of what I pasted into the editor -- but you get the idea.)

    The NAS accepts "raspberrypi.local" as the SMTP server, but I think those are served by mDNS (multicast) and not regular DNS (router/public), so maybe name resolution fails? (It's absurd that it won't just accept an IP address... who writes this stuff???)

    I kind of wonder about monitoring traffic on the NAS itself. I don't know anything about BusyBox, can tcpdump be installed on the NAS? Is that a Really Bad Idea for some reason? My NAS doesn't do anything but run the single-volume RAID5 array, I don't have other optional apps installed or running except rsync backups, so space isn't an issue.

    I did try "install tcpdump" but apparently it's more complicated than that (I've been spoiled by apt-get).


  • MV10
    MV10 Posts: 13  Freshman Member
    Options
    Realized I can tcpdump the mDNS port (5353) on the Pi and it does seem that the NAS tries to resolve "raspberrypi.local" when I hit the apply button to send the test email.
  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    You can add raspberrypi.local to /etc/hosts, to test if it's a dns issue. Unfortunately that is not a direct solution, as it's a volatile file.

    And no, it's not a 'bad idea' to install tcpdump. But 'install tcpdump' indeed won't work. The only available package manager is the one in the webinterface, although I think it has a commandline interface either.

    But you can install Entware-ng, which has a big repository. You could install an smtp relay on the nas itself (and look in /etc/hosts which hostname can be used)
  • MV10
    MV10 Posts: 13  Freshman Member
    edited July 2020
    Options
    Thanks for the ideas. I'm trying to understand the scope of change that installing Entware implies (I'm an experienced developer, ~40 years, but have only been playing with Linux for a couple months). It looks pretty interesting, the same email relay I already added to the Pi is even there.

    Would it replace BusyBox? No impact to the GUI? (I only care about the RAID / Volume management and maintenance -- not ready to go console-commando for that stuff yet.)

    Thinking the NAS542 instructions are probably close enough:

    https://github.com/Entware/Entware/wiki/Install-on-Zyxel-NAS542

  • MV10
    MV10 Posts: 13  Freshman Member
    Options
    Oh, I see, it's just a package manager. Very cool. I'll give it a shot.
  • MV10
    MV10 Posts: 13  Freshman Member
    edited July 2020
    Options
    Hmm... those instructions leave a bit to be desired (er... learning opportunity).

    I had a thought while working on installation -- will a firmware update wipe all of this out? (I'm vaguely aware this can be set up on a USB drive, are there instructions somewhere?)

    Edit: I'm stuck at step 5 of the Entware instructions linked earlier at step 5 -- modifying the path automatically at startup. On desktop Linux I understand how to do this, but I'm not sure what folders are "real" (will survive reboot) on the NAS. I'd appreciate some tips/advice. (I'd need to ask this eventually to set up the email relay!)

    On the plus side, once I get it working I'll go ahead and update those ZyXel install instructions with corrections and details to help the next guy.
  • Mijzelf
    Mijzelf Posts: 2,639  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options
    There is an easier way, you can use the firmware package manager, after you install MetaRepository. (Scroll down for instructions)
  • MV10
    MV10 Posts: 13  Freshman Member
    Options
    Thanks, installing your meta repo is easy, but I don't understand what that simplifies for me regarding Entware. (I am installing it anyway though, it has nano, and vi gives me a headache!)

Consumer Product Help Center