diff --git a/dev/Common/File.js b/dev/Common/File.js index acd5a370e..f333235fa 100644 --- a/dev/Common/File.js +++ b/dev/Common/File.js @@ -116,7 +116,8 @@ export const FileType = { Spreadsheet: 'spreadsheet', Presentation: 'presentation', Certificate: 'certificate', - Archive: 'archive' + Archive: 'archive', + Calendar: 'calendar' }; export const FileInfo = { @@ -190,6 +191,9 @@ export const FileInfo = { case 'eml' == ext || ['message/delivery-status', 'message/rfc822'].includes(mimeType): result = FileType.Eml; break; + case 'ics' == ext || mimeType == 'text/calendar': + result = FileType.Calendar; + break; case 'text' == mimeTypeParts[0] || 'txt' == ext || 'log' == ext: result = FileType.Text; break; @@ -240,6 +244,7 @@ export const FileInfo = { case FileType.Certificate: case FileType.Spreadsheet: case FileType.Presentation: + case FileType.Calendar: return result + '-' + fileType; } return result; diff --git a/dev/Component/EmailAddresses.js b/dev/Component/EmailAddresses.js index 70db0536d..1f7646c74 100644 --- a/dev/Component/EmailAddresses.js +++ b/dev/Component/EmailAddresses.js @@ -165,7 +165,9 @@ export class EmailAddressesComponent { _parseInput(force) { let val = this.input.value; - if ((force || val.includes(',') || val.includes(';')) && this._parseValue(val)) { + if ((force || val.includes(',') || val.includes(';') + || (val.charAt(val.length-1)===' ' && this._simpleEmailMatch(val))) + && this._parseValue(val)) { this.input.value = ''; } this._resizeInput(); @@ -284,6 +286,13 @@ export class EmailAddressesComponent { } } + _simpleEmailMatch(value) { + // A very SIMPLE test to check if the value might be an email + const val = value.trim(); + return /^[^@]*<[^\s@]{1,128}@[^\s@]{1,256}\.[\w]{2,32}>$/g.test(val) + || /^[^\s@]{1,128}@[^\s@]{1,256}\.[\w]{2,32}$/g.test(val); + } + _renderTags() { let self = this; [...self.ul.children].forEach(node => node !== self.inputCont && node.remove()); diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 183e5b831..e1557d268 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -493,6 +493,19 @@ export class ComposePopupView extends AbstractViewPopup { || getNotification(Notifications.CantSendMessage)); } } else { + if (arrayLength(this.aDraftInfo) > 0) { + const flag = { + 'reply': '\\answered', + 'forward': '$forwarded' + }[this.aDraftInfo[0]]; + if (flag) { + const aFlags = MessageUserStore.message().flags(); + if (aFlags.indexOf(flag) === -1) { + aFlags.push(flag); + MessageUserStore.message().flags(aFlags); + } + } + } this.close(); } setFolderETag(this.draftsFolder(), ''); diff --git a/dev/View/User/MailBox/FolderList.js b/dev/View/User/MailBox/FolderList.js index 393f23a27..2120e8e7f 100644 --- a/dev/View/User/MailBox/FolderList.js +++ b/dev/View/User/MailBox/FolderList.js @@ -1,7 +1,7 @@ import ko from 'ko'; import { ScopeFolderList, ScopeMessageList } from 'Common/Enums'; -import { addShortcut, stopEvent } from 'Common/Globals'; +import { addShortcut, leftPanelDisabled, stopEvent } from 'Common/Globals'; import { mailBox, settings } from 'Common/Links'; //import { setFolderETag } from 'Common/Cache'; import { addComputablesTo } from 'External/ko'; @@ -21,6 +21,7 @@ import { ContactsPopupView } from 'View/Popup/Contacts'; import { ComposePopupView } from 'View/Popup/Compose'; import { setExpandedFolder, foldersFilter } from 'Model/FolderCollection'; +import { ThemeStore } from '../../../Stores/Theme'; export class MailFolderList extends AbstractViewLeft { constructor() { @@ -112,6 +113,9 @@ export class MailFolderList extends AbstractViewLeft { search = 'unseen'; } hasher.setHash(mailBox(folder.fullNameHash, 1, search)); + + // in mobile mode hide the panel when a folder is clicked + ThemeStore.isMobile() && leftPanelDisabled()===false && leftPanelDisabled(true); } AppUserStore.focusedState(ScopeMessageList); diff --git a/integrations/nextcloud/snappymail/lib/AppInfo/Application.php b/integrations/nextcloud/snappymail/lib/AppInfo/Application.php index 5fad178eb..9a8e0748c 100644 --- a/integrations/nextcloud/snappymail/lib/AppInfo/Application.php +++ b/integrations/nextcloud/snappymail/lib/AppInfo/Application.php @@ -86,7 +86,8 @@ class Application extends App implements IBootstrap // https://github.com/nextcloud/server/issues/36083#issuecomment-1387370634 // \OC::$server->getSession()['snappymail-password'] = ''; SnappyMailHelper::loadApp(); - \RainLoop\Api::Actions()->Logout(true); +// \RainLoop\Api::Actions()->Logout(true); + \RainLoop\Api::Actions()->DoLogout(); }); // https://github.com/nextcloud/impersonate/issues/179 diff --git a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php index 5764da4c8..4839779d2 100644 --- a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php +++ b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php @@ -80,7 +80,9 @@ class SnappyMailHelper if ($doLogin && $aCredentials[1] && $aCredentials[2]) { try { $oActions->Logger()->AddSecret($aCredentials[2]); - $oAccount = $oActions->LoginProcess($aCredentials[1], $aCredentials[2], false); + + $bSignMe = $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAULT_OFF) === \RainLoop\Enumerations\SignMeType::DEFAULT_ON; + $oAccount = $oActions->LoginProcess($aCredentials[1], $aCredentials[2], $bSignMe); if ($oAccount) { $oActions->Plugins()->RunHook('login.success', array($oAccount)); $oActions->SetAuthToken($oAccount); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index eb7356db5..febf39be7 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -679,16 +679,17 @@ class Actions 'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(), + 'allowSpellcheck' => $oConfig->Get('defaults', 'allow_spellcheck', false), 'ViewHTML' => (bool) $oConfig->Get('defaults', 'view_html', true), 'ViewImages' => $oConfig->Get('defaults', 'view_images', 'ask'), 'ViewImagesWhitelist' => '', 'RemoveColors' => (bool) $oConfig->Get('defaults', 'remove_colors', false), 'AllowStyles' => false, 'ListInlineAttachments' => false, - 'CollapseBlockquotes' => true, + 'CollapseBlockquotes' => $oConfig->Get('defaults', 'collapse_blockquotes', true), 'MaxBlockquotesLevel' => 0, 'simpleAttachmentsList' => false, - 'listGrouped' => false, + 'listGrouped' => $oConfig->Get('defaults', 'mail_list_grouped', false), 'MessagesPerPage' => (int) $oConfig->Get('webmail', 'messages_per_page', 25), 'MessageReadDelay' => (int) $oConfig->Get('webmail', 'message_read_delay', 5), 'MsgDefaultAction' => (int) $oConfig->Get('defaults', 'msg_default_action', 1), @@ -773,7 +774,7 @@ class Actions $aResult['requireTLS'] = (bool) $oSettings->GetConf('requireTLS', false); $aResult['pgpSign'] = (bool) $oSettings->GetConf('pgpSign', false); $aResult['pgpEncrypt'] = (bool) $oSettings->GetConf('pgpEncrypt', false); - $aResult['allowSpellcheck'] = (bool) $oSettings->GetConf('allowSpellcheck', false); + $aResult['allowSpellcheck'] = (bool) $oSettings->GetConf('allowSpellcheck', $aResult['allowSpellcheck']); // $aResult['allowCtrlEnterOnCompose'] = (bool) $oSettings->GetConf('allowCtrlEnterOnCompose', true); $aResult['ViewHTML'] = (bool)$oSettings->GetConf('ViewHTML', $aResult['ViewHTML']); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 33f7fa2cf..63d3c9737 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -139,7 +139,14 @@ trait UserAuth $this->imapConnect($oAccount, true); if ($bMainAccount) { - $bSignMe && $this->SetSignMeToken($oAccount); + if($bSignMe){ + // SetAuthToken token needs to be called before SetSignMeToken + // because $_COOKIE['smctoken'] is used by Crypt::Passphrase. + // If the $_COOKIE['smctoken'] is not set then SetSignMeToken + // throws an exception + $this->SetAuthToken($oAccount); + $this->SetSignMeToken($oAccount); + } $this->StorageProvider()->Put($oAccount, StorageType::SESSION, Utils::GetSessionToken(), 'true'); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index b9c92220c..8f7bdf1a1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -301,10 +301,13 @@ Values: "match" - whitelist or ask "always" - show always'), 'contacts_autosave' => array(true), - 'mail_use_threads' => array(false), + 'mail_list_grouped' => array(false), + 'mail_use_threads' => array(false), 'allow_draft_autosave' => array(true), 'mail_reply_same_folder' => array(false), 'msg_default_action' => array(1, '1 - reply, 2 - reply all'), + 'collapse_blockquotes' => array(true), + 'allow_spellcheck' => array(false) ), 'logs' => array( diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/cookies.php b/snappymail/v/0.0.0/app/libraries/snappymail/cookies.php index 9c670239e..3ac579b2f 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/cookies.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/cookies.php @@ -83,7 +83,7 @@ class Cookies if ($cookie_remove) { \header_remove('Set-Cookie'); foreach ($cookies as $cookie) { - \header($cookie); + \header($cookie,false); } } @@ -118,14 +118,14 @@ class Cookies foreach (\str_split($sValue, $iMaxSize) as $i => $sPart) { $sCookieName = $i ? "{$sName}~{$i}" : $sName; Log::debug('COOKIE', "set {$sCookieName}"); - static::_set($sCookieName, $sPart, $iExpire); + static::_set($sCookieName, $sPart, $iExpire, $httponly); } // Delete unused old 4K split cookie parts foreach (\array_keys($_COOKIE) as $sCookieName) { $aSplit = \explode('~', $sCookieName); if (isset($aSplit[1]) && $aSplit[0] == $sName && $aSplit[1] > $i) { Log::debug('COOKIE', "unset {$sCookieName}"); - static::_set($sCookieName, '', 0); + static::_set($sCookieName, '', 0, $httponly); } } } diff --git a/snappymail/v/0.0.0/app/localization/en/user.json b/snappymail/v/0.0.0/app/localization/en/user.json index e777708ff..b444b2dbc 100644 --- a/snappymail/v/0.0.0/app/localization/en/user.json +++ b/snappymail/v/0.0.0/app/localization/en/user.json @@ -254,6 +254,7 @@ "TITLE_UPDATE_IDENTITY": "Update Identity?", "BUTTON_ADD_IDENTITY": "Add", "BUTTON_UPDATE_IDENTITY": "Update", + "LABEL_SIGNATURE_ADD": "Add/Edit signature", "LABEL_SIGNATURE_INSERT_BEFORE": "Insert this signature before quoted text in replies" }, "POPUPS_CREATE_FOLDER": { diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html index f23d124e7..15fbae6ba 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsCompose.html @@ -130,7 +130,7 @@