Hi Alex,
sending mail in on_shutdown method fails with Horde SMTP, when it tries to construct the mail and uses stream-filters for that
PHP Warning: stream_filter_remove(): Unable to flush filter, not removing in /var/www/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp.php on line 557
#1 /var/www/egroupware/vendor/pear-pear.horde.org/Horde_Smtp/Horde/Smtp.php(557): stream_filter_remove(Resource id #98)
#2 /var/www/egroupware/vendor/pear-pear.horde.org/Horde_Mail/Horde/Mail/Transport/Smtphorde.php(143): Horde_Smtp->send(Object(Horde_Mail_Rfc822_Address), Object(Horde_Mail_Rfc822_List), Resource id #92)
#3 /var/www/egroupware/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Part.php(1620): Horde_Mail_Transport_Smtphorde->send('Miss Sysop BB-t...', Array, Resource id #84)
#4 /var/www/egroupware/api/src/Mailer.php(747): Horde_Mime_Part->send('Miss Sysop BB-t...', Object(Horde_Mime_Headers), Object(Horde_Mail_Transport_Smtphorde), Array)
#5 /var/www/egroupware/api/src/Mailer.php(602): EGroupware\Api\Mailer->_send(Object(Horde_Mail_Transport_Smtphorde), true, false, Array)
#6 /var/www/egroupware/notifications/inc/class.notifications_email.inc.php(139): EGroupware\Api\Mailer->send()
#7 /var/www/egroupware/notifications/inc/class.notifications.inc.php(572): notifications_email->send(Array, 'Notify Test', Array, Array, Array)
#8 /var/www/egroupware/calendar/inc/class.calendar_boupdate.inc.php(1200): notifications->send()
#9 /var/www/egroupware/calendar/inc/class.calendar_boupdate.inc.php(828): calendar_boupdate->_send_update(1, Array, Array, Array, 5, NULL)
#10 [internal function]: calendar_boupdate::{closure}(Object(calendar_boupdate), 1, Array, Array, Array, 0, NULL)
#11 /var/www/egroupware/api/src/Egw.php(606): call_user_func_array(Object(Closure), Array)
#12 [internal function]: EGroupware\Api\Egw->__destruct()
#13 {main}
Which leads to a complete empty mail as you can see in the SMTP log:
>> Fri, 17 Jul 2020 11:26:50 +0200
>> Connection to: smtp://smtp.egroupware.org:465
S: 220 mail.egroupware.org ESMTP Postfix
C: EHLO 30f7744c9fff
S: 250-mail.egroupware.org
S: 250-PIPELINING
S: 250-SIZE 65000000
S: 250-VRFY
S: 250-ETRN
S: 250-AUTH PLAIN LOGIN
S: 250-AUTH=PLAIN LOGIN
S: 250-ENHANCEDSTATUSCODES
S: 250-8BITMIME
S: 250-DSN
S: 250 CHUNKING
[AUTH Command - method: PLAIN; username: rb@egroupware.org]
S: 235 2.7.0 Authentication successful
C: MAIL FROM:<rb@egroupware.org> SIZE=0 BODY=7BIT
C: RCPT TO:<sysop@bb-trunk.egroupware.de>
S: 250 2.1.0 Ok
S: 250 2.1.5 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C:
C: .
S: 250 2.0.0 Ok: queued as 52D4533
Looks like we triggering some PHP bug when trying to use stream-filters in a destructor.
While the whole stream-filter business is necessary for sending huge mails, our notification mails or meeting requests are quite small and would not require it. Unfortunately Horde SMTP does not allow to switch it off.
I let you know, if we found or decided on any alternative.
Ralf