-
-if ($default_use_mdn) {
- if ($mdn_user_support) {
-
- // debug gives you the capability to remove mdn-flags
- // $MDNDebug = false;
- $read = sqimap_run_command ($imapConnection, "FETCH $passed_id BODY.PEEK[HEADER.FIELDS (Disposition-Notification-To)]", true,
- $response, $readmessage);
- $MDN_to = substr($read[1], strpos($read[1], ' '));
- $MDN_flag_present = false;
-
- $read = sqimap_run_command ($imapConnection, "FETCH $passed_id FLAGS", true,
- $response, $readmessage);
- $MDN_flag_present = preg_match( '/.*\$MDNSent/i', $read[0]);
-
- if (trim($MDN_to) &&
- (!isset( $sendreceipt ) || $sendreceipt == '' ) ) {
-
- if ( $MDN_flag_present && $supportMDN) {
- $sendreceipt = 'removeMDN';
- $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\"";
- $sendreceipt='';
- /*
- if ($MDNDebug ) {
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("send") . '</b> <a href="' . $url . '">[' . _("Remove MDN flag") . '] </a> ' ,
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- } else {
- */
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("send") . '</b> ' ,
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- /*
- }
- */
-
- } // when deleted or draft flag is set don't offer to send a MDN response
- else if ( ereg('\\Draft',$read[0] || ereg('\\Deleted',$read[0])) ) {
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("requested") . '</b> ' ,
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- }
- // if no MDNsupport don't use the annoying popup messages
- else if ( !$FirstTimeSee ) {
- $sendreceipt = 'send';
- $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\"";
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("requested") . '</b> <a href="' . $url . '">[' . _("Send read receipt now") . ']</a>',
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- $sendreceipt='';
- }
- else {
- $sendreceipt = 'send';
- $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\"";
- if ($javascript_on) {
- echo "<script language=\"javascript\" type=\"text/javascript\"> \n" .
- '<!-- ' . "\n" .
- " if (window.confirm(\"" .
- _("The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?") .
- "\")) { \n" .
- ' window.open('.$url.',"right");' . "\n" .
- ' }' . "\n" .
- '// -->' . "\n" .
- '</script>' . "\n";
- }
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("requested") . '</b>  <a href="' . $url . '">[' . _("Send read receipt now") . ']</a>',
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- $sendreceipt = '';
- }
- }
-
- if ( !isset( $sendreceipt ) || $sendreceipt == '' ) {
- } else if ( $sendreceipt == 'send' ) {
- if ( !$MDN_flag_present) {
- if (isset($identity) ) {
- $final_recipient = getPref($data_dir, $username, 'email_address' . '0', '' );
- } else {
- $final_recipient = getPref($data_dir, $username, 'email_address', '' );
- }
-
- $final_recipient = trim($final_recipient);
- if ($final_recipient == '' ) {
- $final_recipient = getPref($data_dir, $username, 'email_address', '' );
- }
-
- if ( SendMDN( $MDN_to, $final_recipient ) > 0 && $supportMDN ) {
- ToggleMDNflag( true);
- }
- ClearAttachments();
- }
- $sendreceipt = 'removeMDN';
- $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\"";
- $sendreceipt='';
- /*
- if ($MDNDebug && $supportMDN) {
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("send") . '</b>  <a href="' . $url . '">[' . _("Remove MDN flag") . ']</a>',
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- } else {
- */
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("send") . '</b> ',
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- /*
- }
- */
- }
- elseif ($sendreceipt == 'removeMDN' ) {
- ToggleMDNflag ( false );
-
- $sendreceipt = 'send';
- $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\"";
- echo html_tag( 'tr', "\n" .
- html_tag( 'td', _("Read receipt") . ':', 'right', $color[9], 'valign="top"' ) .
- html_tag( 'td',
- '<b>' . _("requested") . '</b> <a href="' . $url . '">[' . _("Send read receipt now") . ']</a>',
- 'left', $color[9], 'colspan="2" valign="top"' )
- ) . "\n";
- $sendreceipt = '';
-
- }
- }