Problems with mail()

Discussion in 'Installation/Configuration' started by Steffan, Sep 2, 2020.

  1. Steffan

    Steffan Member

    Im noticing client problems with the mailcommand
    i debuged it and fount that the problem is the added '-f '.$from
    Somehow all clients get a message that the emial is send but the server is not processing the email
    (nothing in the maillog)

    Is this a conflict with the default settings of ispconfig?

    Code:
    php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -f [email protected]"
    
    below a sample:
    Code:
    ($this->_safe_mode === TRUE || ! $this->_validate_email_for_shell($from))
                    {
                            return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str);
                    }
                    else
                    {
                            // most documentation of sendmail using the "-f" flag lacks a space after it, however
                            // we've encountered servers that seem to require it to be in place.
                            return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, '-f '.$from);
                    }
    
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You do not mention what version of ISPConfig on what operating system and version?
     
  3. Steffan

    Steffan Member

    ISPConfig 3.1.15p3
    centos 8
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If your software supports sending by smtp, then you can try that instead. In general, I'm not aware of any issues with the defaults used by ISPConfig. We set the sender address for php mail() function as a spam prevention measure and to avoid the use of fake sender addresses when using php mail() function without being an authenticated sender.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just a note, ISPConfig 3.1.15p3 doesn’t support Centos 8.
    3.2 will, and is almost ready for release.
     
  6. Steffan

    Steffan Member

    Yes i know but i had to reinstall the server and you doing a great job, but the almost ready is several months :)

    I know that there are more options to send but joomla has by default mail() so costumers has problems with it.

    "We set the sender address for php mail() function as a spam prevention measure and to avoid the use of fake sender addresses when using php mail() function without being an authenticated sender."

    I know abouth this settings. i hope in the future this will be a dynamic settings so it can be changed per site.
    This problem wasnt there on 3.1.15p2 / Centos 7 / PHP 7.3
    Current version 3.1.15p3 / Centos 8 / PHP 7.3
    has this so will try te debug to see why...
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    It actually is changed per site, it defaults to [email protected]. You can override that in the site's php directives, and I just tested it is added to the .conf file, though didn't test that the second sendmail_path setting does in fact override the first (I'd expect so, but untested).
     
  8. Steffan

    Steffan Member

    I have filed a bug abouth this in the past
    If you add it in the php directives then the first stays in place and is still being used, so you have to manualy eddit the config file to remove [email protected]
    But still it would be nice if this was just a line in the webconfig in the gui.
    now i have to do it for the client or i have to give the client access to the site's php directives, and that is not always a good idee...
     
  9. Steffan

    Steffan Member

    Well tested it on
    cento6 php 7.3.22 mail() with a extra -f is working

    centos8 php 7.3.22 mail() with a extra -f is not working,
    only works when you disable it in the site.conf php-fpm file

    i realy have no idee why so if someone also is using centos8 and want to test it please do...
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    3.2 beta will be released very soon, and supports centos 8, so this is probably addressed there, but definitely something to check during beta tests.
     

Share This Page