-
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.
fix: line ending for sieve scripts should be clrf
Ref https://www.rfc-editor.org/rfc/rfc5228#section-2.2 Signed-off-by: Daniel Kesselberg <[email protected]>
- Loading branch information
Showing
11 changed files
with
25 additions
and
24 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
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.