Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification about disabled PHP "mail" function #18134

Open
2 tasks
eduardomozart opened this issue Oct 23, 2024 · 1 comment
Open
2 tasks

Notification about disabled PHP "mail" function #18134

eduardomozart opened this issue Oct 23, 2024 · 1 comment
Milestone

Comments

@eduardomozart
Copy link
Contributor

eduardomozart commented Oct 23, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.16

Bug description

When using a shared hosting provider that disables the "mail" function, the GLPI throws a error message on "Way of sending mail" (Setup > Notification > Email Followups Configuration) that the "mail" function is disabled, which is true (it's disabled through "disable_functions" PHP directive). I believe it was true into the past, but current GLPI versions uses PHPMailer and I was able to send/receive mail through GLPI even without this PHP function, so I believe this warning should be rewritten, e.g. shows the dropdown but removes/gray out the "SMTP" option on dropdown and show the warning below the dropdown maybe?

image

Relevant log output

None.

Page URL

https://glpi.example.com/front/setup.notification.php

Steps To reproduce

No response

Your GLPI setup information

Information about system installation & configuration
GLPI 10.0.16 ( => /home/opoderdasvendasc/helpdesk/glpi)
Installation mode: TARBALL
Current language:en_US

Server
 
Operating system: Linux scca1.icloudzinc.com 4.18.0-425.3.1.lve.el8.x86_64 #​1 SMP Tue Nov 22 22:59:23 EST 2022 x86_64
PHP 7.4.33 litespeed (Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, bcmath, brotli, bz2, calendar, ctype, curl, date,
dba, dom, enchant, exif, fileinfo, filter, ftp, gd, geoip, gettext, gmp, hash, i360, iconv, igbinary, imap, intl, json, ldap,
libxml, litespeed, mbstring, mcrypt, memcached, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite,
pgsql, posix, pspell, readline, redis, session, shmop, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy,
timezonedb, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="3000" memory_limit="2G" post_max_size="128M" safe_mode="" session.save_handler="files"
upload_max_filesize="128M"
disable_functions="exec,mail,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname"

Software: LiteSpeed
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Server Software: MariaDB Server
Server Version: 10.5.23-MariaDB-cll-lve
Server SQL Mode: NO_ENGINE_SUBSTITUTION
Parameters: opoderdasvendasc_glpi@localhost/opoderdasvendasc_glpi
Host info: Localhost via UNIX socket

PHP version (7.4.33) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.5.23) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_cache has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_cron has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_dumps has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_graphs has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_lock has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_pictures has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_plugins has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_rss has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_sessions has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_tmp has been validated.
Write access to /home/opoderdasvendasc/helpdesk/glpi/files/_uploads has been validated.
PHP 7.4 is no longer maintained by its community.
Even if GLPI still supports this PHP version, an upgrade to a more recent PHP version is recommended.
Indeed, this PHP version may contain unpatched security vulnerabilities.
Web server root directory configuration seems safe.
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is not present.
Following extensions are installed: ctype, iconv, mbstring.
Following extensions are not present: sodium.
Write access to /home/opoderdasvendasc/helpdesk/glpi/marketplace has been validated.
Access to timezone database (mysql) is not allowed.

GLPI constants
 
GLPI_ROOT: "/home/opoderdasvendasc/helpdesk/glpi"
GLPI_CONFIG_DIR: "/home/opoderdasvendasc/helpdesk/glpi/config"
GLPI_VAR_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files"
GLPI_LOG_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_log"
GLPI_MARKETPLACE_DIR: "/home/opoderdasvendasc/helpdesk/glpi/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_EXPIRES: "7200"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\/\/[^@:]+(\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "TARBALL"
GLPI_NETWORK_MAIL: "[email protected]"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_TEXT_MAXSIZE: "4000"
GLPI_DOC_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files"
GLPI_CACHE_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_cache"
GLPI_CRON_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_cron"
GLPI_DUMP_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_dumps"
GLPI_GRAPH_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_locales"
GLPI_LOCK_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_lock"
GLPI_PICTURE_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_plugins"
GLPI_RSS_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_rss"
GLPI_SESSION_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_sessions"
GLPI_TMP_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_tmp"
GLPI_UPLOAD_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_uploads"
GLPI_INVENTORY_DIR: "/home/opoderdasvendasc/helpdesk/glpi/files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "/home/opoderdasvendasc/helpdesk/glpi/locales"
GLPI_VERSION: "10.0.16"
GLPI_SCHEMA_VERSION: "10.0.16@b13256c443dd4fdb27b4a0d3b8fea8caba4dfaa9"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.4.0"
GLPI_YEAR: "2024"

Libraries
 
htmlawed/htmlawed version 1.2.14 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.4.4 in (/home/opoderdasvendasc/helpdesk/glpi/plugins/pdf/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/home/opoderdasvendasc/helpdesk/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/home/opoderdasvendasc/helpdesk/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/home/opoderdasvendasc/helpdesk/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/home/opoderdasvendasc/helpdesk/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/home/opoderdasvendasc/helpdesk/glpi/vendor/sabre/http/lib)
sabre/uri in (/home/opoderdasvendasc/helpdesk/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/home/opoderdasvendasc/helpdesk/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/home/opoderdasvendasc/helpdesk/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/home/opoderdasvendasc/helpdesk/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/home/opoderdasvendasc/helpdesk/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/home/opoderdasvendasc/helpdesk/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/home/opoderdasvendasc/helpdesk/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/home/opoderdasvendasc/helpdesk/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/console)
scssphp/scssphp in (/home/opoderdasvendasc/helpdesk/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/home/opoderdasvendasc/helpdesk/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/home/opoderdasvendasc/helpdesk/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/home/opoderdasvendasc/helpdesk/glpi/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/home/opoderdasvendasc/helpdesk/glpi/vendor/ramsey/uuid/src)
psr/log in (/home/opoderdasvendasc/helpdesk/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/home/opoderdasvendasc/helpdesk/glpi/vendor/psr/simple-cache/src)
psr/cache in (/home/opoderdasvendasc/helpdesk/glpi/vendor/psr/cache/src)
league/csv in (/home/opoderdasvendasc/helpdesk/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/home/opoderdasvendasc/helpdesk/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/home/opoderdasvendasc/helpdesk/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/home/opoderdasvendasc/helpdesk/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/home/opoderdasvendasc/helpdesk/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/home/opoderdasvendasc/helpdesk/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/cache)
html2text/html2text in (/home/opoderdasvendasc/helpdesk/glpi/vendor/html2text/html2text/src)
symfony/css-selector in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/css-selector)
symfony/dom-crawler in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/dom-crawler)
twig/twig in (/home/opoderdasvendasc/helpdesk/glpi/vendor/twig/twig/src)
twig/string-extra in (/home/opoderdasvendasc/helpdesk/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/polyfill-php80)
symfony/polyfill-php81 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/polyfill-php81)
symfony/polyfill-php82 in (/home/opoderdasvendasc/helpdesk/glpi/vendor/symfony/polyfill-php82)
league/oauth2-client in (/home/opoderdasvendasc/helpdesk/glpi/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/home/opoderdasvendasc/helpdesk/glpi/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/home/opoderdasvendasc/helpdesk/glpi/vendor/thenetworg/oauth2-azure/src/Provider)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP+OAUTH (helpdesk@[email protected])

Plugins list
 
accounts Name: Contas Version: 3.0.4 State: Enabled
Install Method: Manual
gantt Name: gantt Version: 1.0.2 State: Enabled
Install Method: Manual
pdf Name: Imprimir em PDF Version: 3.0.0 State: Enabled
Install Method: Manual
mreporting Name: Mais Relatórios Version: 1.8.6 State: Enabled
Install Method: Manual
oauthimap Name: Oauth IMAP Version: 1.4.3 State: Enabled
Install Method: Manual
dashboard Name: Painel Version: 1.0.2 State: Enabled
Install Method: Manual
reports Name: Relatórios Version: 1.16.0 State: Enabled
Install Method: Manual
tasklists Name: Tasks list Version: 2.0.3 State: Enabled
Install Method: Manual

Anything else?

No response

@eduardomozart eduardomozart changed the title Notification about disabled "mail" function Notification about disabled PHP "mail" function Oct 23, 2024
@cedric-anne
Copy link
Member

cedric-anne commented Oct 24, 2024

Hi,

In GLPI 11.0, we switched to symfony/mailer. It does not use the mail() function anymore, but instead it uses either sendmail, either a stream.

Instead of checking the mail() function presence, we could use a try { (new \Symfony\Component\Mailer\Transport\NativeTransportFactory())->create(Symfony\Component\Mailer\Transport\Dsn::fromString('native://default')); } block to catch the exceptions thrown when the PHP configuration is not valid.

See https://github.com/symfony/mailer/blob/c2f7e0d8d7ac8fe25faccf5d8cac462805db2663/Transport/NativeTransportFactory.php#L26-L57

@cedric-anne cedric-anne added this to the 11.0.0 milestone Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants