Aleksander Machniak
2012-10-24 e04e3144407b7a863999d8aeaf6c3a653219359f
Add option to disable saving sent mail in Sent folder - no_save_sent_messages (#1488686)
6 files modified
27 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
config/main.inc.php.dist 10 ●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 5 ●●●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 5 ●●●●● patch | view | raw | blame | history
skins/classic/templates/compose.html 4 ●●●● patch | view | raw | blame | history
skins/larry/templates/compose.html 2 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Add option to disable saving sent mail in Sent folder - no_save_sent_messages (#1488686)
- Fix handling dont_override with message_sort_col and message_sort_order settings (#1488760)
- Fix HTML part detection in messages with attachments (#1488769)
- Fix bug where wrong words were highlighted on spell-before-send check
config/main.inc.php.dist
@@ -182,6 +182,9 @@
// ONLY ENABLE IT IF YOU'RE REALLY SURE WHAT YOU'RE DOING!
$rcmail_config['enable_installer'] = false;
// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'] = array();
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$rcmail_config['support_url'] = '';
@@ -349,9 +352,6 @@
// send plaintext messages as format=flowed
$rcmail_config['send_format_flowed'] = true;
// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'] = array();
// Set identities access level:
// 0 - many identities with possibility to edit all params
// 1 - many identities with possibility to edit all params but not email address
@@ -379,6 +379,10 @@
// Enable DNS checking for e-mail address validation
$rcmail_config['email_dns_check'] = false;
// Disables saving sent messages in Sent folder (like gmail) (Default: false)
// Note: useful when SMTP server stores sent mail in user mailbox
$rcmail_config['no_save_sent_messages'] = false;
// ----------------------------------
// PLUGINS
// ----------------------------------
program/steps/mail/compose.inc
@@ -1528,6 +1528,11 @@
{
  global $RCMAIL;
  // we'll not save the message, so it doesn't matter
  if ($RCMAIL->config->get('no_save_sent_messages')) {
    return true;
  }
  if ($RCMAIL->storage->folder_exists($folder, true)) {
    return true;
  }
program/steps/mail/sendmail.inc
@@ -676,8 +676,7 @@
    $smtp_error, $mailbody_file, $smtp_opts);
  // return to compose page if sending failed
  if (!$sent)
    {
  if (!$sent) {
    // remove temp file
    if ($mailbody_file) {
      unlink($mailbody_file);
@@ -706,7 +705,7 @@
// Determine which folder to save message
if ($savedraft)
  $store_target = $CONFIG['drafts_mbox'];
else
else if (!$RCMAIL->config->get('no_save_sent_messages'))
  $store_target = isset($_POST['_store_target']) ? get_input_value('_store_target', RCUBE_INPUT_POST) : $CONFIG['sent_mbox'];
if ($store_target) {
skins/classic/templates/compose.html
@@ -143,10 +143,10 @@
    </tr><tr>
        <td><label for="rcmcomposepriority"><roundcube:label name="priority" />:</label></td>
        <td><roundcube:object name="prioritySelector" form="form" id="rcmcomposepriority" /></td>
    </tr><tr>
    </tr><roundcube:if condition="!config:no_save_sent_messages" /><tr>
        <td><label><roundcube:label name="savesentmessagein" />:</label></td>
        <td><roundcube:object name="storetarget" maxlength="30" /></td>
    </tr>
    </tr><roundcube:endif />
    </table>
</div>
skins/larry/templates/compose.html
@@ -140,9 +140,11 @@
        <span class="composeoption">
            <label><roundcube:object name="dsnCheckBox" form="form" id="rcmcomposedsn" /> <roundcube:label name="dsn" /></label>
        </span>
                <roundcube:if condition="!config:no_save_sent_messages" />
        <span class="composeoption">
            <label><roundcube:label name="savesentmessagein" /> <roundcube:object name="storetarget" maxlength="30" style="max-width:12em" /></label>
        </span>
                <roundcube:endif />
        <roundcube:container name="composeoptions" id="composeoptions" />
    </div>
</div>