glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.26k stars 1.29k forks source link

[DomainsAlert] Expiring domains sets only one email in notification queue by automatic action/crontask #12984

Open abhishek-rajput-44 opened 2 years ago

abhishek-rajput-44 commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.3

Bug description

I have installed latest glpi 10.0.3.

A domain (example.com) expiring prior to 30 days is found by DomainsAlert crontask only one time and an email is get queued in notification queue. after that even if i manually execute DomainsAlert automatic action, email is not queuing in the notification queue menu under Administration.

Root Entity is configured with notifications 30 days before expiration.

I want whenever cron will run or execute it manually, the respective email should be queued for domain alert action every time for each call .

Relevant log output

No response

Page URL

https://www.example.com/front/crontask.form.php?id=49

Steps To reproduce

No response

Your GLPI setup information

Information about system installation and configuration
GLPI 10.0.3 (/vtams => C:\xampp\htdocs\vtams)
Installation mode: TARBALL
Current language:en_GB

Server
 
Operating system: Windows NT WIN-M7C9HD6AD9K 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
PHP 8.1.6 cgi-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, ctype, curl,
    date, dom, exif, fileinfo, filter, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl,
    pcre, pdo_mysql, pdo_sqlite, readline, session, sodium, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib)
Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files"
    upload_max_filesize="2M" 
Software: Apache ()
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Server Software: mariadb.org binary distribution
    Server Version: 10.4.11-MariaDB
    Server SQL Mode: NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION
    Parameters: root@localhost:3307/vtams
    Host info: localhost via TCP/IP

PHP version (8.1.6) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.
gd extension is installed.
intl extension is installed.
libxml extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.4.11) is supported.
The log file has been created successfully.
Write access to C:\xampp\htdocs\vtams/files/_cache has been validated.
Write access to C:\xampp\htdocs\vtams/config has been validated.
Write access to C:\xampp\htdocs\vtams/files/_cron has been validated.
Write access to C:\xampp\htdocs\vtams/files has been validated.
Write access to C:\xampp\htdocs\vtams/files/_dumps has been validated.
Write access to C:\xampp\htdocs\vtams/files/_graphs has been validated.
Write access to C:\xampp\htdocs\vtams/files/_lock has been validated.
Write access to C:\xampp\htdocs\vtams/files/_pictures has been validated.
Write access to C:\xampp\htdocs\vtams/files/_plugins has been validated.
Write access to C:\xampp\htdocs\vtams/files/_rss has been validated.
Write access to C:\xampp\htdocs\vtams/files/_sessions has been validated.
Write access to C:\xampp\htdocs\vtams/files/_tmp has been validated.
Write access to C:\xampp\htdocs\vtams/files/_uploads has been validated.
Web access to files directory is protected
PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
zip extension is installed.
bz2 extension is installed.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to C:\xampp\htdocs\vtams/marketplace has been validated.
Timezones seems not loaded, see https://glpi-install.readthedocs.io/en/latest/timezones.html.

GLPI constants
 
GLPI_ROOT: C:\xampp\htdocs\vtams
GLPI_CONFIG_DIR: C:\xampp\htdocs\vtams/config
GLPI_VAR_DIR: C:\xampp\htdocs\vtams/files
GLPI_MARKETPLACE_DIR: C:\xampp\htdocs\vtams/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: 

Warning:  Array to string conversion in C:\xampp\htdocs\vtams\src\Config.php on line 2073

GLPI_SERVERSIDE_URL_ALLOWLIST: Array
GLPI_TELEMETRY_URI: https://telemetry.glpi-project.org
GLPI_INSTALL_MODE: TARBALL
GLPI_NETWORK_MAIL: glpi@teclib.com
GLPI_NETWORK_SERVICES: https://services.glpi-network.com
GLPI_MARKETPLACE_ALLOW_OVERRIDE: 1
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1
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_DOC_DIR: C:\xampp\htdocs\vtams/files
GLPI_CACHE_DIR: C:\xampp\htdocs\vtams/files/_cache
GLPI_CRON_DIR: C:\xampp\htdocs\vtams/files/_cron
GLPI_DUMP_DIR: C:\xampp\htdocs\vtams/files/_dumps
GLPI_GRAPH_DIR: C:\xampp\htdocs\vtams/files/_graphs
GLPI_LOCAL_I18N_DIR: C:\xampp\htdocs\vtams/files/_locales
GLPI_LOCK_DIR: C:\xampp\htdocs\vtams/files/_lock
GLPI_LOG_DIR: C:\xampp\htdocs\vtams/files/_log
GLPI_PICTURE_DIR: C:\xampp\htdocs\vtams/files/_pictures
GLPI_PLUGIN_DOC_DIR: C:\xampp\htdocs\vtams/files/_plugins
GLPI_RSS_DIR: C:\xampp\htdocs\vtams/files/_rss
GLPI_SESSION_DIR: C:\xampp\htdocs\vtams/files/_sessions
GLPI_TMP_DIR: C:\xampp\htdocs\vtams/files/_tmp
GLPI_UPLOAD_DIR: C:\xampp\htdocs\vtams/files/_uploads
GLPI_INVENTORY_DIR: C:\xampp\htdocs\vtams/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/glpi-plugins/
GLPI_I18N_DIR: C:\xampp\htdocs\vtams/locales
GLPI_VERSION: 10.0.3
GLPI_SCHEMA_VERSION: 10.0.3
GLPI_MARKETPLACE_PRERELEASES: 
GLPI_MIN_PHP: 7.4.0
GLPI_MAX_PHP: 8.3.0
GLPI_YEAR: 2022

Libraries
 
htmlawed/htmlawed version 1.2.9 in (C:\xampp\htdocs\vtams\vendor\htmlawed\htmlawed)
phpmailer/phpmailer version 6.6.0 in (C:\xampp\htdocs\vtams\vendor\phpmailer\phpmailer\src)
simplepie/simplepie version 1.5.8 in (C:\xampp\htdocs\vtams\vendor\simplepie\simplepie\library)
tecnickcom/tcpdf version 6.5.0 in (C:\xampp\htdocs\vtams\vendor\tecnickcom\tcpdf)
michelf/php-markdown in (C:\xampp\htdocs\vtams\vendor\michelf\php-markdown\Michelf)
true/punycode in (C:\xampp\htdocs\vtams\vendor\true\punycode\src)
iamcal/lib_autolink in (C:\xampp\htdocs\vtams\vendor\iamcal\lib_autolink)
sabre/dav in (C:\xampp\htdocs\vtams\vendor\sabre\dav\lib\DAV)
sabre/http in (C:\xampp\htdocs\vtams\vendor\sabre\http\lib)
sabre/uri in (C:\xampp\htdocs\vtams\vendor\sabre\uri\lib)
sabre/vobject in (C:\xampp\htdocs\vtams\vendor\sabre\vobject\lib)
laminas/laminas-i18n in (C:\xampp\htdocs\vtams\vendor\laminas\laminas-i18n\src)
laminas/laminas-servicemanager in (C:\xampp\htdocs\vtams\vendor\laminas\laminas-servicemanager\src)
monolog/monolog in (C:\xampp\htdocs\vtams\vendor\monolog\monolog\src\Monolog)
sebastian/diff in (C:\xampp\htdocs\vtams\vendor\sebastian\diff\src)
donatj/phpuseragentparser in (C:\xampp\htdocs\vtams\vendor\donatj\phpuseragentparser\src\UserAgent)
elvanto/litemoji in (C:\xampp\htdocs\vtams\vendor\elvanto\litemoji\src)
symfony/console in (C:\xampp\htdocs\vtams\vendor\symfony\console)
scssphp/scssphp in (C:\xampp\htdocs\vtams\vendor\scssphp\scssphp\src)
laminas/laminas-mail in (C:\xampp\htdocs\vtams\vendor\laminas\laminas-mail\src\Protocol)
laminas/laminas-mime in (C:\xampp\htdocs\vtams\vendor\laminas\laminas-mime\src)
rlanvin/php-rrule in (C:\xampp\htdocs\vtams\vendor\rlanvin\php-rrule\src)
blueimp/jquery-file-upload in (C:\xampp\htdocs\vtams\vendor\blueimp\jquery-file-upload\server\php)
ramsey/uuid in (C:\xampp\htdocs\vtams\vendor\ramsey\uuid\src)
psr/log in (C:\xampp\htdocs\vtams\vendor\psr\log\Psr\Log)
psr/simple-cache in (C:\xampp\htdocs\vtams\vendor\psr\simple-cache\src)
psr/cache in (C:\xampp\htdocs\vtams\vendor\psr\cache\src)
league/csv in (C:\xampp\htdocs\vtams\vendor\league\csv\src)
mexitek/phpcolors in (C:\xampp\htdocs\vtams\vendor\mexitek\phpcolors\src\Mexitek\PHPColors)
guzzlehttp/guzzle in (C:\xampp\htdocs\vtams\vendor\guzzlehttp\guzzle\src)
guzzlehttp/psr7 in (C:\xampp\htdocs\vtams\vendor\guzzlehttp\psr7\src)
glpi-project/inventory_format in (C:\xampp\htdocs\vtams\vendor\glpi-project\inventory_format\lib\php)
wapmorgan/unified-archive in (C:\xampp\htdocs\vtams\vendor\wapmorgan\unified-archive\src)
paragonie/sodium_compat in (C:\xampp\htdocs\vtams\vendor\paragonie\sodium_compat\src)
symfony/cache in (C:\xampp\htdocs\vtams\vendor\symfony\cache)
html2text/html2text in (C:\xampp\htdocs\vtams\vendor\html2text\html2text\src)
symfony/css-selector in (C:\xampp\htdocs\vtams\vendor\symfony\css-selector)
symfony/dom-crawler in (C:\xampp\htdocs\vtams\vendor\symfony\dom-crawler)
twig/twig in (C:\xampp\htdocs\vtams\vendor\twig\twig\src)
twig/string-extra in (C:\xampp\htdocs\vtams\vendor\twig\string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (C:\xampp\htdocs\vtams\vendor\symfony\polyfill-php82)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP+TLS (info@varatechnology.com@smtp.gmail.com)

Plugins list
 
    fields               Name: Additional fields              Version: 1.18.0     State: Enabled                                 
        Install Method: Marketplace
    barcode              Name: Barcode                        Version: 2.7.1      State: Enabled                                 
        Install Method: Marketplace
    camerainput          Name: Camera Input                   Version: 2.0.0      State: Enabled                                 
        Install Method: Marketplace
    datainjection        Name: Data injection                 Version: 2.12.0     State: Enabled                                 
        Install Method: Marketplace
    escalade             Name: Escalation                     Version: 2.8.0      State: Enabled                                 
        Install Method: Marketplace
    formcreator          Name: Form Creator                   Version: 2.13.1     State: Installed / not activated               
        Install Method: Marketplace
    geninventorynumber   Name: Inventory number generation    Version: 2.8.2      State: Enabled                                 
        Install Method: Marketplace
    uninstall            Name: Item's Lifecycle (uninstall)   Version: 2.8.0      State: Enabled                                 
        Install Method: Marketplace
    mreporting           Name: More Reporting                 Version: 1.8.2      State: Enabled                                 
        Install Method: Marketplace
    order                Name: Orders management              Version: 2.10.0     State: Enabled                                 
        Install Method: Marketplace

Anything else?

No response

cedric-anne commented 2 years ago

Hi,

Are you expecting to receive an alert for a domain that will expire on each crontask execution ? There is a mechanism in GLPI that prevent sending multiple alerts for a same domain, so once the alert is sent, future crontask execution will ignore this domain, unless expiration date is updated.

abhishek-rajput-44 commented 2 years ago

Hi,

Yes, I have GLPI 9.2.2 version is also installed. I have used domain alerts by plugins in this. It is working like i am expecting in this version i.e. i have set 30 days prior to domain expiration and 15 days after the domain expiration. My cron runs everyday in the morning by 10 am and email get queued for the respective domain in the given range of days for the expiration. It means i get the email everyday for 30 days until i change its expiration date.

I need the same functionality in GLPI 10.0.3 version also.

cedric-anne commented 2 years ago

This change was made in #11068, I used the same logic as what was done for certificates, but without replicating the reminder feature introduced for certificates in #10932.

I guess it would be logical to implement this reminder feature for domains.

abhishek-rajput-44 commented 2 years ago

Hi cedric,

Thanks for the quick reply. When can i get this requested functionality implemented for domain alerts?

cedric-anne commented 2 years ago

I cannot give a schedule for this.

As a workaround, you comment these lines: https://github.com/glpi-project/glpi/blob/9a7113c0f04f1d49dbd6e1d60d33145dc0b1b149/src/Domain.php#L665-L679

abhishek-rajput-44 commented 2 years ago

Thanks for the update.

CamiloPerezOrtiz commented 1 year ago

Hello There will be some news on this topic, we currently have using a GLPI 10.0.6