Also habe ich versucht, ein ziemlich einfaches Skript zu schreiben, und ein Teil davon sendet eine E-Mail. Die Sache ist, dass Skript ohne Fehler läuft, alles funktioniert, aber ich bekomme diese E-Mail nie. Und ich glaube, dass ein Gmail Pop-up kommen sollte, wenn es erfolgreich war, ich verstehe das auch nicht. Durch dieses Tutorial gegangen: https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/
, aber das Problem besteht immer noch. Irgendwelche Ideen, was könnte hier gemacht werden?Senden einer E-Mail mit bash/ubuntu
Ich habe gerade versucht zu testen und eine E-Mail von Terminal-Fenstern zu senden - gleiche
Die einzige Warnung im Zusammenhang mit main.cf
Datei "warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost ="
war und es ein großer Haufen von denen, obwohl Skript nur heute zweimal ausgeführt wurde. Linie 42 in main.cf-Datei ist "relayhost = [smtp.gmail.com]:587"
Linie für die es in dem Skript, das ich verwende, ist
`mail -s "Subject" -A "info.$NOW.log" [email protected]`
Logs: Sep 12 09:59:55 shroomz-VirtualBox postfix/qmgr[5372]: 3D892636CF: from=<[email protected]>, size=370, nrcpt=1 (queue active) Sep 12 09:59:55 shroomz-VirtualBox postfix/trivial-rewrite[5481]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 09:59:55 shroomz-VirtualBox postfix/smtp[5482]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 09:59:55 shroomz-VirtualBox postfix/tlsmgr[5483]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/sendmail[5486]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/postdrop[5487]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/cleanup[5488]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/pickup[5371]: 865D06267A: uid=1000 from=<[email protected]> Sep 12 10:00:03 shroomz-VirtualBox postfix/cleanup[5488]: 865D06267A: message-id=<[email protected]> Sep 12 10:00:03 shroomz-VirtualBox postfix/qmgr[5372]: 865D06267A: from=<[email protected]>, size=399, nrcpt=1 (queue active) Sep 12 10:00:03 shroomz-VirtualBox postfix/local[5489]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/bounce[5490]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/local[5489]: 865D06267A: to=<[email protected]>, relay=local, delay=0.04, delays=0.02/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "sarunas.petkevicius") Sep 12 10:00:03 shroomz-VirtualBox postfix/cleanup[5488]: 8DBE26267C: message-id=<[email protected]> Sep 12 10:00:03 shroomz-VirtualBox postfix/bounce[5491]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:03 shroomz-VirtualBox postfix/qmgr[5372]: 8DBE26267C: from=<>, size=2406, nrcpt=1 (queue active) Sep 12 10:00:03 shroomz-VirtualBox postfix/bounce[5490]: 865D06267A: sender non-delivery notification: 8DBE26267C Sep 12 10:00:03 shroomz-VirtualBox postfix/qmgr[5372]: 865D06267A: removed Sep 12 10:00:03 shroomz-VirtualBox postfix/local[5489]: 8DBE26267C: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox) Sep 12 10:00:03 shroomz-VirtualBox postfix/qmgr[5372]: 8DBE26267C: removed Sep 12 10:00:25 shroomz-VirtualBox postfix/smtp[5482]: connect to smtp.gmail.com[74.125.206.108]:587: Connection timed out Sep 12 10:00:25 shroomz-VirtualBox postfix/smtp[5482]: connect to smtp.gmail.com[2a00:1450:400c:c04::6c]:587: Network is unreachable Sep 12 10:00:55 shroomz-VirtualBox postfix/smtp[5482]: connect to smtp.gmail.com[74.125.206.109]:587: Connection timed out Sep 12 10:00:55 shroomz-VirtualBox postfix/bounce[5494]: warning: /etc/postfix/main.cf, line 42: overriding earlier entry: relayhost= Sep 12 10:00:55 shroomz-VirtualBox postfix/smtp[5482]: 3D892636CF: to=<[email protected]>, relay=none, delay=229326, delays=229266/0.06/60/0, dsn=4.4.1, status=deferred (connect to smtp.gmail.com[74.125.206.109]:587: Connection timed out)
Bitte bearbeiten Sie Ihre Frage und fügen Sie Folgendes hinzu: Der Inhalt von 'main.cf' Fehlern in'/var/log/mail.log' und Ihr sendender Befehl vom Skript. –
Ich hoffe, ich habe jetzt alles klar gemacht :) –
Sie haben Konfigurationsproblem, bitte Inhalte der main.cf, posten Sie -v zu master.cf wie folgt 'smtp inet n - - - - smtpd -v' und starten Sie den postfix-Dienst neu , dann sende eine andere E-Mail und poste den Inhalt von '/ var/log/mail.log' –