Mail funktioniert, Sendmail jedoch nicht! (Postfix)

Mail funktioniert, Sendmail jedoch nicht! (Postfix)

Ich habe Postfix auf einem Server installiert und wenn ich eine E-Mail mit dem sendmailBefehl sende, wird sie nicht zugestellt. Wenn ich sie jedoch mit dem mailBefehl sende, wird sie zugestellt. Schlimmer noch: Postfix-Protokolle behaupten, dass die E-Mail zugestellt wurde, wenn ich Folgendes verwende:

Dies zeigen die Protokolle fürecho "test email" | sendmail [email protected]

Sep  4 14:33:03 howtocode1 postfix/pickup[271977]: 38418406E2: uid=0 from=<root>
Sep  4 14:33:03 howtocode1 postfix/cleanup[272164]: 38418406E2: message-id=<[email protected]>
Sep  4 14:33:03 howtocode1 postfix/qmgr[231761]: 38418406E2: from=<[email protected]>, size=295, nrcpt=1 (queue active)
Sep  4 14:33:03 howtocode1 postfix/smtp[272166]: 38418406E2: to=<[email protected]>, relay=mail2.mailinator.com[45.33.83.75]:25, delay=0.06, delays=0.03/0.01/0.01/0.01, dsn=2.0.0, status=sent (250 Ok)
Sep  4 14:33:03 howtocode1 postfix/qmgr[231761]: 38418406E2: removed

Offensichtlich sieht es richtig aus. Aber es wird nie eine E-Mail zugestellt. Aber das hier funktioniert super! Die E-Mail wird verschickt!echo "test email 2" | mail [email protected]

Ich verstehe also nicht, warum in aller Welt dieser mailBefehl funktioniert, aber nicht sendmail. Irgendeine Idee?

Antwort1

Ok, testen wir es direkt:

$ host -t mx mailinator.com
mailinator.com mail is handled by 1 mail.mailinator.com.
mailinator.com mail is handled by 1 mail2.mailinator.com.
➜  ~ telnet mail.mailinator.com 25
Trying 23.239.11.30...
Connected to mail.mailinator.com.
Escape character is '^]'.
220 mail.mailinator.com ESMTP Postfix
EHLO LutzWillek
250-mail.mailinator.com
250-8BITMIME
250-STARTTLS
250 Ok
MAIL FROM:<[email protected]>
250 Ok
RCPT TO:<[email protected]>
250 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: Test from command line

Hello. This is a test message.
.
250 Ok
Connection closed by foreign host.

Dies funktioniert, wie die Nachricht zeigthttps://www.mailinator.com/v4/public/inboxes.jsp?to=sendmail

Aus Ihrem Protokoll geht hervor, dass die Nachricht mit der ID 38418406Eebenfalls gesendet wurde und dass der Remote-Server diese E-Mail akzeptiert hat.

Versuchen Sie es einfach noch einmal,es wird klappen.

Antwort2

Ok, das ist das Seltsamste überhaupt. Das funktioniert nicht:

echo "Subject: 1hello people" | sendmail [email protected]

Aber das funktioniert:

echo "Subject: hello people
>this is the body" | sendmail [email protected]

Wenn also kein Text, sondern nur ein Betreff vorhanden ist, funktioniert es aus irgendeinem Grund nicht. Es wird behauptet, es sei gesendet worden, aber irgendwie wird es nicht akzeptiert oder so. Ich habe versucht, es an andere Orte als Mailinator zu senden und hatte das gleiche Problem.

verwandte Informationen