Filtering mails with sieve filters

2020-10-30 Thread Odhiambo Washington
Hello good people,

I have dovecot- 2.3.7.2 (Ubuntu  Ubuntu 20.04.1 LTS) running fine.
However, I have a hitch with mail filtering.

Using SOGo as the webmail UI, I created a filter rule which resulted into
the rule below:

require ["fileinto"];
if allof (address :contains "from" "odhiambo") {
fileinto "INBOX/Odhiambo";
}

However, the test mail I sent did not end up the folder expected.

lda.log contains this info:
Oct 30 07:39:07 lda(wash@mydomain)<2415266>: Info:
sieve: msgid=: stored mail into mailbox 'INBOX'
Oct 30 07:39:07 lda(wash@mydomain)<2415266>: Info:
sieve: Execution of script /var/spool/virtual/mydomain/wash/.dovecot.sieve
failed, but implicit keep was successful (user logfile
/var/spool/virtual/mydomain/wash/.dovecot.sieve.log may reveal additional
details)

And the .dovecot.sieve.log contains:
sieve: info: started log at Oct 30 07:39:07.
error: msgid=: failed to store into mailbox
'INBOX/Odhiambo': *Invalid mailbox name: Name must not have '/' characters.*

What might be the problem here??


dovecot -n output is below:

# 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.7.2 ()
# OS: Linux 5.4.0-29-generic x86_64 Ubuntu 20.04.1 LTS ext4
# Hostname: jp.mydomain
auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
debug_log_path = /var/log/dovecot/debug.log
default_login_user = dovecot
default_vsz_limit = 2 G
disable_plaintext_auth = no
first_valid_uid = 110
hostname = gw.mydomain
info_log_path = /var/log/dovecot/info.log
log_path = /var/log/dovecot/error.log
mail_gid = Debian-exim
mail_location =
maildir:/var/spool/virtual/%d/%n/Maildir:INDEX=/var/spool/virtual/indexes/%d/%1n/%n
mail_plugins = fts
mail_privileged_group = mail
mail_server_admin = postmaster@mydomain
mail_uid = Debian-exim
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime foreverypart
extracttext imapsieve vnd.dovecot.imapsieve
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  fts_autoindex = yes
  fts_autoindex_exclude = \Junk
  fts_autoindex_exclude2 = \Trash
  fts_autoindex_exclude3 = \Drafts
  fts_autoindex_exclude4 = \Spam
  fts_enforced = yes
  imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
  imapsieve_mailbox1_causes = COPY
  imapsieve_mailbox1_name = Spam
  imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_from = Spam
  imapsieve_mailbox2_name = *
  plugin = fts managesieve sieve
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute
  sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
  sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
  sieve_plugins = sieve_imapsieve sieve_extprograms
}
postmaster_address = postmaster@mydomain
protocols = imap lmtp sieve
service auth {
  unix_listener auth-client {
mode = 0600
user = Debian-exim
  }
  unix_listener auth-userdb {
group = Debian-exim
user = Debian-exim
  }
}
service stats {
  unix_listener stats-reader {
user = Debian-exim
  }
  unix_listener stats-writer {
user = Debian-exim
  }
}
service submission-login {
  inet_listener submission {
port = 2587
  }
}
ssl_cert = 

Re: Filtering mails with sieve filters - SOLVED

2020-10-30 Thread Odhiambo Washington
Answering to myself,

The issue was as a result of a config parameter for SOGo:

Changed
NGImap4ConnectionStringSeparator = "/";

to

NGImap4ConnectionStringSeparator = ".";

and the problem is solved.


On Fri, 30 Oct 2020 at 11:43, Odhiambo Washington 
wrote:

> Hello good people,
>
> I have dovecot- 2.3.7.2 (Ubuntu  Ubuntu 20.04.1 LTS) running fine.
> However, I have a hitch with mail filtering.
>
> Using SOGo as the webmail UI, I created a filter rule which resulted into
> the rule below:
>
> require ["fileinto"];
> if allof (address :contains "from" "odhiambo") {
> fileinto "INBOX/Odhiambo";
> }
>
> However, the test mail I sent did not end up the folder expected.
>
> lda.log contains this info:
> Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
> Info: sieve: msgid= o8unvr152x...@mail.gmail.com>: stored mail into mailbox 'INBOX'
> Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
> Info: sieve: Execution of script
> /var/spool/virtual/mydomain/wash/.dovecot.sieve failed, but implicit keep
> was successful (user logfile
> /var/spool/virtual/mydomain/wash/.dovecot.sieve.log may reveal additional
> details)
>
> And the .dovecot.sieve.log contains:
> sieve: info: started log at Oct 30 07:39:07.
> error: msgid= o8unvr152x...@mail.gmail.com>: failed to store into mailbox
> 'INBOX/Odhiambo': *Invalid mailbox name: Name must not have '/'
> characters.*
>
> What might be the problem here??
>
>
> dovecot -n output is below:
>
> # 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.5.7.2 ()
> # OS: Linux 5.4.0-29-generic x86_64 Ubuntu 20.04.1 LTS ext4
> # Hostname: jp.mydomain
> auth_mechanisms = plain login
> auth_socket_path = /var/run/dovecot/auth-userdb
> debug_log_path = /var/log/dovecot/debug.log
> default_login_user = dovecot
> default_vsz_limit = 2 G
> disable_plaintext_auth = no
> first_valid_uid = 110
> hostname = gw.mydomain
> info_log_path = /var/log/dovecot/info.log
> log_path = /var/log/dovecot/error.log
> mail_gid = Debian-exim
> mail_location = 
> maildir:/var/spool/virtual/%d/%n/Maildir:INDEX=/var/spool/virtual/indexes/%d/%1n/%n
> mail_plugins = fts
> mail_privileged_group = mail
> mail_server_admin = postmaster@mydomain
> mail_uid = Debian-exim
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character 
> vacation subaddress comparator-i;ascii-numeric relational regex imap4flags 
> copy include variables body enotify environment mailbox date index ihave 
> duplicate mime foreverypart extracttext imapsieve vnd.dovecot.imapsieve
> namespace inbox {
>   inbox = yes
>   location =
>   mailbox Drafts {
> special_use = \Drafts
>   }
>   mailbox Junk {
> special_use = \Junk
>   }
>   mailbox Sent {
> special_use = \Sent
>   }
>   mailbox "Sent Messages" {
> special_use = \Sent
>   }
>   mailbox Trash {
> special_use = \Trash
>   }
>   prefix =
> }
> passdb {
>   args = /etc/dovecot/dovecot-sql.conf.ext
>   driver = sql
> }
> plugin {
>   fts_autoindex = yes
>   fts_autoindex_exclude = \Junk
>   fts_autoindex_exclude2 = \Trash
>   fts_autoindex_exclude3 = \Drafts
>   fts_autoindex_exclude4 = \Spam
>   fts_enforced = yes
>   imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
>   imapsieve_mailbox1_causes = COPY
>   imapsieve_mailbox1_name = Spam
>   imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
>   imapsieve_mailbox2_causes = COPY
>   imapsieve_mailbox2_from = Spam
>   imapsieve_mailbox2_name = *
>   plugin = fts managesieve sieve
>   sieve = file:~/sieve;active=~/.dovecot.sieve
>   sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute
>   sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
>   sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
>   sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
>   sieve_plugins = sieve_imapsieve sieve_extprograms
> }
> postmaster_address = postmaster@mydomain
> protocols = imap lmtp sieve
> service auth {
>   unix_listener auth-client {
> mode = 0600
> user = Debian-exim
>   }
>   unix_listener auth-userdb {
> group = Debian-exim
> user = Debian-exim
>   }
> }
> service stats {
>   unix_listener stats-reader {
> user = Debian-exim
>   }
>   unix_listener stats-writer {
> user = Debian-exim
>   }
> }
> service submission-login {
>   inet_listener submission {
> port = 2587
>   }
> }
> ssl_cert =  ssl_client_ca_dir = /etc/ssl/certs
> ssl_dh = # hidden, use -P to show it
> ssl_key = # hidden, use -P to show it
> userdb {
>   args = /etc/dovecot/dovecot-sql.conf.ext
>   driver = sql
> }
> protocol lmtp {
>   info_log_path = /var/log/dovecot/lmtp.log
>   log_path = /var/log/dovecot/lmtp-errors.log
>   mail_plugins = fts sieve
>   postmaster_address = postmaster@mydomain
> }
> protocol lda {
>   info_log_path = /var/log/dovecot/lda.log
>   log_path = /var/log/dovecot/lda-errors.log
>   mail_plugins = fts sieve
> }
>
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0

When is the Dovecot 2.3.12 release due?

2020-10-30 Thread Sidsel Jensen
Hi

We are very eager to test the zstd compression in the upcoming Dovecot 2.3.12 
release - any pointer as to when that is expected to be released?

Kind Regards,
  Sidsel


signature.asc
Description: Message signed with OpenPGP


doveadm replicator, what decides the timing on a full resync?

2020-10-30 Thread Norman King

Hello.

If running dovadm replicator status, i get something like the following.

root@mail2:~# doveadm replicator status
Queued 'sync' requests    0
Queued 'high' requests    0
Queued 'low' requests 0
Queued 'failed' requests  0
Queued 'full resync' requests 4
Waiting 'failed' requests 0
Total number of known users  1000

When would these full resyncs happen? Is it on a schedule? and if so 
where is said schedule configured?


doveadm replicator dsync-status shows plenty of available sessions.


Thanks.




--

regards
Norman King
Compass Foundation sysadmin/tech support

Phone, 856-974-5335 ext 221

supp...@compassfoundation.io 

Website 



Re: Filtering mails with sieve filters - SOLVED

2020-10-30 Thread Tom Talpey

You might consider adding "stop;" after the fileinto, otherwise
a second match might process the message again, moving it
elsewhere, etc.

Tom.

On 10/30/2020 5:47 AM, Odhiambo Washington wrote:


Answering to myself,

The issue was as a result of a config parameter for SOGo:

Changed
NGImap4ConnectionStringSeparator = "/";

to

NGImap4ConnectionStringSeparator = ".";

and the problem is solved.


On Fri, 30 Oct 2020 at 11:43, Odhiambo Washington > wrote:


Hello good people,

I have dovecot- 2.3.7.2 (Ubuntu  Ubuntu 20.04.1 LTS) running fine.
However, I have a hitch with mail filtering.

Using SOGo as the webmail UI, I created a filter rule which resulted
into the rule below:

require ["fileinto"];
if allof (address :contains "from" "odhiambo") {
     fileinto "INBOX/Odhiambo";
}

However, the test mail I sent did not end up the folder expected.

lda.log contains this info:
Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
Info: sieve:
msgid=mailto:o8unvr152x...@mail.gmail.com>>: stored mail into mailbox 'INBOX'
Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
Info: sieve: Execution of script
/var/spool/virtual/mydomain/wash/.dovecot.sieve failed, but implicit
keep was successful (user logfile
/var/spool/virtual/mydomain/wash/.dovecot.sieve.log may reveal
additional details)

And the .dovecot.sieve.log contains:
sieve: info: started log at Oct 30 07:39:07.
error:
msgid=mailto:o8unvr152x...@mail.gmail.com>>: failed to store into mailbox
'INBOX/Odhiambo': *Invalid mailbox name: Name must not have '/'
characters.*
*
*
What might be the problem here??


dovecot -n output is below:

# 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.7.2 ()
# OS: Linux 5.4.0-29-generic x86_64 Ubuntu 20.04.1 LTS ext4
# Hostname: jp.mydomain
auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
debug_log_path = /var/log/dovecot/debug.log
default_login_user = dovecot
default_vsz_limit = 2 G
disable_plaintext_auth = no
first_valid_uid = 110
hostname = gw.mydomain
info_log_path = /var/log/dovecot/info.log
log_path = /var/log/dovecot/error.log
mail_gid = Debian-exim
mail_location = 
maildir:/var/spool/virtual/%d/%n/Maildir:INDEX=/var/spool/virtual/indexes/%d/%1n/%n
mail_plugins = fts
mail_privileged_group = mail
mail_server_admin = postmaster@mydomain
mail_uid = Debian-exim
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date index ihave duplicate 
mime foreverypart extracttext imapsieve vnd.dovecot.imapsieve
namespace inbox {
   inbox = yes
   location =
   mailbox Drafts {
 special_use = \Drafts
   }
   mailbox Junk {
 special_use = \Junk
   }
   mailbox Sent {
 special_use = \Sent
   }
   mailbox "Sent Messages" {
 special_use = \Sent
   }
   mailbox Trash {
 special_use = \Trash
   }
   prefix =
}
passdb {
   args = /etc/dovecot/dovecot-sql.conf.ext
   driver = sql
}
plugin {
   fts_autoindex = yes
   fts_autoindex_exclude = \Junk
   fts_autoindex_exclude2 = \Trash
   fts_autoindex_exclude3 = \Drafts
   fts_autoindex_exclude4 = \Spam
   fts_enforced = yes
   imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
   imapsieve_mailbox1_causes = COPY
   imapsieve_mailbox1_name = Spam
   imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
   imapsieve_mailbox2_causes = COPY
   imapsieve_mailbox2_from = Spam
   imapsieve_mailbox2_name = *
   plugin = fts managesieve sieve
   sieve = file:~/sieve;active=~/.dovecot.sieve
   sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute
   sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
   sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
   sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
   sieve_plugins = sieve_imapsieve sieve_extprograms
}
postmaster_address = postmaster@mydomain
protocols = imap lmtp sieve
service auth {
   unix_listener auth-client {
 mode = 0600
 user = Debian-exim
   }
   unix_listener auth-userdb {
 group = Debian-exim
 user = Debian-exim
   }
}
service stats {
   unix_listener stats-reader {
 user = Debian-exim
   }
   unix_listener stats-writer {
 user = Debian-exim
   }
}
service submission-login {
   inet_listener submission {
 port = 2587
   }
}
ssl_cert = -- 
Best regards,

Odhiambo WASHINGTON,
Nair

Re: Filtering mails with sieve filters - SOLVED

2020-10-30 Thread Odhiambo Washington
I doubt there is a way to do that when using the SOGo web UI.

On Fri, 30 Oct 2020 at 15:57, Tom Talpey  wrote:

> You might consider adding "stop;" after the fileinto, otherwise
> a second match might process the message again, moving it
> elsewhere, etc.
>
> Tom.
>
> On 10/30/2020 5:47 AM, Odhiambo Washington wrote:
> >
> > Answering to myself,
> >
> > The issue was as a result of a config parameter for SOGo:
> >
> > Changed
> > NGImap4ConnectionStringSeparator = "/";
> >
> > to
> >
> > NGImap4ConnectionStringSeparator = ".";
> >
> > and the problem is solved.
> >
> >
> > On Fri, 30 Oct 2020 at 11:43, Odhiambo Washington  > > wrote:
> >
> > Hello good people,
> >
> > I have dovecot- 2.3.7.2 (Ubuntu  Ubuntu 20.04.1 LTS) running fine.
> > However, I have a hitch with mail filtering.
> >
> > Using SOGo as the webmail UI, I created a filter rule which resulted
> > into the rule below:
> >
> > require ["fileinto"];
> > if allof (address :contains "from" "odhiambo") {
> >  fileinto "INBOX/Odhiambo";
> > }
> >
> > However, the test mail I sent did not end up the folder expected.
> >
> > lda.log contains this info:
> > Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
> > Info: sieve:
> > msgid= o8unvr152x...@mail.gmail.com
> > >: stored mail into mailbox
> 'INBOX'
> > Oct 30 07:39:07 lda(wash@mydomain)<2415266>:
> > Info: sieve: Execution of script
> > /var/spool/virtual/mydomain/wash/.dovecot.sieve failed, but implicit
> > keep was successful (user logfile
> > /var/spool/virtual/mydomain/wash/.dovecot.sieve.log may reveal
> > additional details)
> >
> > And the .dovecot.sieve.log contains:
> > sieve: info: started log at Oct 30 07:39:07.
> > error:
> > msgid= o8unvr152x...@mail.gmail.com
> > >: failed to store into mailbox
> > 'INBOX/Odhiambo': *Invalid mailbox name: Name must not have '/'
> > characters.*
> > *
> > *
> > What might be the problem here??
> >
> >
> > dovecot -n output is below:
> >
> > # 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
> > # Pigeonhole version 0.5.7.2 ()
> > # OS: Linux 5.4.0-29-generic x86_64 Ubuntu 20.04.1 LTS ext4
> > # Hostname: jp.mydomain
> > auth_mechanisms = plain login
> > auth_socket_path = /var/run/dovecot/auth-userdb
> > debug_log_path = /var/log/dovecot/debug.log
> > default_login_user = dovecot
> > default_vsz_limit = 2 G
> > disable_plaintext_auth = no
> > first_valid_uid = 110
> > hostname = gw.mydomain
> > info_log_path = /var/log/dovecot/info.log
> > log_path = /var/log/dovecot/error.log
> > mail_gid = Debian-exim
> > mail_location =
> maildir:/var/spool/virtual/%d/%n/Maildir:INDEX=/var/spool/virtual/indexes/%d/%1n/%n
> > mail_plugins = fts
> > mail_privileged_group = mail
> > mail_server_admin = postmaster@mydomain
> > mail_uid = Debian-exim
> > managesieve_notify_capability = mailto
> > managesieve_sieve_capability = fileinto reject envelope
> encoded-character vacation subaddress comparator-i;ascii-numeric relational
> regex imap4flags copy include variables body enotify environment mailbox
> date index ihave duplicate mime foreverypart extracttext imapsieve
> vnd.dovecot.imapsieve
> > namespace inbox {
> >inbox = yes
> >location =
> >mailbox Drafts {
> >  special_use = \Drafts
> >}
> >mailbox Junk {
> >  special_use = \Junk
> >}
> >mailbox Sent {
> >  special_use = \Sent
> >}
> >mailbox "Sent Messages" {
> >  special_use = \Sent
> >}
> >mailbox Trash {
> >  special_use = \Trash
> >}
> >prefix =
> > }
> > passdb {
> >args = /etc/dovecot/dovecot-sql.conf.ext
> >driver = sql
> > }
> > plugin {
> >fts_autoindex = yes
> >fts_autoindex_exclude = \Junk
> >fts_autoindex_exclude2 = \Trash
> >fts_autoindex_exclude3 = \Drafts
> >fts_autoindex_exclude4 = \Spam
> >fts_enforced = yes
> >imapsieve_mailbox1_before =
> file:/usr/lib/dovecot/sieve/report-spam.sieve
> >imapsieve_mailbox1_causes = COPY
> >imapsieve_mailbox1_name = Spam
> >imapsieve_mailbox2_before =
> file:/usr/lib/dovecot/sieve/report-ham.sieve
> >imapsieve_mailbox2_causes = COPY
> >imapsieve_mailbox2_from = Spam
> >imapsieve_mailbox2_name = *
> >plugin = fts managesieve sieve
> >sieve = file:~/sieve;active=~/.dovecot.sieve
> >sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute
> >sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
> >sieve_global_extensions = +vnd.dovecot.pipe
> +vnd.dovecot.environment
> >sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
> >sieve_plu

Sieve matching the raw body

2020-10-30 Thread @lbutlr
I have tried the following to match the string '' in the body of an 
email:

  if body :raw :contains "" {
  if body :content "text/html" :contains "" {
  if body :contains "" {

All three result in

  matching value `'
with key `' => 0
  finishing match with result: not matched

RFC 5173 says:

5.1.  Body Transform ":raw"

   The ":raw" transform matches against the entire undecoded body of a
   message as a single item.

Which seems like exactly what I want.

:content does not seem like what I want since it appears to only match the non 
HTML code content of the mime part.

Eventually what I want to do is to alert some of the code in the HTML portion 
the email. Failing that, to remove the HTML mime part entirely, but that is 
less desirable.

NB: I am not getting sieve.log errors the code seems to parse fine, it's just 
not matching how I expect.

-- 
I'm the High King of Fillory. I took a blood test.



Re: Sieve matching the raw body

2020-10-30 Thread @lbutlr
On 30 Oct 2020, at 07:27, @lbutlr  wrote:
> I have tried the following to match the string '' in the body of an 
> email:
> 
>  if body :raw :contains "" {
>  if body :content "text/html" :contains "" {
>  if body :contains "" {

Never mind, I was sending the wrong test mail through.

-- 
If the laws of action and reaction had anything to do with it, it
should have flopped to the ground a few feet away. But no-one was
listening to them.



Sieve filter script EXECUTION FAILED

2020-10-30 Thread @lbutlr
So, I have the sieve working up to the point that it calls the script, and the 
script is called (I get different errors if the script is not there, for 
example).

filter action
  execute program `darkmode.sh'
  [[EXECUTION ABORTED]]

There's no other error logged (for example, when I had sieve_filter_bin_dir 
miss-set, I would get: 

sieve: action filter: failed to execute program `darkmode.sh': 
vnd.dovecot.filter extension is unconfigured

In /var/log/messages, but I fixed that.

I assume there is something wrong with what I am doing in the script, bit that 
is something I am not finding any examples on that are proving useful.

The script file is simply:

Darkmode.sh:
#!/bin/sh
echo $1 | sed -e '||* {color:white !important; background-color: 
black !important; } |'

Which is somehwat similar to a working script for reporting spam:

sa-learn-spam.sh:
#!/bin/sh
exec /usr/local/bin/sa-learn -u ${1} --spam


-- 
"Are you pondering what I'm pondering?"
"I think so, Brain, but won't it go straight to my hips?!"



how to enable automatic sharing of folders added/created in an already shared folder hiearchy?

2020-10-30 Thread PGNet Dev

I'm running

dovecot --version
2.3.11.3 (502c39af9)

folder sharing is enabled & working.

as long as I manually enable enable sharing for each folder/subfolder.

e.g., if I enable sharing for each of:

sharedtopfolder
subfolder1
subfolder2

then all's good -- shared-to users can access according to set permissions.


BUT, if I drag any folder under that shared-hierarchy

e.g.,

sharedtopfolder
subfolder1
subfolder2
+   subfolder3
+   subfolder4

the just-added

subfolder3
subfolder4

are NOT shared.

They CAN be -- manually. And, as soon as they are, they're, again, usable by 
target users.

I'd like to have any/all newly-created, or dragged-in, folders under the already-shared 
"sharedtopfolder" to
be **automatically** enabled for sharing.

how is that explicitly setup?

is it 'just' Dovecot config?
&/or does it require some Sieve?


Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread Bernd Petrovitsch
On 30/10/2020 17:11, @lbutlr wrote:
[...]
> echo $1 | sed -e '||* {color:white !important; 
> background-color: black !important; } |'

What should the sed stuff do?
TTBOMK '|' is not known by sed ...

MfG,
Bernd
-- 
There is no cloud, just other people computers.
-- https://static.fsf.org/nosvn/stickers/thereisnocloud.svg


pEpkey.asc
Description: application/pgp-keys


Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread PGNet Dev

On 10/30/20 10:11 AM, @lbutlr wrote:


So, I have the sieve working up to the point that it calls the script, and the 
script is called (I get different errors if the script is not there, for 
example).







filter action



   execute program `darkmode.sh'



   [[EXECUTION ABORTED]]







There's no other error logged (for example, when I had sieve_filter_bin_dir 
miss-set, I would get:







sieve: action filter: failed to execute program `darkmode.sh': 
vnd.dovecot.filter extension is unconfigured







In /var/log/messages, but I fixed that.







I assume there is something wrong with what I am doing in the script, bit that 
is something I am not finding any examples on that are proving useful.







The script file is simply:







Darkmode.sh:



#!/bin/sh



echo $1 | sed -e '||* {color:white !important; background-color: black 
!important; } |'







Which is somehwat similar to a working script for reporting spam:







sa-learn-spam.sh:



#!/bin/sh



exec /usr/local/bin/sa-learn -u ${1} --spam


wrong, or different, I can't say.  if helpful, for my script executions, I 
successfully do



require ["vnd.dovecot.pipe", "vnd.dovecot.filter", "vnd.dovecot.execute", "copy", "environment", 
"variables", "vnd.dovecot.debug", "vnd.dovecot.imapsieve", "imapsieve"];

execute :pipe "msmtp_sender.sh" ["", "", ""];





note the " :pipe" usage.  similar to examples here,



  https://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms







Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread Aki Tuomi


> On 30/10/2020 19:25 Bernd Petrovitsch  wrote:
> 
>  
> On 30/10/2020 17:11, @lbutlr wrote:
> [...]
> > echo $1 | sed -e '||* {color:white !important; 
> > background-color: black !important; } |'
> 
> What should the sed stuff do?
> TTBOMK '|' is not known by sed ...
> 
> MfG,
>   Bernd

sed accepts | as alternative for / as boundary.

But I think the sed here is missing 's' from start, so this does not actually 
do anything...

Aki


Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread Odhiambo Washington
On Fri, 30 Oct 2020 at 20:12, @lbutlr  wrote:

> So, I have the sieve working up to the point that it calls the script, and
> the script is called (I get different errors if the script is not there,
> for example).
>
> filter action
>   execute program `darkmode.sh'
>   [[EXECUTION ABORTED]]
>
> There's no other error logged (for example, when I had
> sieve_filter_bin_dir miss-set, I would get:
>
> sieve: action filter: failed to execute program `darkmode.sh':
> vnd.dovecot.filter extension is unconfigured
>
> In /var/log/messages, but I fixed that.
>
> I assume there is something wrong with what I am doing in the script, bit
> that is something I am not finding any examples on that are proving useful.
>
> The script file is simply:
>
> Darkmode.sh:
> #!/bin/sh
> echo $1 | sed -e '||* {color:white !important;
> background-color: black !important; } |'
>

 echo $1 | sed -e 's||* {color:white !important;
background-color: black !important; } |g'
??


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)


Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread @lbutlr
On 30 Oct 2020, at 11:26, PGNet Dev  wrote:
> wrong, or different, I can't say.  if helpful, for my script executions, I 
> successfully do
> 
>   require ["vnd.dovecot.pipe", "vnd.dovecot.filter", 
> "vnd.dovecot.execute", "copy", "environment", "variables", 
> "vnd.dovecot.debug", "vnd.dovecot.imapsieve", "imapsieve"];
> 
>   execute :pipe "msmtp_sender.sh" ["", "", ""];
> 
> note the " :pipe" usage.  similar to examples here,

Yes, But I am not trying to pipe the message, I am trying to filter it to 
change the content.

>  https://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms

I've read that, but no real information on the actual script file execution.

-- 
There is something to be said for grace and respect but humour alway
helps - Toby Morris



Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread @lbutlr
On 30 Oct 2020, at 11:25, Bernd Petrovitsch  wrote:
> On 30/10/2020 17:11, @lbutlr wrote:
> [...]
>> echo $1 | sed -e '||* {color:white !important; 
>> background-color: black !important; } |'
> 
> What should the sed stuff do?

Changes  to * {color:white !important; background-color: black 
!important; } 

> TTBOMK '|' is not known by sed ...

Yes, it most certainly is.

(It's the only delimiter I use anymore since it means I never have to deal with 
escaping /)

-- 
Some people are like a slinky: Totally useless, but you can't help
but smile when you push them down the stairs



Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread @lbutlr
On 30 Oct 2020, at 11:57, Aki Tuomi  wrote:
> But I think the sed here is missing 's' from start, so this does not actually 
> do anything...

Copy/paste/edit error. The s is there in the file.

darkmode.sh:
#!/bin/sh
echo $1 | sed -e 's||* {color:white !important; background-color: 
black !important; } |'

I am not sure about the $1. I think filter just pipes the message (or part of 
the message.

I will see what happens without the echo I suppose.

Nope, still the same.

  32:   starting `:contains' match with `i;ascii-casemap' comparator:
  32:   matching value `29-Oct-2020 
"" 

Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread Mark Moseley
On Fri, Oct 30, 2020 at 11:34 AM @lbutlr  wrote:

> On 30 Oct 2020, at 11:57, Aki Tuomi  wrote:
> > But I think the sed here is missing 's' from start, so this does not
> actually do anything...
>
> Copy/paste/edit error. The s is there in the file.
>
> darkmode.sh:
> #!/bin/sh
> echo $1 | sed -e 's||* {color:white !important;
> background-color: black !important; } |'
>
> I am not sure about the $1. I think filter just pipes the message (or part
> of the message.
>
> I will see what happens without the echo I suppose.
>
> Nope, still the same.
>
>   32:   starting `:contains' match with `i;ascii-casemap' comparator:
>   32:   matching value ` lang="en">29-Oct-2020 "" 

Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread mh
On Freitag, 30. Oktober 2020 18:11:46 CET @lbutlr wrote:
> echo $1 | sed -e '||* {color:white !important;
> background-color: black !important; } |'

echo $1 | sed -e 's||.* {color:white !important; background-
color: black !important; } |'

Perhaps?

Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread Aki Tuomi


> On 30/10/2020 20:34 @lbutlr  wrote:
> 
>  
> On 30 Oct 2020, at 11:57, Aki Tuomi  wrote:
> > But I think the sed here is missing 's' from start, so this does not 
> > actually do anything...
> 
> Copy/paste/edit error. The s is there in the file.
> 
> darkmode.sh:
> #!/bin/sh
> echo $1 | sed -e 's||* {color:white !important; 
> background-color: black !important; } |'
> 
> I am not sure about the $1. I think filter just pipes the message (or part of 
> the message.
> 
> I will see what happens without the echo I suppose.
> 
> Nope, still the same.
> 
>   32:   starting `:contains' match with `i;ascii-casemap' comparator:
>   32:   matching value ` lang="en">29-Oct-2020 "" 

Re: Sieve filter script EXECUTION FAILED

2020-10-30 Thread @lbutlr
On 30 Oct 2020, at 12:34, @lbutlr  wrote:
> I am not sure about the $1. I think filter just pipes the message (or part of 
> the message.
> 
> I will see what happens without the echo I suppose.
> 
> Nope, still the same.
> 
>  32:   starting `:contains' match with `i;ascii-casemap' comparator:
>  32:   matching value ` lang="en">29-Oct-2020 "" ?? ...'
>  32: with key `' => 1
>  32:   finishing match with result: matched
>  32: jump if result is false
>  32:   not jumping
>  34: filter action
>  34:   execute program `darkmode.sh'
>  34:   [[EXECUTION ABORTED]]

Here is the relevant part of doveconf -n

plugin {
  imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
  imapsieve_mailbox1_causes = COPY
  imapsieve_mailbox1_name = Junk
  imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_from = Junk
  imapsieve_mailbox2_name = *
  imapsieve_mailbox3_before = file:/usr/lib/dovecot/sieve/mark-read.sieve
  imapsieve_mailbox3_causes = COPY
  imapsieve_mailbox3_name = Archive
  quota_rule2 = .EXPUNGED:ignore
  sieve = file:~/.sieve;active=~/.active_sieve
  sieve_before = file:/usr/lib/dovecot/sieve/bcc.sieve
  sieve_before3 = file:/usr/lib/dovecot/sieve/filespam.sieve
  sieve_default_name = spamassassin
  sieve_duplicate_default_period = 1h
  sieve_duplicate_max_period = 12d
  sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment 
+vnd.dovecot.filter +editheader
  sieve_filter_bin_dir = /usr/lib/dovecot/sieve /usr/local/virtual/
  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
  sieve_plugins = sieve_imapsieve sieve_extprograms
  sieve_trace_dir = ~/.trace
  sieve_trace_level = matching
  sieve_user_log = ~/sieve.log
}

Current shell script is

#!/bin/sh
sed -e 's||