Author |
|
mlnorth Newbie
Joined: 25 October 2018 Location: Sweden
Online Status: Offline Posts: 9
|
Posted: 25 October 2018 at 3:07am | IP Logged
|
|
|
Hello!
I tested to add a filter to sieve but it failed.
The log shows following:
[10:02:45.11][c66ad136] MANAGE-SIEVE[NOTE]: Start connection to "tcp://mail.irf.se:4190"
[10:02:45.11][c66ad136] MANAGE-SIEVE[DATA]: < "IMPLEMENTATION" "Cyrus timsieved git2.4.17+0-Debian-2.4.17+nocaldav-0+deb8u2"\r\n
[10:02:45.11][c66ad136] MANAGE-SIEVE[DATA]: < "SASL" "PLAIN"\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < "STARTTLS"\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < "UNAUTHENTICATE"\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < OK\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: > AUTHENTICATE "PLAIN" {24+}\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: > AG1hdHNsAHZsJSZBbTQ1Ng==\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < OK\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: > LISTSCRIPTS\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < OK\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: > CHECKSCRIPT {266+}\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: > # Sieve filter\r\nrequire ["fileinto", "copy", "vacation"] ;\r\n\r\n#begin = filters =\r\n#sieve filter\r\n\r\n\r\n#sieve_filter:1;0;0;cyrus;3;INBOX.cyrus\r\nif header :contains ["From"] "cyrus" {\r\nfileinto "INBOX.cyrus" ;\r\nstop ;\r\n}\r\n\r\n#end sieve filter\r\n\r\n#end = filters =\r\nkeep ;\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[DATA]: < NO "Expected a command. Got something else."\r\n
[10:02:45.12][c66ad136] MANAGE-SIEVE[WARNING]: MailSo\Sieve\Exceptions\NegativeResponseException: MailSo-Sieve-Exceptions-NegativeResponseException in /usr/share/afterlogic/vendor/afterlogic/mailso/lib/MailSo/Sieve/ManageSieveClient.php:606
Stack trace:
#0 /usr/share/afterlogic/vendor/afterlogic/mailso/lib/MailSo/Sieve/ManageSieveClient.php(528): MailSo\Sieve\ManageSieveClient->validateResponse(Array)
#1 /usr/share/afterlogic/vendor/afterlogic/mailso/lib/MailSo/Sieve/ManageSieveClient.php(350): MailSo\Sieve\ManageSieveClient->sendRequestWithCheck('# Sieve filter\r...')
#2 /usr/share/afterlogic/modules/Mail/Managers/Sieve/Manager.php(585): MailSo\Sieve\ManageSieveClient->CheckScript('# Sieve filter\r...')
#3 /usr/share/afterlogic/modules/Mail/Managers/Sieve/Manager.php(613): Aurora\Modules\Mail\Managers\Sieve\Manager->_setSieveFile(Object(Aurora\Modules\Mail\Classes\Account), '# Sieve filter\r...')
#4 /usr/share/afterlogic/modules/Mail/Managers/Sieve/Manager.php(467): Aurora\Modules\Mail\Managers\Sieve\Manager->_resaveSectionsData(Object(Aurora\Modules\Mail\Classes\Account))
#5 /usr/share/afterlogic/modules/Mail/Managers/Sieve/Manager.php(399): Aurora\Modules\Mail\Managers\Sieve\Manager->setFiltersRawData(Object(Aurora\Modules\Mail\Classes\Account), '#sieve filter\n\n...')
#6 /usr/share/afterlogic/modules/Mail/Module.php(4831): Aurora\Modules\Mail\Managers\Sieve\Manager->updateSieveFilters(Object(Aurora\Modules\Mail\Classes\Account), Array)
#7 [internal function]: Aurora\Modules\Mail\Module->UpdateFilters(7, Array)
#8 /usr/share/afterlogic/system/Module/AbstractModule.php(880): call_user_func_array(Array, Array)
#9 /usr/share/afterlogic/modules/Core/Module.php(535): Aurora\System\Module\AbstractModule->CallMethod('UpdateFilters', Array, true)
#10 [internal function]: Aurora\Modules\Core\Module->EntryApi()
#11 /usr/share/afterlogic/system/Module/AbstractModule.php(620): call_user_func_array(Array, Array)
#12 /usr/share/afterlogic/system/Module/Manager.php(704): Aurora\System\Module\AbstractModule->RunEntry('api')
#13 /usr/share/afterlogic/system/Application.php(88): Aurora\System\Module\Manager->RunEntry('api')
#14 /usr/share/afterlogic/index.php(21): Aurora\System\Application::Start()
#15 {main}
It manage to login and send some commands. But as soon as the script are going to inserted it goes wrong. I have tested with other webmail systeems that also using sieve and it works without problem. I think webmail lite looks promising but with this error I can't unfortunately use it.
/Regards Mats
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 25 October 2018 at 3:14am | IP Logged
|
|
|
In addition to placing Sieve rules, WebMail adds special lines which are presented as comments (lines starting with # character) and contain encoded data handled by WebMail. And according to the logs, ManageSieve server you use doesn't support comments in Sieve scripts. Hence, it isn't going to work there I'm afraid. Consider checking Sieve server configuration in regard to enabling comments support.
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|
mlnorth Newbie
Joined: 25 October 2018 Location: Sweden
Online Status: Offline Posts: 9
|
Posted: 25 October 2018 at 3:35am | IP Logged
|
|
|
Thank you for thw answer.
I tried to follow the protocol from the log file like this:
root@webmaillite8:~# telnet mail 4190
Trying 2001:6b0:27:ff::c...
Connected to mail.irf.se.
Escape character is '^]'.
"IMPLEMENTATION" "Cyrus timsieved git2.4.17+0-Debian-2.4.17+nocaldav-0+deb8u2"
"SASL" "PLAIN"
"SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include env"
"STARTTLS"
"UNAUTHENTICATE"
OK
AUTHENTICATE "PLAIN" {24+}\r\n
NO "Expected string"
AUTHENTICATE "PLAIN" {24+}
AG1hdHNsAHZsJSZBbTQ1Ng==
OK
LISTSCRIPTS
OK
CHECKSCRIPT {266+}
NO "Expected a command. Got something else."
It seems that my sieve server doesn't understand the CHECKSCRIPT command. Can this be the case? I've checked my other sieve scripts and they conatins # for comments and they have no problems.
/Regards Mats
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 25 October 2018 at 3:44am | IP Logged
|
|
|
That's right, seems I was looking at the wrong line.
You can try skipping the check by removing or commenting out line ~585 in modules/Mail/Managers/Sieve/Manager.php file:
Code:
$oSieve->CheckScript($sText); |
|
|
Hope this helps.
--
Regards,
Igor, Afterlogic Support
|
Back to Top |
|
|
mlnorth Newbie
Joined: 25 October 2018 Location: Sweden
Online Status: Offline Posts: 9
|
Posted: 25 October 2018 at 6:10am | IP Logged
|
|
|
Thank you!
That workaround works.
I have also sent an mail to a cyrus maillist if this is a cyrus bug.
/Regards Mats
|
Back to Top |
|
|