summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-04-05 12:49:21 +0000
committerthomascube <thomas@roundcube.net>2008-04-05 12:49:21 +0000
commite70d6ea64e711096af36b1234f8545b870ea5f45 (patch)
tree98e784b95d08418d85a17af767037e8a6e0f3f41 /program/steps
parentcb1330b7b10ce46e466850b27300a06ed122501e (diff)
Apply changes from trunk to 0.1-stable
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/compose.inc10
-rw-r--r--program/steps/mail/func.inc6
-rw-r--r--program/steps/mail/sendmail.inc26
-rw-r--r--program/steps/mail/show.inc4
-rw-r--r--program/steps/mail/viewsource.inc26
-rw-r--r--program/steps/settings/func.inc11
-rw-r--r--program/steps/settings/manage_folders.inc8
7 files changed, 61 insertions, 30 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 71d2197d8..fd3743e2a 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -90,7 +90,11 @@ if (!empty($msg_uid))
// similar as in program/steps/mail/show.inc
$MESSAGE = array('UID' => $msg_uid);
$MESSAGE['headers'] = &$IMAP->get_headers($msg_uid);
- $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid);
+ $MESSAGE['structure'] = &$IMAP->get_structure($msg_uid);
+
+ if (!empty($MESSAGE['headers']->charset))
+ $IMAP->set_charset($MESSAGE['headers']->charset);
+
$MESSAGE['subject'] = $IMAP->decode_header($MESSAGE['headers']->subject);
$MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']);
@@ -889,7 +893,7 @@ if ($result = $CONTACTS->list_records())
{
while ($sql_arr = $result->iterate())
if ($sql_arr['email'])
- $a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name']));
+ $a_contacts[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
}
if (isset($CONFIG['ldap_public']))
{
@@ -914,7 +918,7 @@ if (isset($CONFIG['ldap_public']))
$email = $results->records[$i]['email'];
$name = $results->records[$i]['name'];
- $a_contacts[] = format_email_recipient($email, JQ($name));
+ $a_contacts[] = format_email_recipient($email, $name);
}
}
$LDAP->close();
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index b1ce4bd4e..79e0248c3 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -695,10 +695,10 @@ function rcmail_print_body($part, $safe=FALSE, $plain=FALSE)
$quotation = '';
$q = 0;
- if (preg_match('/^(>+\s*)/', $line, $regs))
+ if (preg_match('/^(>+\s*)+/', $line, $regs))
{
- $q = strlen(preg_replace('/\s/', '', $regs[1]));
- $line = substr($line, strlen($regs[1]));
+ $q = strlen(preg_replace('/\s/', '', $regs[0]));
+ $line = substr($line, strlen($regs[0]));
if ($q > $quote_level)
$quotation = str_repeat('<blockquote>', $q - $quote_level);
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 21b5b4308..ddd3ea897 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -212,12 +212,16 @@ if (!empty($_POST['_receipt']))
// additional headers
$headers['Message-ID'] = $message_id;
$headers['X-Sender'] = $from;
-$headers['Received'] = wordwrap('from ' .
- (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
- gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']).' ['.$_SERVER['HTTP_X_FORWARDED_FOR'].'] via ' : '') .
- gethostbyaddr($_SERVER['REMOTE_ADDR']).' ['.$_SERVER['REMOTE_ADDR'].'] with ' .
- $_SERVER['SERVER_PROTOCOL'].' ('.$_SERVER['REQUEST_METHOD'].'); ' . date('r'),
- 69, rcmail_header_delm() . "\t");
+
+if ($CONFIG['http_received_header'])
+{
+ $nldlm = rcmail_header_delm() . "\t";
+ $headers['Received'] = wordwrap('from ' . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
+ gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']).' ['.$_SERVER['HTTP_X_FORWARDED_FOR'].']'.$nldlm.' via ' : '') .
+ gethostbyaddr($_SERVER['REMOTE_ADDR']).' ['.$_SERVER['REMOTE_ADDR'].']'.$nldlm.'with ' .
+ $_SERVER['SERVER_PROTOCOL'].' ('.$_SERVER['REQUEST_METHOD'].'); ' . date('r'),
+ 69, $nldlm);
+}
if (!empty($CONFIG['useragent']))
$headers['User-Agent'] = $CONFIG['useragent'];
@@ -245,6 +249,11 @@ if ($isHtml)
// add a plain text version of the e-mail as an alternative part.
$h2t = new html2text($message_body);
$plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
+ if (!strlen($plainTextPart))
+ {
+ // empty message body breaks attachment handling in drafts
+ $plainTextPart = "\r\n";
+ }
$MAIL_MIME->setTXTBody(html_entity_decode($plainTextPart, ENT_COMPAT, 'utf-8'));
// look for "emoticon" images from TinyMCE and copy into message as attachments
@@ -254,6 +263,11 @@ else
{
$message_body = wordwrap($message_body, 75, "\r\n");
$message_body = wordwrap($message_body, 998, "\r\n", true);
+ if (!strlen($message_body))
+ {
+ // empty message body breaks attachment handling in drafts
+ $message_body = "\r\n";
+ }
$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);
}
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 5cd5e8360..27d26603f 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -30,6 +30,10 @@ if ($_GET['_uid'])
$MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET));
$MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']);
+ // set message charset as default
+ if (!empty($MESSAGE['headers']->charset))
+ $IMAP->set_charset($MESSAGE['headers']->charset);
+
// go back to list if message not found (wrong UID)
if (!$MESSAGE['headers'])
{
diff --git a/program/steps/mail/viewsource.inc b/program/steps/mail/viewsource.inc
index c88b165b6..7c32b89ca 100644
--- a/program/steps/mail/viewsource.inc
+++ b/program/steps/mail/viewsource.inc
@@ -5,7 +5,7 @@
| program/steps/mail/viewsource.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -22,19 +22,21 @@
// similar code as in program/steps/mail/get.inc
if ($uid = get_input_value('_uid', RCUBE_INPUT_GET))
- {
- header('Content-Type: text/plain');
- //@ob_end_clean();
+{
+ $headers = $IMAP->get_headers($uid);
+ $charset = $headers->charset ? $headers->charset : $IMAP->default_charset;
+ header("Content-Type: text/plain; charset={$charset}");
$IMAP->print_raw_body($uid);
- }
+}
else
- {
- raise_error(array('code' => 500,
- 'type' => 'php',
- 'message' => 'Message UID '.$uid.' not found'),
- TRUE,
- TRUE);
- }
+{
+ raise_error(array(
+ 'code' => 500,
+ 'type' => 'php',
+ 'message' => 'Message UID '.$uid.' not found'),
+ true,
+ true);
+}
exit;
?>
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index a0666cd9d..befc1d7a0 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -67,14 +67,16 @@ function rcmail_user_prefs_form($attrib)
$select_timezone = new select(array('name' => '_timezone', 'id' => $field_id));
$select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11');
$select_timezone->add('(GMT -10:00) Hawaii', '-10');
+ $select_timezone->add('(GMT -9:30) Marquesas Islands', '-9.5');
$select_timezone->add('(GMT -9:00) Alaska', '-9');
$select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8');
$select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7');
$select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6');
$select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5');
- $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', '-4');
- $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3');
+ $select_timezone->add('(GMT -4:30) Caracas', '-4.5');
+ $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), La Paz', '-4');
$select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5');
+ $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3');
$select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2');
$select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1');
$select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0');
@@ -88,13 +90,18 @@ function rcmail_user_prefs_form($attrib)
$select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5');
$select_timezone->add('(GMT +5:45) Kathmandu', '5.75');
$select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6');
+ $select_timezone->add('(GMT +6:30) Cocos Islands, Myanmar', '6.5');
$select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7');
$select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8');
+ $select_timezone->add('(GMT +8:45) Caiguna, Eucla, Border Village', '8.75');
$select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9');
$select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5');
$select_timezone->add('(GMT +10:00) EAST/AEST: Sydney, Guam, Vladivostok', '10');
+ $select_timezone->add('(GMT +10:30) New South Wales', '10.5');
$select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11');
+ $select_timezone->add('(GMT +11:30) Norfolk Island', '11.5');
$select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12');
+ $select_timezone->add('(GMT +12:45) Chatham Islands', '12.75');
$select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13');
$select_timezone->add('(GMT +14:00) Kiribati', '14');
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 9caff5c85..9cf188a41 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -28,8 +28,8 @@ $OUTPUT->include_script('list.js');
// subscribe to one or more mailboxes
if ($_action=='subscribe')
{
- if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
- $IMAP->subscribe($mboxes);
+ if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))
+ $IMAP->subscribe(array($mbox));
if ($OUTPUT->ajax_call)
$OUTPUT->remote_response('// subscribed');
@@ -38,8 +38,8 @@ if ($_action=='subscribe')
// unsubscribe one or more mailboxes
else if ($_action=='unsubscribe')
{
- if ($mboxes = get_input_value('_mboxes', RCUBE_INPUT_POST))
- $IMAP->unsubscribe($mboxes);
+ if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))
+ $IMAP->unsubscribe(array($mbox));
if ($OUTPUT->ajax_call)
$OUTPUT->remote_response('// unsubscribed');