Romaq / bigrig-scripts

A series of BASH scripts for setting up a bare-metal device as a "large scale hypervisor" with Proxmox
The Unlicense
0 stars 0 forks source link

Notifications: PVE will not accept SMTP notices from the local network. #4

Open Romaq opened 1 month ago

Romaq commented 1 month ago

SMTP Email notification is an issue. PVE.md does get to the point of self-sending email notifications, but at the time of testing, it would not receive .local network email for outbound relay.

The primary issue is "notification". A secondary issue is "mail notice non-local recipients," such as for password resets or other specific interaction with an outbound facing server.

I'm going to spend limited time on the "notification" side, then consider using Gotify. It appears a client for this is built into Proxmox. It only needs a server which can be built into the DNS.md instructions.

The DNS host is not a single "Turnkey Linux (TKL)" united, it has to be built. Since it must be built, and to some extent monitored and maintained, it is logical to use this host to carry critical services.

IF I can have SMTP behave on Proxmox to send/ receive email notices, I will consider the "gotify" option later. If I can't have PVE accept localnet email and properly forward... I can't get lost with moving things forward, and gotify will become a requirement.

Romaq commented 1 month ago

Yeah... while I thought I restarted postfix, a reboot has the SMTP "listen" to the localnetwork according to a direct telnet from omenx.

Now to verify the DNS host will receive notification email.

Romaq commented 1 month ago

DNS sends out email as expected, received by PVE with the following error:

May 25 16:58:10 dns postfix/pickup[3601]: 08861DDC3: uid=0 from=<root>
May 25 16:58:10 dns postfix/cleanup[4673]: 08861DDC3: message-id=<20240525165810.08861DDC3@core>
May 25 16:58:10 dns postfix/qmgr[3602]: 08861DDC3: from=<root@dns.mik-maq.com>, size=395, nrcpt=1 (queue active)
May 25 16:58:10 dns postfix/smtp[4675]: 08861DDC3: to=<romaqrosher@gmail.com>, relay=192.168.4.45[192.168.4.45]:25, delay=0.06, delays=0.01/0.01/0.03/0.01, dsn=4.3.0, status=deferred (host 192.168.4.45[192.168.4.45] said: 451 4.3.0 <romaqrosher@gmail.com>: Temporary lookup failure (in reply to RCPT TO command))
May 25 17:02:04 dns postfix/qmgr[3602]: 8D1F492B4: from=<root@core>, size=683, nrcpt=1 (queue active)
May 25 17:02:04 dns postfix/smtp[4685]: 8D1F492B4: to=<asmith@mik-maq.com>, orig_to=<root>, relay=192.168.4.45[192.168.4.45]:25, delay=558, delays=558/0.01/0.03/0.01, dsn=4.3.0, status=deferred (host 192.168.4.45[192.168.4.45] said: 451 4.3.0 <asmith@mik-maq.com>: Temporary lookup failure (in reply to RCPT TO command))
May 25 17:07:04 dns postfix/qmgr[3602]: 08861DDC3: from=<root@dns.mik-maq.com>, size=395, nrcpt=1 (queue active)
May 25 17:07:04 dns postfix/smtp[4698]: 08861DDC3: to=<romaqrosher@gmail.com>, relay=192.168.4.45[192.168.4.45]:25, delay=534, delays=534/0.01/0.03/0.01, dsn=4.3.0, status=deferred (host 192.168.4.45[192.168.4.45] said: 451 4.3.0 <romaqrosher@gmail.com>: Temporary lookup failure (in reply to RCPT TO command))

I'm guessing GMail is looking at that and going, "I don't think so." Or Sendmail/ Postfix is confused by who it's being directed to. Let me see if I need to manipulate the incoming header to allow it to work.

Romaq commented 1 month ago

Using Telnet from my Windows client, I used the following howto to test send email. I have the following result on connection:

220 pve.mik-maq.com ESMTP Postfix (Debian/GNU)
EHLO 192.168.4.45
250-pve.mik-maq.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
MAIL FROM:<root@dns>
501 5.1.7 Bad sender address syntax
MAIL FROM:<root@core>
250 2.1.0 Ok
RCPT TO:<asmith@mik-maq.com> NOTIFY=success,failure
501 5.5.4 Error: Bad NOTIFY parameter syntax
Subject: Test from OmenX
221 2.7.0 Error: I can break rules, too. Goodbye.

Connection to host lost.

Press any key to continue...

That did not go well. I'll try again "without frills." AND... it did not go well either. I suspect I have to configure Postfix with more than I currently have expertise. "The Point" is "yell to me if something fails."

It's time to turn my attention to gotify.