Swaks: Unterschied zwischen den Versionen
Erscheinungsbild
Markierung: Zurückgesetzt |
|||
| Zeile 43: | Zeile 43: | ||
=== SMTP-Test (ohne Authentifizierung) === | === SMTP-Test (ohne Authentifizierung) === | ||
Hiermit wird eine einfache E-Mail von Ihrem Server versendet, um zu überprüfen, ob die SMTP-Kommunikation funktioniert: | Hiermit wird eine einfache E-Mail von Ihrem Server versendet, um zu überprüfen, ob die SMTP-Kommunikation funktioniert: | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --to recipient@example.com --from sender@example.com --server mail.example.com | swaks --to recipient@example.com --from sender@example.com --server mail.example.com | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Zeile 49: | Zeile 49: | ||
=== SMTP-Authentifizierungstest === | === SMTP-Authentifizierungstest === | ||
Testen Sie den Versand mit SMTP-Authentifizierung (ersetzen Sie die Werte entsprechend): | Testen Sie den Versand mit SMTP-Authentifizierung (ersetzen Sie die Werte entsprechend): | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --to recipient@example.com --from sender@example.com | swaks --to recipient@example.com --from sender@example.com | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
--server mail.example.com --auth LOGIN | --server mail.example.com --auth LOGIN | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
--auth-user username --auth-password password | --auth-user username --auth-password password | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Zeile 63: | Zeile 63: | ||
=== Bestimmte Ports oder bestimmte Verschlüsselung === | === Bestimmte Ports oder bestimmte Verschlüsselung === | ||
Port 587 mit STARTTLS | Port 587 mit STARTTLS | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --to recipient@example.com --from sender@example.com | swaks --to recipient@example.com --from sender@example.com | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
--server mail.example.com --port 587 --tls | --server mail.example.com --port 587 --tls | ||
</syntaxhighlight> | </syntaxhighlight> | ||
; SMTPS auf Port 465 | ; SMTPS auf Port 465 | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --to recipient@example.com --from sender@example.com | swaks --to recipient@example.com --from sender@example.com | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
--server mail.example.com --port 465 --smtps | --server mail.example.com --port 465 --smtps | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== SMTP ohne Authentifizierung testen === | === SMTP ohne Authentifizierung testen === | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net | swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== SMTP mit Authentifizierung (PLAIN) === | === SMTP mit Authentifizierung (PLAIN) === | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar | swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== SMTP mit Authentifizierung (SMTPS auf Port 465) === | === SMTP mit Authentifizierung (SMTPS auf Port 465) === | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 465 -tlsc | swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 465 -tlsc | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== SMTP mit Authentifizierung (SUBMISSION auf Port 587) === | === SMTP mit Authentifizierung (SUBMISSION auf Port 587) === | ||
<syntaxhighlight lang="bash" highlight="1" | <syntaxhighlight lang="bash" highlight="1" copy> | ||
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 587 -tls | swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 587 -tls | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Version vom 10. Juli 2026, 09:24 Uhr
swaks - Swiss Army Knife for SMTP
Beschreibung
Installation
sudo apt install swaks
Aufruf
Optionen
| Unix | GNU | Parameter | Beschreibung |
|---|---|---|---|
Parameter
Umgebungsvariablen
Exit-Status
| Wert | Beschreibung |
|---|---|
| 0 | Erfolg |
| >0 | Fehler |
Anwendung
SMTP-Test (ohne Authentifizierung)
Hiermit wird eine einfache E-Mail von Ihrem Server versendet, um zu überprüfen, ob die SMTP-Kommunikation funktioniert:
swaks --to recipient@example.com --from sender@example.com --server mail.example.com
SMTP-Authentifizierungstest
Testen Sie den Versand mit SMTP-Authentifizierung (ersetzen Sie die Werte entsprechend):
swaks --to recipient@example.com --from sender@example.com
--server mail.example.com --auth LOGIN
--auth-user username --auth-password password
Bestimmte Ports oder bestimmte Verschlüsselung
Port 587 mit STARTTLS
swaks --to recipient@example.com --from sender@example.com
--server mail.example.com --port 587 --tls
- SMTPS auf Port 465
swaks --to recipient@example.com --from sender@example.com
--server mail.example.com --port 465 --smtps
SMTP ohne Authentifizierung testen
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net
SMTP mit Authentifizierung (PLAIN)
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar
SMTP mit Authentifizierung (SMTPS auf Port 465)
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 465 -tlsc
SMTP mit Authentifizierung (SUBMISSION auf Port 587)
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar --port 587 -tls
Tipps zur Fehlerbehebung
Swaks liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung
- Achten Sie bei der Fehlerbehebung auf Folgendes
- DNS-Auflösungsfehler: Können auf falsche MX- oder A-Einträge hinweisen.
- Authentifizierungsfehler: Können auf falsche Anmeldedaten oder eine deaktivierte SMTP-Authentifizierung hinweisen.
- Meldungen „Relay denied“: Deuten darauf hin, dass der Server nicht für die Weiterleitung von E-Mails über Ihre IP-Adresse konfiguriert ist.
- Ablehnung durch den Zielserver: Suchen Sie nach Hinweisen in der SMTP-Fehlerantwort.
- Beispiel für einen Auszugsausschnitt
** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**
Dies deutet darauf hin, dass die Empfängeradresse auf dem Ziel-Mailserver nicht existiert.
Anhang
Siehe auch
Dokumentation
- Man-Page
Links
Projekt
Weblinks