Zum Inhalt springen

Swaks: Unterschied zwischen den Versionen

Aus Foxwiki
 
(24 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 41: Zeile 41:


== Anwendung ==
== Anwendung ==
=== SMTP ohne Authentifizierung ===
=== Ohne Authentifizierung ===
Hiermit wird eine einfache E-Mail von Ihrem Server versendet, um zu überprüfen, ob die SMTP-Kommunikation funktioniert:
Einfache E-Mail versenden, um die SMTP-Kommunikation zu prüfen
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line 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>


=== SMTP mit Authentifizierung ===
Testen Sie den Versand mit SMTP-Authentifizierung (ersetzen Sie die Werte entsprechend):
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
swaks --to recipient@example.com --from sender@example.com
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="bash" highlight="1" line copy>
=== Mit Authentifizierung ===
--server mail.example.com --auth LOGIN
Bestimmte Ports oder bestimmte Verschlüsselung
</syntaxhighlight>


==== SMTP-Authentifizierung ====
Versand mit SMTP-Authentifizierung
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
--auth-user username --auth-password password
swaks --to recipient@example.com --from sender@example.com --server mail.example.com --auth LOGIN --auth-user username --auth-password password
</syntaxhighlight>
</syntaxhighlight>


=== Bestimmte Ports oder bestimmte Verschlüsselung ===
==== Port 587 mit STARTTLS ====
Port 587 mit STARTTLS
; SMTP mit Authentifizierung (SUBMISSION auf Port 587)
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
swaks --to recipient@example.com --from sender@example.com  
swaks --to recipient@example.com --from sender@example.com --server mail.example.com --port 587 --tls
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
--server mail.example.com --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>


; SMTPS auf Port 465
==== SMTPS auf Port 465 ====
; SMTP mit Authentifizierung (SMTPS auf Port 465)
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
swaks --to recipient@example.com --from sender@example.com  
swaks --to recipient@example.com --from sender@example.com --server mail.example.com --port 465 --smtps
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
--server mail.example.com --port 465 --smtps
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 ohne Authentifizierung testen ===
==== PLAIN ====
<syntaxhighlight lang="bash" highlight="1" line copy>
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net
</syntaxhighlight>
 
=== SMTP mit Authentifizierung (PLAIN) ===
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line 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>
=== SMTP mit Authentifizierung (SMTPS auf Port 465) ===
<syntaxhighlight lang="bash" highlight="1" line 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
</syntaxhighlight>
=== SMTP mit Authentifizierung (SUBMISSION auf Port 587) ===
<syntaxhighlight lang="bash" highlight="1" line 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
</syntaxhighlight>
</syntaxhighlight>


=== Tipps zur Fehlerbehebung ===
=== Tipps zur Fehlerbehebung ===
Swaks liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung
[[Swaks]] liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung


; Achten Sie bei der Fehlerbehebung auf Folgendes
; Beachten
{| class="wikitable options big"
{| class="wikitable options big"
! !!
! !!
|-
|-
| DNS-Auflösungsfehler || Können auf falsche MX- oder A-Einträge hinweisen
| DNS-Auflösungsfehler || Falsche MX- oder A-Einträge
|-
|-
| Authentifizierungsfehler || Können auf falsche Anmeldedaten oder eine deaktivierte SMTP-Authentifizierung hinweisen
| Authentifizierungsfehler || Falsche Anmeldedaten oder eine deaktivierte SMTP-Authentifizierung
|-
|-
| Meldungen „Relay denied“ || Deuten darauf hin, dass der Server nicht für die Weiterleitung von E-Mails über Ihre IP-Adresse konfiguriert ist
| ''Relay denied'' || Server nicht für die Weiterleitung von E-Mails über Ihre IP-Adresse konfiguriert
|-
|-
| Ablehnung durch den Zielserver || Suchen Sie nach Hinweisen in der SMTP-Fehlerantwort
| Ablehnung durch den Zielserver || Suchen Sie nach Hinweisen in der SMTP-Fehlerantwort
Zeile 117: Zeile 102:


; Beispiel für einen Auszugsausschnitt
; Beispiel für einen Auszugsausschnitt
Empfängeradresse existiert auf dem Ziel-Mailserver nicht
<syntaxhighlight lang="bash" highlight="0">
<syntaxhighlight lang="bash" highlight="0">
** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**
** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**
</syntaxhighlight>
</syntaxhighlight>
Dies deutet darauf hin, dass die Empfängeradresse auf dem Ziel-Mailserver nicht existiert.


<noinclude>
<noinclude>
Zeile 133: Zeile 117:
=== Siehe auch ===
=== Siehe auch ===
<div style="column-count:2">
<div style="column-count:2">
<categorytree hideroot=on mode="pages">{{BASEPAGENAME}}</categorytree>
<categorytree hideroot=on mode="pages">E-Mail</categorytree>
</div>
</div>
----
----
Zeile 144: Zeile 128:
=== Links ===
=== Links ===
==== Projekt ====
==== Projekt ====
# https://jetmore.org/john/code/swaks/
# https://github.com/jetmore/swaks
==== Weblinks ====
==== Weblinks ====



Aktuelle Version vom 10. Juli 2026, 10:19 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

Ohne Authentifizierung

Einfache E-Mail versenden, um die SMTP-Kommunikation zu prüfen

swaks --to recipient@example.com --from sender@example.com --server mail.example.com
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net

Mit Authentifizierung

Bestimmte Ports oder bestimmte Verschlüsselung

SMTP-Authentifizierung

Versand mit SMTP-Authentifizierung

swaks --to recipient@example.com --from sender@example.com --server mail.example.com --auth LOGIN --auth-user username --auth-password password

Port 587 mit STARTTLS

SMTP mit Authentifizierung (SUBMISSION auf Port 587)
swaks --to recipient@example.com --from sender@example.com --server mail.example.com --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

SMTPS auf Port 465

SMTP mit Authentifizierung (SMTPS auf Port 465)
swaks --to recipient@example.com --from sender@example.com --server mail.example.com --port 465 --smtps
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

PLAIN

swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net --auth --auth-user absender@example.com --auth-password foobar

Tipps zur Fehlerbehebung

Swaks liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung

Beachten
DNS-Auflösungsfehler Falsche MX- oder A-Einträge
Authentifizierungsfehler Falsche Anmeldedaten oder eine deaktivierte SMTP-Authentifizierung
Relay denied Server nicht für die Weiterleitung von E-Mails über Ihre IP-Adresse konfiguriert
Ablehnung durch den Zielserver Suchen Sie nach Hinweisen in der SMTP-Fehlerantwort
Beispiel für einen Auszugsausschnitt

Empfängeradresse existiert auf dem Ziel-Mailserver nicht

** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**


Anhang

Siehe auch



Dokumentation

Man-Page
  1. swaks(1)

Projekt

  1. https://jetmore.org/john/code/swaks/
  2. https://github.com/jetmore/swaks