[linux-l] PHP mail() geht nicht. Doof.

Peter Ross Peter.Ross at bogen.in-berlin.de
So Sep 20 23:09:04 CEST 2015


Hi Thomas,

nicht direkt.. aber;-)

Ich hatte meit einer Webseite zu tun, in der PHP-Mail zu einer anderen  
Seite immer wieder Probleme bereitete.

Da PHP-mail auch kein Spooling kennt etc. ist das "ganz schoen doof".

Es ist wohl am besten, den Briefversand einer Applikation zu  
ueberlassen, die dafuer "gestrickt" ist: einem lokalen MTA.

Ich habe ueberall einen solchen zu laufen.

Wenn Du postfix konfigurierst, das nur auf IP 127.0.0.1 lauscht, also  
nur lokale Post annimmt (meistens der Default), hast Du eine solche  
Anwendung, die ordentlich logt, bei Problemen ein zweites Mal sendet  
etc.

PHP-Mail kann dann einfach zu localhost schicken und ist alle Sorge los.

Man kann, nebenbei, in postfix auch spezielle Versandrouten fuer  
bestimmte Ziele angeben, in transports, wenn ich mich recht entsinne.

Es gruesst
Peter

Quoting Thomas Schmidt <schmidt at netaction.de>:

> Hallo liebe Liste!
>
> Meine PHP-Seiten sollen über Google Mail ihre Nachrichten senden. Ich
> möchte aber nicht überall das selbe SMTP-Passwort eingeben. Also
> dachte ich, nutze ich das gute alte PHP mail().
>
> Ich habe msmtp als MTA installiert und konfiguriert:
>
> # cat /etc/msmtprc
> account gmail
> tls on
> tls_certcheck off
> auth on
> host smtp.gmail.com
> port 587
> user formmail at netaction.de
> from formmail at netaction.de
> password 5fdsg85df8g
>
>
> Auf der Kommandozeile kann ich dem auch Mails zum Versand geben, das
> geht so halbwegs.
>
> Dann wollte ich PHP anbinden. Der mail()-Befehl meldet einfach false
> zurück, und ich kann nicht herausfinden warum. Es gibt keine
> Fehlermeldung von PHP aus.
>
> Könnt ihr mir beim Debuggen helfen?
>
>
> # tail /var/log/php-mail.log
> [18-Sep-2015 11:59:32 Europe/Berlin] mail() on
> [/www/con/html/mailtest.php:7]: To: schmidt at netaction
> .de -- Headers:
>
>
> # more /etc/php5/apache2/php.ini
> [mail function]
> ; For Win32 only.
> ; http://php.net/smtp
> SMTP = localhost
> ; http://php.net/smtp-port
> smtp_port = 25
>
> ; For Win32 only.
> ; http://php.net/sendmail-from
> ;sendmail_from = me at example.com
>
> ; For Unix only.  You may supply arguments as well (default:  
> "sendmail -t -i").
> ; http://php.net/sendmail-path
> ;sendmail_path =
> sendmail_path = "/usr/bin/msmtp -C /etc/msmtprc --logfile
> /var/log/msmtp.log -a gmail -t"
>
>
> ; Force the addition of the specified parameters to be passed as extra
> parameters
> ; to the sendmail binary. These parameters will always replace the value of
> ; the 5th parameter to mail(), even in safe mode.
> ;mail.force_extra_parameters =
>
> ; Add X-PHP-Originating-Script: that will include uid of the script
> followed by the filename
> mail.add_x_header = On
>
> ; The path to a log file that will log all mail() calls. Log entries include
> ; the full path of the script, line number, To address and headers.
> mail.log = /var/log/php-mail.log
> ; Log mail to syslog (Event Log on NT, not valid in Windows 95).
> ;mail.log = syslog
> _______________________________________________
> linux-l mailing list
> linux-l at mlists.in-berlin.de
> Die Mailingliste der BeLUG (Berliner Linux User Group)
>
> Wenn du diese Mailingliste  abbestellen willst, gehe bitte auf
> https://mlists.in-berlin.de/mailman/listinfo/linux-l-mlists.in-berlin.de
> und trage dich dort bitte aus






Mehr Informationen über die Mailingliste linux-l