Changeset 1013 in subversion
- Timestamp:
- Feb 4, 2008 12:39:06 PM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (1 diff)
-
program/steps/mail/sendmdn.inc (modified) (2 diffs)
-
program/steps/mail/show.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r998 r1013 2 2 --------------------------- 3 3 4 2008/02/04 (thomasb) 5 ---------- 6 - Fix regular expression for checking e-mail address (#1484710) 7 - Make sending of read receipts configurable 8 4 9 2008/02/02 (thomasb) 5 10 ---------- 6 11 - Always update $CONFIG with user prefs (#1484729) 7 12 - Don't ask for MDN confirmations on drafted messages (#1484691) 8 -9 13 10 14 2008/01/31 (robin) -
trunk/roundcubemail/config/main.inc.php.dist
r925 r1013 176 176 // false causes deleted messages to be permanantly removed if there is no Trash folder 177 177 $rcmail_config['flag_for_deletion'] = TRUE; 178 179 // Behavior if a received message requests a message delivery notification (read receipt) 180 // 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask) 181 $rcmail_config['mdn_requests'] = 0; 178 182 179 183 // Make use of the built-in spell checker. It is based on GoogieSpell. -
trunk/roundcubemail/program/localization/en_US/messages.inc
r950 r1013 75 75 $messages['errorsavingcontact'] = 'Could not save the contact address'; 76 76 $messages['movingmessage'] = 'Moving message...'; 77 $messages['receiptsent'] = 'Successfully sen d the receipt message';77 $messages['receiptsent'] = 'Successfully sent a read receipt'; 78 78 $messages['errorsendingreceipt'] = 'Could not send the receipt'; 79 79 -
trunk/roundcubemail/program/steps/mail/func.inc
r976 r1013 1319 1319 1320 1320 1321 function rcmail_send_mdn($uid) 1322 { 1323 global $CONFIG, $USER, $IMAP; 1324 1325 $message = array('UID' => $uid); 1326 $message['headers'] = $IMAP->get_headers($message['UID']); 1327 $message['subject'] = rcube_imap::decode_mime_string($message['headers']->subject, $message['headers']->charset); 1328 1329 if ($message['headers']->mdn_to && !$message['headers']->mdn_sent) 1330 { 1331 $identity = $USER->get_identity(); 1332 $sender = format_email_recipient($identity['email'], $identity['name']); 1333 $recipient = array_shift($IMAP->decode_address_list($message['headers']->mdn_to)); 1334 $mailto = $recipient['mailto']; 1335 1336 $compose = new rc_mail_mime(rcmail_header_delm()); 1337 $compose->setParam(array( 1338 'text_encoding' => 'quoted-printable', 1339 'html_encoding' => 'quoted-printable', 1340 'head_encoding' => 'quoted-printable', 1341 'head_charset' => RCMAIL_CHARSET, 1342 'html_charset' => RCMAIL_CHARSET, 1343 'text_charset' => RCMAIL_CHARSET, 1344 )); 1345 1346 // compose headers array 1347 $headers = array( 1348 'Date' => date('r'), 1349 'From' => $sender, 1350 'To' => $message['headers']->mdn_to, 1351 'Subject' => rcube_label('receiptread') . ': ' . $message['subject'], 1352 'Message-ID' => sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), rcmail_mail_domain($_SESSION['imap_host'])), 1353 'X-Sender' => $identity['email'], 1354 'Content-Type' => 'multipart/report; report-type=disposition-notification', 1355 ); 1356 1357 if (!empty($CONFIG['useragent'])) 1358 $headers['User-Agent'] = $CONFIG['useragent']; 1359 1360 $body = rcube_label("yourmessage") . "\r\n\r\n" . 1361 "\t" . rcube_label("to") . ': ' . rcube_imap::decode_mime_string($message['headers']->to, $message['headers']->charset) . "\r\n" . 1362 "\t" . rcube_label("subject") . ': ' . $message['subject'] . "\r\n" . 1363 "\t" . rcube_label("sent") . ': ' . format_date(strtotime($message['headers']->date), $CONFIG['date_long']) . "\r\n" . 1364 "\r\n" . rcube_label("receiptnote") . "\r\n"; 1365 1366 $ua = !empty($CONFIG['useragent']) ? $CONFIG['useragent'] : "RoundCube Webmail (Version ".RCMAIL_VERSION.")"; 1367 $report = "Reporting-UA: $ua\r\n"; 1368 1369 if ($message['headers']->to) 1370 $report .= "Original-Recipient: {$message['headers']->to}\r\n"; 1371 1372 $report .= "Final-Recipient: rfc822; {$identity['email']}\r\n" . 1373 "Original-Message-ID: {$message['headers']->messageID}\r\n" . 1374 "Disposition: manual-action/MDN-sent-manually; displayed\r\n"; 1375 1376 $compose->headers($headers, true); 1377 $compose->setTXTBody($body); 1378 $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); 1379 1380 $sent = rcmail_deliver_message($compose, $identity['email'], $mailto); 1381 1382 if ($sent) 1383 { 1384 $IMAP->set_flag($message['UID'], 'MDNSENT'); 1385 return true; 1386 } 1387 } 1388 1389 return false; 1390 } 1391 1392 1321 1393 // register UI objects 1322 1394 $OUTPUT->add_handlers(array( -
trunk/roundcubemail/program/steps/mail/sendmdn.inc
r938 r1013 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 23 23 24 24 25 if (!empty($_POST['_uid'])) 26 { 27 $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_POST)); 28 $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']); 29 $MESSAGE['subject'] = rcube_imap::decode_mime_string($MESSAGE['headers']->subject, $MESSAGE['headers']->charset); 30 31 if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent) 32 { 33 $identity = $USER->get_identity(); 34 $sender = format_email_recipient($identity['email'], $identity['name']); 35 $recipient = array_shift($IMAP->decode_address_list($MESSAGE['headers']->mdn_to)); 36 $mailto = $recipient['mailto']; 37 38 $COMPOSE = new rc_mail_mime(rcmail_header_delm()); 39 $COMPOSE->setParam(array( 40 'text_encoding' => 'quoted-printable', 41 'html_encoding' => 'quoted-printable', 42 'head_encoding' => 'quoted-printable', 43 'head_charset' => RCMAIL_CHARSET, 44 'html_charset' => RCMAIL_CHARSET, 45 'text_charset' => RCMAIL_CHARSET, 46 )); 47 48 // compose headers array 49 $headers = array( 50 'Date' => date('r'), 51 'From' => $sender, 52 'To' => $MESSAGE['headers']->mdn_to, 53 'Subject' => rcube_label('receiptread') . ': ' . $MESSAGE['subject'], 54 'Message-ID' => sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), rcmail_mail_domain($_SESSION['imap_host'])), 55 'X-Sender' => $identity['email'], 56 'Content-Type' => 'multipart/report; report-type=disposition-notification', 57 ); 58 59 if (!empty($CONFIG['useragent'])) 60 $headers['User-Agent'] = $CONFIG['useragent']; 61 62 $body = rcube_label("yourmessage") . "\r\n\r\n" . 63 "\t" . rcube_label("to") . ': ' . rcube_imap::decode_mime_string($MESSAGE['headers']->to, $MESSAGE['headers']->charset) . "\r\n" . 64 "\t" . rcube_label("subject") . ': ' . $MESSAGE['subject'] . "\r\n" . 65 "\t" . rcube_label("sent") . ': ' . format_date(strtotime($MESSAGE['headers']->date), $CONFIG['date_long']) . "\r\n" . 66 "\r\n" . rcube_label("receiptnote") . "\r\n"; 67 68 $report = "Reporting-UA: RoundCube Webmail (Version ".RCMAIL_VERSION.")\r\n"; 69 70 if ($MESSAGE['headers']->to) 71 $report .= "Original-Recipient: {$MESSAGE['headers']->to}\r\n"; 72 73 $report .= "Final-Recipient: rfc822; {$identity['email']}\r\n" . 74 "Original-Message-ID: {$MESSAGE['headers']->messageID}\r\n" . 75 "Disposition: manual-action/MDN-sent-manually; displayed\r\n"; 76 77 $COMPOSE->headers($headers, true); 78 $COMPOSE->setTXTBody($body); 79 $COMPOSE->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); 80 81 $sent = rcmail_deliver_message($COMPOSE, $identity['email'], $mailto); 82 83 if ($sent) 84 { 85 $IMAP->set_flag($MESSAGE['UID'], 'MDNSENT'); 86 $OUTPUT->set_env('mdn_request', false); 87 $OUTPUT->show_message('receiptsent', 'confirmation'); 88 $OUTPUT->send(); 89 } 90 } 25 if (!empty($_POST['_uid'])) { 26 $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST)); 91 27 } 92 28 93 // Error if arrive here 94 $OUTPUT->show_message('errorsendingreceipt', 'error'); 29 // show either confirm or error message 30 if ($sent) { 31 $OUTPUT->set_env('mdn_request', false); 32 $OUTPUT->show_message('receiptsent', 'confirmation'); 33 } 34 else { 35 $OUTPUT->show_message('errorsendingreceipt', 'error'); 36 } 37 95 38 $OUTPUT->send(); 96 39 -
trunk/roundcubemail/program/steps/mail/show.inc
r996 r1013 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005-200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 21 21 22 22 require_once('Mail/mimeDecode.php'); 23 require_once('lib/rc_mail_mime.inc'); 23 24 24 25 $PRINT_MODE = $_action=='print' ? TRUE : FALSE; … … 77 78 if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent && $IMAP->get_mailbox_name() != $CONFIG['drafts_mbox']) 78 79 { 79 rcube_add_label('mdnrequest'); 80 $OUTPUT->set_env('mdn_request', true); 80 if (intval($CONFIG['mdn_requests']) === 1) 81 { 82 if (rcmail_send_mdn($MESSAGE['UID'])) 83 $OUTPUT->show_message('receiptsent', 'confirmation'); 84 } 85 else if (empty($CONFIG['mdn_requests'])) 86 { 87 rcube_add_label('mdnrequest'); 88 $OUTPUT->set_env('mdn_request', true); 89 } 81 90 } 82 91
Note: See TracChangeset
for help on using the changeset viewer.
