Zum Inhalt springen

Swaks: Unterschied zwischen den Versionen

Aus Foxwiki
Keine Bearbeitungszusammenfassung
 
(32 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 12: Zeile 12:
== Installation ==
== Installation ==
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo apt install swaks
</syntaxhighlight>
</syntaxhighlight>


Zeile 40: Zeile 41:


== Anwendung ==
== Anwendung ==
=== Ohne Authentifizierung ===
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
</syntaxhighlight>
</syntaxhighlight>


=== 1. Einfacher SMTP-Test (ohne Authentifizierung) ===
Hiermit wird eine einfache E-Mail von Ihrem Server versendet, um zu überprüfen, ob die SMTP-Kommunikation funktioniert:
<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
</syntaxhighlight>
</syntaxhighlight>


<code>swaks --to recipient@example.com --from sender@example.com --server mail.example.com</code>
=== Mit Authentifizierung ===
Bestimmte Ports oder bestimmte Verschlüsselung


=== 2. SMTP-Authentifizierungstest ===
==== SMTP-Authentifizierung ====
Testen Sie den Versand mit SMTP-Authentifizierung (ersetzen Sie die Werte entsprechend):
Versand mit SMTP-Authentifizierung
<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 --auth LOGIN --auth-user username --auth-password password
</syntaxhighlight>
</syntaxhighlight>
<code>swaks --to recipient@example.com --from sender@example.com</code>


==== 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 --server mail.example.com --port 587 --tls
</syntaxhighlight>
</syntaxhighlight>
<code>--server mail.example.com --auth LOGIN</code>


<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 --port 587 -tls
</syntaxhighlight>
</syntaxhighlight>
<code>--auth-user username --auth-password password</code>


=== 3. Testen eines bestimmten Ports oder einer bestimmten Verschlüsselung ===
==== SMTPS auf Port 465 ====
So testen Sie die Verwendung von Port 587 mit STARTTLS:
; 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 --server mail.example.com --port 465 --smtps
</syntaxhighlight>
</syntaxhighlight>
<code>swaks --to recipient@example.com --from sender@example.com</code>


<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 --port 465 -tlsc
</syntaxhighlight>
</syntaxhighlight>
<code>--server mail.example.com --port 587 --tls</code>
So testen Sie SMTPS auf Port 465:
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
<code>swaks --to recipient@example.com --from sender@example.com</code>


==== PLAIN ====
<syntaxhighlight lang="bash" highlight="1" line copy>
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
<code>--server mail.example.com --port 465 --smtps</code>
=== SMTP ohne Authentifizierung testen ===
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
swaks --server <server_to_test> --from absender@example.com --to empfaenger@example.net
=== SMTP mit Authentifizierung (PLAIN) ===
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
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
=== SMTP mit Authentifizierung (SMTPS auf Port 465) ===
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
</syntaxhighlight>
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) ===
=== Tipps zur Fehlerbehebung ===
<syntaxhighlight lang="bash" highlight="1" line copy>
[[Swaks]] liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung
</syntaxhighlight>
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 mit Swaks ===
; Beachten
Swaks liefert detailliertes Feedback zu jedem Schritt der SMTP-Sitzung.
{| class="wikitable options big"
 
! !!
; Achten Sie bei der Fehlerbehebung auf Folgendes
|-
* '''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.
|-
* '''Meldungen „Relay denied“''': Deuten darauf hin, dass der Server nicht für die Weiterleitung von E-Mails über Ihre IP-Adresse konfiguriert ist.
| Authentifizierungsfehler || Falsche Anmeldedaten oder eine deaktivierte SMTP-Authentifizierung
* '''Ablehnung durch den Zielserver''': Suchen Sie nach Hinweisen in der SMTP-Fehlerantwort.
|-
| ''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
; Beispiel für einen Auszugsausschnitt
<syntaxhighlight lang="bash" highlight="1" line copy>
Empfängeradresse existiert auf dem Ziel-Mailserver nicht
<syntaxhighlight lang="bash" highlight="0">
** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**
</syntaxhighlight>
</syntaxhighlight>
<code><** 550 5.1.1 <recipient@example.com>: Empfängeradresse abgelehnt: Benutzer unbekannt**</code>
Dies deutet darauf hin, dass die Empfängeradresse auf dem Ziel-Mailserver nicht existiert.<!-- output -->


<noinclude>
<noinclude>
Zeile 124: Zeile 113:
----
----
-->
-->
== Anhang ==
== Anhang ==
=== 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 138: 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