@@ -564,6 +564,27 @@ public function process() {
564564 }
565565}
566566
567+ class Hm_Handler_smtp_supports_dsn extends Hm_Handler_Module {
568+ public function process () {
569+ if (! $ this ->user_config ->get ('enable_compose_delivery_receipt_setting ' )) {
570+ return ;
571+ }
572+
573+ Hm_SMTP_List::init ($ this ->user_config , $ this ->session );
574+
575+ $ smtp_id = server_from_compose_smtp_id ($ this ->request ->post ['compose_smtp_id ' ]);
576+ $ smtp_details = Hm_SMTP_List::dump ($ smtp_id , true );
577+ $ mailbox = Hm_SMTP_List::connect ($ smtp_id , false , $ smtp_details ['user ' ], $ smtp_details ['pass ' ]);
578+ if (! $ mailbox || ! $ mailbox ->authed ()) {
579+ Hm_Msgs::add ("Failed to determine Delivery Status Notification. The server refused connection. user is: " .$ smtp_details ['user ' ], "danger " );
580+ $ this ->out ('dsn_supported ' , false );
581+ return ;
582+ }
583+
584+ $ this ->out ('dsn_supported ' , $ mailbox ->get_connection ()->supports_dsn ());
585+ }
586+ }
587+
567588if (!hm_exists ('get_mime_type ' )) {
568589 function get_mime_type ($ filename )
569590 {
@@ -1193,7 +1214,7 @@ protected function output() {
11931214 (!$ html ? '<label for="compose_body"> ' .$ this ->trans ('Message ' ).'</label> ' : '' ).
11941215 '</div> ' ;
11951216 if ($ this ->get ('enable_compose_delivery_receipt_setting ' )) {
1196- $ res .= '<div class="form-check mb-3"><input value="1" name="compose_delivery_receipt" id="compose_delivery_receipt" type="checkbox" class="form-check-input" checked/><label for="compose_delivery_receipt" class="form-check-label"> ' .$ this ->trans ('Request a delivery receipt ' ).'</label></div> ' ;
1217+ $ res .= '<div class="form-check mb-3"><input value="1" name="compose_delivery_receipt" disabled id="compose_delivery_receipt" type="checkbox" class="form-check-input" checked/><label for="compose_delivery_receipt" class="form-check-label"> ' .$ this ->trans ('Request a delivery receipt ' ).'</label></div> ' ;
11971218 }
11981219 if ($ html == 2 ) {
11991220 $ res .= '<link href=" ' .WEB_ROOT .'modules/smtp/assets/markdown/editor.css" rel="stylesheet" /> ' .
0 commit comments