-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10002 from nextcloud/chore/noid/newlines-for-siev…
…e-ooo fix: line ending for sieve scripts should be clrf
- Loading branch information
Showing
12 changed files
with
26 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,7 @@ SPDX-FileCopyrightText = "2022 Nextcloud GmbH and Nextcloud contributors" | |
SPDX-License-Identifier = "AGPL-3.0-or-later" | ||
|
||
[[annotations]] | ||
path = ["src/tests/data/[email protected]", "src/tests/data/[email protected]", "src/tests/data/[email protected]", "src/tests/data/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/imap.localhost.ca.crt", "tests/data/smime-certs/domain.tld.ca.crt", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/decrypted-message-body.txt", "tests/data/decrypted-signed-opaque-message-body.txt", "tests/data/encrypted-message.txt", "tests/data/encrypted-signed-opaque-message.txt", "tests/data/sieve-vacation-cleaned.txt", "tests/data/sieve-vacation-off.txt", "tests/data/sieve-vacation-on-no-end-date.txt", "tests/data/sieve-vacation-on-no-tz.txt", "tests/data/sieve-vacation-on-special-chars-message.txt", "tests/data/sieve-vacation-on-special-chars-subject.txt", "tests/data/sieve-vacation-on-subject-placeholder.txt", "tests/data/sieve-vacation-on.txt", "tests/data/signed-message.txt", "tests/data/signed-opaque-message.txt"] | ||
path = ["src/tests/data/[email protected]", "src/tests/data/[email protected]", "src/tests/data/[email protected]", "src/tests/data/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/imap.localhost.ca.crt", "tests/data/smime-certs/domain.tld.ca.crt", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/smime-certs/[email protected]", "tests/data/decrypted-message-body.txt", "tests/data/decrypted-signed-opaque-message-body.txt", "tests/data/encrypted-message.txt", "tests/data/encrypted-signed-opaque-message.txt", "tests/data/sieve-vacation-cleaned.sieve", "tests/data/sieve-vacation-off.sieve", "tests/data/sieve-vacation-on-no-end-date.sieve", "tests/data/sieve-vacation-on-no-tz.sieve", "tests/data/sieve-vacation-on-special-chars-message.sieve", "tests/data/sieve-vacation-on-special-chars-subject.sieve", "tests/data/sieve-vacation-on-subject-placeholder.sieve", "tests/data/sieve-vacation-on.sieve", "tests/data/signed-message.txt", "tests/data/signed-opaque-message.txt"] | ||
precedence = "aggregate" | ||
SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors" | ||
SPDX-License-Identifier = "AGPL-3.0-or-later" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ protected function setUp(): void { | |
} | ||
|
||
public function testParseEnabledResponder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on.txt"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on.sieve"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->parseOutOfOfficeState($script); | ||
self::assertEquals($script, $actual->getSieveScript()); | ||
|
@@ -39,8 +39,8 @@ public function testParseEnabledResponder(): void { | |
} | ||
|
||
public function testParseDisabledResponder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-off.txt"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-off.sieve"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->parseOutOfOfficeState($script); | ||
self::assertEquals($script, $actual->getSieveScript()); | ||
|
@@ -54,7 +54,7 @@ public function testParseDisabledResponder(): void { | |
} | ||
|
||
public function testParseLeaveForeignScriptUntouched(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->parseOutOfOfficeState($script); | ||
self::assertEquals($script, $actual->getSieveScript()); | ||
|
@@ -63,8 +63,8 @@ public function testParseLeaveForeignScriptUntouched(): void { | |
} | ||
|
||
public function testParseOldEnabledResponder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-no-tz.txt"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-no-tz.sieve"); | ||
$cleanedScript = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->parseOutOfOfficeState($script); | ||
self::assertEquals($script, $actual->getSieveScript()); | ||
|
@@ -78,8 +78,8 @@ public function testParseOldEnabledResponder(): void { | |
} | ||
|
||
public function testBuildEnabledResponder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
|
@@ -96,8 +96,8 @@ public function testBuildEnabledResponder(): void { | |
} | ||
|
||
public function testBuildEnabledResponderWithoutEndDate(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-no-end-date.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-no-end-date.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
|
@@ -114,16 +114,16 @@ public function testBuildEnabledResponderWithoutEndDate(): void { | |
} | ||
|
||
public function testBuildEnabledResponderWithSpecialCharsInMessage(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-special-chars-message.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-special-chars-message.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
true, | ||
new DateTimeImmutable("2022-09-02T00:00:00+0100"), | ||
null, | ||
"On vacation", | ||
"I'm on vacation.\n\"Hello, World!\"\n\\ escaped backslash", | ||
"I'm on vacation.\r\n\"Hello, World!\"\r\n\\ escaped backslash", | ||
), | ||
$script, | ||
["Test Test <[email protected]>", "Test Alias <[email protected]>"], | ||
|
@@ -132,8 +132,8 @@ public function testBuildEnabledResponderWithSpecialCharsInMessage(): void { | |
} | ||
|
||
public function testBuildEnabledResponderWithSpecialCharsInSubject(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-special-chars-subject.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-special-chars-subject.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
|
@@ -150,8 +150,8 @@ public function testBuildEnabledResponderWithSpecialCharsInSubject(): void { | |
} | ||
|
||
public function testBuildEnabledResponderWithSubjectPlaceholder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-subject-placeholder.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-on-subject-placeholder.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
|
@@ -168,8 +168,8 @@ public function testBuildEnabledResponderWithSubjectPlaceholder(): void { | |
} | ||
|
||
public function testBuildDisabledResponder(): void { | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.txt"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-off.txt"); | ||
$script = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-cleaned.sieve"); | ||
$expected = file_get_contents(__DIR__ . "/../../../data/sieve-vacation-off.sieve"); | ||
|
||
$actual = $this->outOfOfficeParser->buildSieveScript( | ||
new OutOfOfficeState( | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ if address "From" "[email protected]" { | |
} | ||
|
||
### Nextcloud Mail: Vacation Responder ### DON'T EDIT ### | ||
# DATA: {"version":1,"enabled":true,"start":"2022-09-02T00:00:00+01:00","subject":"On vacation","message":"I'm on vacation.\n\"Hello, World!\"\n\\ escaped backslash"} | ||
# DATA: {"version":1,"enabled":true,"start":"2022-09-02T00:00:00+01:00","subject":"On vacation","message":"I'm on vacation.\r\n\"Hello, World!\"\r\n\\ escaped backslash"} | ||
if currentdate :value "ge" "iso8601" "2022-09-01T23:00:00Z" { | ||
vacation :days 4 :subject "On vacation" :addresses ["Test Test <[email protected]>", "Test Alias <[email protected]>"] "I'm on vacation. | ||
\"Hello, World!\" | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.