[help]enotify "mail to" run fine edit via managesieve 0.4.4 complied failed

Stephan Bosch stephan at rename-it.nl
Wed Apr 6 22:02:14 UTC 2016


Op 4/6/2016 om 1:25 PM schreef wuwei:
> hi all
>      edit via vi editor to change dovecot.sieve and enotify works fine.but
> when I telnet 4190 port via managesieve to edit it with the same code,the
> managesieve said "NO "Error in MANAGESIEVE command CHECKSCRIPT: "", find
> many topic in wiki and maillist but not solved. 
>      need you help!thanks!!dovecot version 2.2.15,pigonhole version 0.4.4
>      here are more infos below:
> *managesieve cmds:*
> "IMPLEMENTATION" "Dovecot Pigeonhole"
> "SIEVE" "fileinto reject envelope encoded-character vacation subaddress
> comparator-i;ascii-numeric relational regex imap4flags copy include
> variables body enotify environment mailbox date ihave duplicate
> vacation-seconds"
> "NOTIFY" "mailto"
> "SASL" "PLAIN LOGIN"
> "VERSION" "1.0"
> OK "Dovecot ready."
> listscripts
> NO "Error in MANAGESIEVE command received by server."
> AUTHENTICATE "PLAIN" "AGFuZ196aGFAdG9tLmNvbQAxMTExMTE="
> OK "Logged in."
> listscripts
> "blackwhitelist"
> "rulefilter" ACTIVE
> OK "Listscripts completed."
> getscript "rulefilter"
> {471}
> require
> ["reject","fileinto","imap4flags","vacation","regex","encoded-character","include","copy","enotify","variables"];
> if header :matches "Subject" "*" {
>         set "Subject" "${1}";
> }
> if header :matches "From" "*" {
>         set "From" "${1}";
> }
> if header :matches "Message-ID" "*" {
>         set "msg_id" "${1}";
> }
> if header :matches "To" "*" {
>         set "To" "${1}";
> }
> if header :matches "Date" "*" {
>         set "Date" "${1}";
> }
> notify "mailto:wuweiwwd at tom.com";
>
> OK "Getscript completed."
> checkscript {471}
> require
> ["reject","fileinto","imap4flags","vacation","regex","encoded-character","include","copy","enotify","variables"];
> if header :matches "Subject" "*" {
>         set "Subject" "${1}";
> }
> if header :matches "From" "*" {
>         set "From" "${1}";
> }
> if header :matches "Message-ID" "*" {
>         set "msg_id" "${1}";
> }
> if header :matches "To" "*" {
>         set "To" "${1}";
> }
> if header :matches "Date" "*" {
>         set "Date" "${1}";
> }
> notify "mailto:wuweiwwd at tom.com";
> *NO "Error in MANAGESIEVE command CHECKSCRIPT: "*
> BYE "Disconnected for inactivity"
> Connection closed by foreign host.

Copy-pasting in your terminal does not necessarily preserve TABs and
newlines as-is. This means that the {471} bytes for the length of what
you're pasting is probably not correct (in this case too low). The rest
of the script is then interpreted as subsequent commands. causing
obscure errors.  I find it difficult to tell for sure how many bytes it
will be. If you're just fooling around, you could try a byte count that
is a little too high and bridge the gap with spaces and newlines;
eventually it will be accepted.

Why are you doing this anyway? If you upgrade to Pigeonhole v0.4.7+, you
can manage scripts from command line using the "doveadm sieve" command.
If that is not an option, there are a few command line ManageSieve
clients available; e.g., "sieve-connect".

Regards,

Stephan.




More information about the dovecot mailing list