nexus-courier ist ein robustes Bash-Skript, das entwickelt wurde, um Statusberichte oder Log-Dateien von Linux-Servern automatisiert per E-Mail zu versenden. Es ist darauf ausgelegt, in komplexen Netzwerkinfrastrukturen als zuverlässiger Bote (Courier) zu fungieren.
- Flexibel: Empfänger kann direkt beim Aufruf als Parameter übergeben werden.
- Robust: Prüft Abhängigkeiten (
msmtp,cat) und die Existenz der Konfigurationsdatei vor dem Versand. - Dokumentiert: Eingebaute Hilfe-Funktion (
-h). - Headless-Ready: Ideal für Debian/ Ubuntu Umgebungen.
- Stelle sicher, dass
msmtpinstalliert ist. - Konfiguriere die SMTP-Verbindung über
~/.msmtprc(siehe unten). - Für eine sichere Passwortverwaltung nutze das Hilfsskript
pw-datei-erstellen.sh, um deine verschlüsselte Konfiguration vorzubereiten. - Setze Ausführungsrechte:
chmod +x nexus-courier.sh
Erstelle die Datei ~/.msmtprc und passe sie an deinen SMTP-Anbieter an:
# msmtp Konfiguration - STARK VERSCHLÜSSELT (TLS-Tunnel)
defaults
auth on
tls on
tls_starttls off
tls_certcheck on
logfile ~/.msmtp.log
# Strato Account
account strato
host smtp.strato.de
port 465
from DEINE_EMAIL_ADRESSE
user DEIN_BENUTZERNAME
# Hier liest msmtp das Passwort direkt aus der isolierten Datei
passwordeval cat ~/.msmtp_pw
# Setze Strato als Standard
account default : strato
Wichtig:
- Schütze die Datei:
chmod 600 ~/.msmtprc - Nutze
./pw-datei-erstellen.sh, um dein Passwort in~/.msmtp-password.gpgzu speichern, damit es nicht im Klartext in der Konfiguration liegt.
./nexus-courier.sh [EMPFÄNGER]
nexus-courier is a robust bash script designed to automatically send status reports or log files from Linux servers via email. It is built to serve as a reliable courier within complex network infrastructures.
- Flexible: Recipient can be passed as a parameter during execution.
- Robust: Validates dependencies (
msmtp,cat) and configuration file existence before sending. - Documented: Built-in help function (
-h). - Headless-Ready: Ideal for Debian / Ubuntu environments.
- Ensure
msmtpis installed. - Configure the SMTP connection via
~/.msmtprc(see below). - For secure password management, use the helper script
pw-datei-erstellen.shto prepare your encrypted configuration. - Set execution permission:
chmod +x nexus-courier.sh
Create the ~/.msmtprc file and adjust it to your SMTP provider:
# msmtp Konfiguration - STARK VERSCHLÜSSELT (TLS-Tunnel)
defaults
auth on
tls on
tls_starttls off
tls_certcheck on
logfile ~/.msmtp.log
# Strato Account
account strato
host smtp.strato.de
port 465
from DEINE_EMAIL_ADRESSE
user DEIN_BENUTZERNAME
# Hier liest msmtp das Passwort direkt aus der isolierten Datei
passwordeval cat ~/.msmtp_pw
# Setze Strato als Standard
account default : strato
#EOF
Important:
- Secure the file:
chmod 600 ~/.msmtprc - Use
./pw-datei-erstellen.shto save your password in~/.msmtp-password.gpgto avoid storing plain text passwords in your configuration.
./nexus-courier.sh [RECIPIENT]
#EOF