Probleme mit Mailversand unter PHP 7

  • Servus!

    Beim Mailversand über Sendmail unter PHP 7 erhalte ich einen HTTP 500 Fehler mit diesen Einträgen im Log:

    Error-Log:

    Code
    2016-01-01 22:29:11	Warning	XXX.XXX.XXX.XXX (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://xxxxxx.net/index.php?lost-password/& Apache-Fehler
    2016-01-01 22:29:11	Error	XXX.XXX.XXX.XXX	Premature end of script headers: index.php, referer: http://xxxxxx.net/index.php?lost-password/&


    Maillog:

    Code
    Jan 3 03:30:38 server postfix/qmgr[50178]: CDB851BE2B3B:
    from=<web2@xxxxxx.de>, size=389, nrcpt=1 (queue active)
    Jan 3 03:30:39 server postfix/smtp[12125]: CDB851BE2B3B:
    to=<xxxx@unet.univie.ac.at>, relay=zidmx2.univie.ac.at[131.130.3.101]:25,
    delay=1.8, delays=0.3/0.01/1.4/0.12, dsn=5.0.0, status=bounced (host
    zidmx2.univie.ac.at[131.130.3.101] said: 550-Verification failed for
    <web2@xxxxxx.de> 550-can't route web2@xxxxxx.de 550 Sender verify failed
    (in reply to RCPT TO command))

    WCF Log bei SMTP (Egal ob Port 465 oder 587):

    Danke für eure Hilfe!


    Sebastian

  • I'll preface this by apologizing that I don't speak German.
    What was the prior version of PHP that you were on?
    If pre-5.6, then odds are the issue is that the verify_peer and verify_peer_name needs to be set to false if you are using the PHP mail feature/function of the script.
    I think those options can be set in the php.ini that is read by the PHP processor (you can find where it is by creating a php info page and it will show the path to the .INI file in it
    this is where it is on one of my servers.

  • I'll preface this by apologizing that I don't speak German.
    What was the prior version of PHP that you were on?
    If pre-5.6, then odds are the issue is that the verify_peer and verify_peer_name needs to be set to false if you are using the PHP mail feature/function of the script.
    I think those options can be set in the php.ini that is read by the PHP processor (you can find where it is by creating a php info page and it will show the path to the .INI file in it
    this is where it is on one of my servers.


    Server OS Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-74-generic x86_64)

    WBB PHP Mail Function:

    5.5.9 by OS vendor Apache-Modul (WCF PHP-Mail works)
    5.5.9 by OS vendor FPM (WCF PHP-Mail works)
    5.5.9 by OS vendor FastCGI (WCF PHP-Mail works)
    5.6.16 FPM (WCF PHP-Mail works)
    5.6.16 FastCGI (WCF PHP-Mail works)
    7.0.1 FPM (WCF PHP-Mail don't works)
    7.0.1 FastCGI (WCF PHP-Mail don't works)

    Apache Error-Log

    Code
    [Wed Jan 13 00:34:02.375665 2016] [fcgid:warn] [pid 12371] (104)Connection reset by peer: [client 0.0.0.0:57608] mod_fcgid: error reading data from FastCGI server, referer: http://www.forum.tld/acp/index.php?user-mail/&
    [Wed Jan 13 00:34:02.375700 2016] [core:error] [pid 12371] [client 0.0.0.0:57608] End of script output before headers: index.php, referer: http://www.forum.tld/acp/index.php?user-mail/&


    PHP Test-Skript

    PHP
    <?php
    $empfaenger = "empf@domain.de";
    $betreff = "Die Mail-Funktion";
    $from = "From: Nils Reimers <absender@domain.de>\n";
    $from .= "Reply-To: antwort@domain.de\n";
    $from .= "Content-Type: text/html\n";
    $text = "Hier lernt Ihr, wie man mit <b>PHP</b> Mails
    verschickt";
    mail($empfaenger, $betreff, $text, $from);
    ?>

    5.5.9 by OS vendor Apache-Modul (works)
    5.5.9 by OS vendor FPM (works)
    5.5.9 by OS vendor FastCGI (works)
    5.6.16 FPM (works)
    5.6.16 FastCGI (works)
    7.0.1 FPM (works)
    7.0.1 FastCGI (works)

  • Try 7.0.2 of PHP. there was bug in the mb_send_mail function that was fixed.. I don't know if that may have any issue with it. I'll try upgrading my CentOS box to 7.0.2 also and see if it works for me. Only reason I haven't is I was debating putting IPS 4.1 series back on for another site, and the html purifier is not 7 certified yet.
    Have you checked your php error log? The mb_send_mail function caused segfaults, so your php log file should show them if that was the issue.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!