cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]
http://cypht.org
GNU Lesser General Public License v2.1
949 stars 146 forks source link

Fatal php error when sending emails #992

Closed PaulTGG closed 2 months ago

PaulTGG commented 2 months ago

🐛 Bugreport

When sending an email from the composer, on clicking send, the email is sent successfully, but there is a fatal php error, and Cypht crashes.

Here's an example error from the server log:

[Wed May 01 08:28:53.557840 2024] [proxy_fcgi:error] [pid 94697] [client [deleted]:54586] AH01071: Got error 'PHP message: PHP Warning: Undefined array key "compose_delivery_receipt" in /usr/local/share/cypht/modules/smtp/modules.php on line 687; PHP message: PHP Stack trace:; PHP message: PHP 1. {main}() /usr/local/share/cypht/site/index.php:0; PHP message: PHP 2. Hm_Dispatch->__construct($config = class Hm_Site_Config_File { protected $source = ''; protected $config = ['version' => 0.1, '2fa_secret' => '[deleted]', '2fa_simple' => FALSE, 'session_type' => 'DB', 'auth_type' => 'DB', 'ldap_auth_server' => 'localhost', 'ldap_auth_port' => '389', 'ldap_auth_tls' => NULL, 'ldap_auth_base_dn' => 'example,dc=com', 'imap_auth_name' => 'localhost', 'imap_auth_server' => 'localhost', 'imap_auth_port' => '143', 'imap_auth_tls' => TRUE, 'imap_auth_sieve_conf_host' => 'tls://mail.gandi.net:4190', 'default_smtp_name' => NULL, 'default_smtp_server' => NULL, 'default_smtp_port' => NULL, 'default_smtp_tls' => NULL, 'default_smtp_no_auth' => NULL, 'user_config_type' => 'DB', 'user_settings_dir' => '/var/lib/hm3/users', 'attachment_dir' => '/var/lib/hm3/attachments', 'app_data_dir' => '/var/lib/hm3/app_data', 'disable_origin_check' => TRUE, 'admin_users' => NULL, 'cookie_domain' => NULL, 'cookie_pat...; PHP message: PHP 3. Hm_Dispatch->process_request() /usr/local/share/cypht/lib/dispatch.php:188; PHP message: PHP 4. Hm_Module_Exec->run_handler_modules($request = class Hm_Request { public $post = ['hm_page_key' => '8585d86cc111f95c36f9aefe839c3a3d608adf04e42b9a62c13650a089bd87ee', 'post_archive' => 0, 'smtp_send' => FALSE, 'compose_to' => 'paultaylor@gotgrip.com', 'compose_msg_path' => '', 'compose_msg_uid' => FALSE, 'compose_body' => 'test body<br />', 'compose_subject' => 'test subject', 'compose_in_reply_to' => '', 'compose_cc' => '', 'compose_bcc' => '', 'compose_smtp_id' => '662f2e6cc6680.1', 'draft_id' => 404, 'send_uploaded_files' => '', 'next_email_post' => '']; public $get = ['page' => 'compose']; public $cookie = ['hm_id' => '[deleted]', 'hm_session' => 'Oa0RUlRcfDL6YVqrjE8JF8su3WMPpxekiPsy4sYDukpHmFXWzRbp5BfU8NmRIOMXV8UvNStuwf3iW5g9FykNX9ZVZwTtiCuUl7eiF/IaTOx8025NC0xIy2ZlzAB026K9o5OtjqZ9wx/63Eggm4cjIfsshksxMKZF/MOkuml...; PHP message: PHP 5. Hm_Module_Exec->run_handler_module($input = ['allow_long_session' => TRUE, 'fancy_login_allowed' => FALSE, 'is_mobile' => FALSE, 'changed_settings' => [], 'username' => 'paul', 'is_logged' => TRUE, 'data_sources' => [0 => [...], 1 => [...], 2 => [...]], 'encrypt_ajax_requests' => FALSE, 'encrypt_local_storage' => FALSE, 'disable_delete_prompt' => 1, 'mailto_handler' => TRUE, 'warn_for_unsaved_changes' => TRUE, 'no_password_save' => FALSE, 'load_recover_options' => FALSE, 'auth_type' => 'Hm_Auth_DB', 'themes' => ['default' => 'White Bread (Default)', 'cosmo' => 'Cosmo', 'cerulean' => 'Cerulean', 'cyborg' => 'Cyborg', 'darkly' => 'Darkly', 'flatly' => 'Flatly', 'journal' => 'Journal', 'litera' => 'Litera', 'lumen' => 'Lumen', 'lux' => 'Lux', 'materia' => 'Materia', 'minty' => 'Minty', 'morph' => 'Morph', 'pulse' => 'Pulse', 'quartz' => 'Quartz', 'sandstone' => 'Sandstone', 'simplex' => 'Simplex', 'sketchy' => 'Sketchy', 'slate' => 'Slate', 'solar' => 'Solar', 'spacelab' => 'Spa...; PHP message: PHP 6. Hm_Handler_process_compose_form_submit->process(['allow_long_session' => TRUE, 'fancy_login_allowed' => FALSE, 'is_mobile' => FALSE, 'changed_settings' => [], 'username' => 'paul', 'is_logged' => TRUE, 'data_sources' => [0 => [...], 1 => [...], 2 => [...]], 'encrypt_ajax_requests' => FALSE, 'encrypt_local_storage' => FALSE, 'disable_delete_prompt' => 1, 'mailto_handler' => TRUE, 'warn_for_unsaved_changes' => TRUE, 'no_password_save' => FALSE, 'load_recover_options' => FALSE, 'auth_type' => 'Hm_Auth_DB', 'themes' => ['default' => 'White Bread (Default)', 'cosmo' => 'Cosmo', 'cerulean' => 'Cerulean', 'cyborg' => 'Cyborg', 'darkly' => 'Darkly', 'flatly' => 'Flatly', 'journal' => 'Journal', 'litera' => 'Litera', 'lumen' => 'Lumen', 'lux' => 'Lux', 'materia' => 'Materia', 'minty' => 'Minty', 'morph' => 'Morph', 'pulse' => 'Pulse', 'quartz' => 'Quartz', 'sandstone' => 'Sandstone', 'simplex' => 'Simplex', 'sketchy' => 'Sketchy', 'slate' => 'Slate', 'solar' => 'Solar', 'spacelab' => ...; PHP message: PHP Fatal error: Uncaught Error: Call to undefined method Hm_Handler_store_contact_message::trans() in /usr/local/share/cypht/modules/contacts/modules.php:44\nStack trace:\n#0 [internal function]: Hm_Handler_store_contact_message->{closure}()\n#1 /usr/local/share/cypht/modules/contacts/modules.php(43): array_map()\n#2 /usr/local/share/cypht/lib/modules_exec.php(177): Hm_Handler_store_contact_message->process()\n#3 /usr/local/share/cypht/lib/modules_exec.php(155): Hm_Module_Exec->run_handler_module()\n#4 /usr/local/share/cypht/lib/dispatch.php(218): Hm_Module_Exec->run_handler_modules()\n#5 /usr/local/share/cypht/lib/dispatch.php(188): Hm_Dispatch->process_request()\n#6 /usr/local/share/cypht/site/index.php(51): Hm_Dispatch->__construct()\n#7 {main}\n thrown in /usr/local/share/cypht/modules/contacts/modules.php on line 44'

Version & Environment

Rev: 492f634

OS: []

Steps to reproduce

  1. Compose an email
  2. Click send
  3. The error occurs.
PaulTGG commented 2 months ago

Duplicate of https://github.com/cypht-org/cypht/issues/945