Turris notifikace

Ahoj,

už delší dobu si uvědomuji, že mi vlastně nechodí notifikace. Mám nastaveno standradní nastavení přes Turris smtp server. Všiml jsem si, že už se to tady nárazově řešilo, ale bez nějakého konkrétního výsledku a vlastní přeposílač nemám.

obrazek

Platí ještě stará logika?
/usr/sbin/sendmail → ../bin/msmtp
The Turris Omnia uses msmtp as its mail sending agent, configured via /etc/msmtprc

Zpráva se mi sice do /tmp uloží, ale /usr/sbin/sendmail jsem nenašel a msmtprc má poslední úpravu z roku 2023 :

# Example for a system wide configuration file

# A system wide configuration file is optional.
# If it exists, it usually defines a default account.
# This allows msmtp to be used like /usr/sbin/sendmail.
account default

# The SMTP smarthost
host mail.oursite.example

# Use TLS on port 465. On this port, TLS starts without STARTTLS.
port 465
tls on
tls_starttls off

# Construct envelope-from addresses of the form "user@oursite.example"
from %U@oursite.example
# Do not allow programs to override this envelope-from address via -f
allow_from_override off
# Always set a From header that matches the envelope-from address
set_from_header on

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL

Očekával bych smtp.turris.cz a auth parametry?, čemuž i odpovídá test:

# msmtp -S
msmtp: cannot locate host mail.oursite.example: Name does not resolve

Pokud pouze upravím from, tak to nestačí, nicméně předpokládám, že nastavení by se mělo měnit na základě úpravy v reForis.

# msmtp -S
msmtp: cannot connect to smtp.turris.cz, port 465: Connection refused

Mám Omnii a Turris OS 7.1.4 a nastavení notifikací je v /etc/config/user_notify:

config smtp 'smtp'
        option use_turris_smtp '1'
        option sender_name 'turris'
        option enable '1'
        list to 'moje_adresa@domain.tld'

config notifications 'notifications'
        option news '1'
        option severity '2'

config reboot 'reboot'
        option time '04:30'
        option delay '7'

Ano, to mám shodně. Zde bych řekl, že je soubor aktuální, reaguje mi na změny zadané v reforisu. Podle mě je chyba na straně anstavení samotného msmtp.

Používám Notitier prakticky od začátku nasazení routeru TO (TO 2016, HBS branch, TurrisOS 7.1.4), prakticky bez problémů :wink:

Konfigurace “user_notify” je téměř shodná

/etc/config/user_notify
config smtp 'smtp'

        option use_turris_smtp '1'
        option enable '1'
        option sender_name '`myrouter`'
        list to '`myaddress`'

config notifications 'notifications'
        option news '1'
        option severity '3'

config reboot 'reboot'
        option time '01:00'
        option delay '0'

Konfigurace /etc/msmtprc se ale na několika místech liší, především řádek

je zapoznámkován, a dále některé údaje jsou jinak…

/etc/msmtprc
# Example for a system wide configuration file
# for details see forum:
# Guide for setting custom email notifications through turris.cz
# https://forum.turris.cz/t/guide-for-setting-custom-email-notifications-through-turris-cz/2318

# A system wide configuration file is optional.
# If it exists, it usually defines a default account.
# This allows msmtp to be used like /usr/sbin/sendmail.
account default

# The SMTP smarthost
#host mail.oursite.example

# account notifier
from turris@notify.turris.cz
host smtp.turris.cz
# host smtp.seznam.cz

# Use TLS on port 465
port 465
tls on
tls_certcheck off
tls_starttls off
auth on
# user is router serial number, found by command `atsha204cmd serial-number`
# password is generated by passwordeval command
user `my_router_serial`
passwordeval "echo 'efefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefef' | atsha204cmd challenge-response | awk '{print tolower($0)}'"
timeout 5
# account default : notifier
# account notifier : default

syslog LOG_MAIL
aliases /etc/aliases

# Construct envelope-from addresses of the form "user@oursite.example"
#from %U@oursite.example

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
#syslog LOG_MAIL

Ano, ten host jsem už měnil, zkusil jsem okopčit i ten zbytek, ale i tak dostanu, opět:

msmtp: cannot connect to smtp.turris.cz, port 465: Connection refused

Nicméně to může způsobeno špatnou autentifikací. Stejně potřebuji, aby se inicializovala tato změna, což se neprovádí, vidno si služba pro změnu souboru vůbec nešáhne.

Dle starých údajů z původní wiki jsem passwordeval nenašel. Nicméně jsme se zkusil řídit následujícím,

pro usera jsem použil:

$ echo “$(crypto-wrapper serial-number)@notify.turris.cz

heslo (z roku 2020) jsem našel v

/etc/sentinel/mailpass

Ale jsem stále na stejném. Každopádně stále si myslím, že celou změnu by mělo spustit změna/uložení v reforis nastavení v notifikaci. Zkusil jsem přeinstalovat msmtp balík, dostal jsem tím opět defaul konfiguraci viz výše. A k tomu mi nějak turrisák vykysl a po rebootu jsem nenačetl web. Přes pkgupdate jsem musel doinstalovat chybějící. Takže aby nebyla nuda :smiley: