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

Thomas Schmidt schmidt at netaction.de
Fr Sep 18 14:41:56 CEST 2015


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



Mehr Informationen über die Mailingliste linux-l