mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-11 22:44:29 +08:00
Fix Sieve message flag parser (closes #1059)
This commit is contained in:
parent
4975b21c42
commit
a6f11699ef
3 changed files with 10 additions and 6 deletions
|
@ -112,13 +112,17 @@ impl JsonObjectParser for Keyword {
|
||||||
|
|
||||||
impl From<String> for Keyword {
|
impl From<String> for Keyword {
|
||||||
fn from(value: String) -> Self {
|
fn from(value: String) -> Self {
|
||||||
if value.starts_with('$') {
|
if value
|
||||||
|
.as_bytes()
|
||||||
|
.first()
|
||||||
|
.is_some_and(|&ch| [b'$', b'\\'].contains(&ch))
|
||||||
|
{
|
||||||
let mut hash = 0;
|
let mut hash = 0;
|
||||||
let mut shift = 0;
|
let mut shift = 0;
|
||||||
|
|
||||||
for &ch in value.as_bytes() {
|
for &ch in value.as_bytes().iter().skip(1) {
|
||||||
if shift < 128 {
|
if shift < 128 {
|
||||||
hash |= (ch as u128) << shift;
|
hash |= (ch.to_ascii_lowercase() as u128) << shift;
|
||||||
shift += 8;
|
shift += 8;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -38,7 +38,7 @@ if not mailboxexists ["Drafts", "Sent Items"] {
|
||||||
|
|
||||||
# File into new mailboxes using flags
|
# File into new mailboxes using flags
|
||||||
fileinto :create "INBOX / Folder ";
|
fileinto :create "INBOX / Folder ";
|
||||||
fileinto :flags ["$important", "$seen"] :create "My/Nested/Mailbox/with/multiple/levels";
|
fileinto :flags ["$important", "\\Seen"] :create "My/Nested/Mailbox/with/multiple/levels";
|
||||||
|
|
||||||
# Make sure all mailboxes were created
|
# Make sure all mailboxes were created
|
||||||
if not mailboxexists "Inbox/Folder" {
|
if not mailboxexists "Inbox/Folder" {
|
||||||
|
|
|
@ -381,14 +381,14 @@ pub async fn jmap_tests() {
|
||||||
email_query_changes::test(&mut params).await;
|
email_query_changes::test(&mut params).await;
|
||||||
email_copy::test(&mut params).await;
|
email_copy::test(&mut params).await;
|
||||||
thread_get::test(&mut params).await;
|
thread_get::test(&mut params).await;
|
||||||
thread_merge::test(&mut params).await;*/
|
thread_merge::test(&mut params).await;
|
||||||
mailbox::test(&mut params).await;
|
mailbox::test(&mut params).await;
|
||||||
delivery::test(&mut params).await;
|
delivery::test(&mut params).await;
|
||||||
auth_acl::test(&mut params).await;
|
auth_acl::test(&mut params).await;
|
||||||
auth_limits::test(&mut params).await;
|
auth_limits::test(&mut params).await;
|
||||||
auth_oauth::test(&mut params).await;
|
auth_oauth::test(&mut params).await;
|
||||||
event_source::test(&mut params).await;
|
event_source::test(&mut params).await;
|
||||||
push_subscription::test(&mut params).await;
|
push_subscription::test(&mut params).await;*/
|
||||||
sieve_script::test(&mut params).await;
|
sieve_script::test(&mut params).await;
|
||||||
vacation_response::test(&mut params).await;
|
vacation_response::test(&mut params).await;
|
||||||
email_submission::test(&mut params).await;
|
email_submission::test(&mut params).await;
|
||||||
|
|
Loading…
Add table
Reference in a new issue