Sieve scripting

2019-05-13 Thread Lefteris Tsintjelis via dovecot
I want to monitor a special folder and execute a shell script each time 
I put an email to it. I would like to automate that way the process of 
SPAM reporting (SPAMCop). Is that possible with sieve?


Lefteris


Re: Potfix+Dovecot with dsync replication problem

2019-05-13 Thread Zeljko Dokman via dovecot
Hi all,

Any suggestion?

BR

On Mon, 6 May 2019 at 14:22, Zeljko Dokman  wrote:

> Hi all,
>
> I am in need of some help.
>
> Straggling to make something work, trying to configure postfix and
> dovecote imap server with dovecote replication.
>
> Can’t figure out what is wrong with my configuration.
>
>
>
> Replication is working only for vmail user account, I am getting this
> error on my secondary server  for all other users…
>
>
>
> dovecot: doveadm: Fatal: setgid(4015(zdokman) from userdb lookup) failed
> with euid=5000(vmail), gid=5000(vmail), egid=5000(vmail): Operation not
> permitted (This binary should probably be called with process group set to
> 4015(zdokman) instead of 5000(vmail))
>
>
>
> primary server reports this error:
>
>
>
> dovecot: doveadm(zdokman): Error: doveadm server disconnected before
> handshake: EOF
>
> dovecot: doveadm(zdokman): Error: sync: Disconnected from remote: EOF
>
>
>
>
>
> doveadm replicator status '*'
>
> username
>  priority fast sync full sync success sync failed
>
> vmail
> none 01:58:13  02:05:25  01:58:13 -
>
> zdokman
>  none 00:00:25  02:55:26  -y
>
> test
>   none 00:01:00  21:48:13  -y
>
>
>
> doveadm sync *
>
> doveadm(root): Fatal: execvp(Maildir) failed: Permission denied
>
> dsync-local(root): Error: read(remote) failed: EOF (version not received)
>
>
>
> I am attaching my dovecot.conf main.cf and master.cf.
>
>
>
> I think my problem is with permissions  but I can figure out how to
> workaround it.
>
>
>
> Best regards
>


--


Re: Sieve scripting

2019-05-13 Thread Aki Tuomi via dovecot


On 13.5.2019 11.14, Lefteris Tsintjelis via dovecot wrote:
> I want to monitor a special folder and execute a shell script each
> time I put an email to it. I would like to automate that way the
> process of SPAM reporting (SPAMCop). Is that possible with sieve?
>
> Lefteris

Yes, see

https://wiki2.dovecot.org/HowTo/AntispamWithSieve

Aki



Re: Potfix+Dovecot with dsync replication problem

2019-05-13 Thread Aki Tuomi via dovecot
Your problem is that you are running service doveadm as vmail, but you
are using real uids. You need to start doveadm server as root to be able
to switch into the correct target user.

Aki


On 13.5.2019 11.26, Zeljko Dokman via dovecot wrote:
> Hi all,
>
> Any suggestion?
>
> BR
>
> On Mon, 6 May 2019 at 14:22, Zeljko Dokman  > wrote:
>
> Hi all,
>
> I am in need of some help.
>
> Straggling to make something work, trying to configure postfix and
> dovecote imap server with dovecote replication.
>
> Can’t figure out what is wrong with my configuration.
>
>  
>
> Replication is working only for vmail user account, I am getting
> this error on my secondary server  for all other users…
>
>  
>
> dovecot: doveadm: Fatal: setgid(4015(zdokman) from userdb lookup)
> failed with euid=5000(vmail), gid=5000(vmail), egid=5000(vmail):
> Operation not permitted (This binary should probably be called
> with process group set to 4015(zdokman) instead of 5000(vmail))
>
>  
>
> primary server reports this error:
>
>  
>
> dovecot: doveadm(zdokman): Error: doveadm server disconnected
> before handshake: EOF
>
> dovecot: doveadm(zdokman): Error: sync: Disconnected from remote: EOF
>
>  
>
>  
>
> doveadm replicator status '*'
>
> username  
>  priority fast sync full sync success sync failed
>
> vmail 
> none 01:58:13  02:05:25  01:58:13 -
>
> zdokman
>  none 00:00:25  02:55:26  -    y
>
> test  
>   none 00:01:00  21:48:13  -    y
>
>  
>
> doveadm sync *
>
> doveadm(root): Fatal: execvp(Maildir) failed: Permission denied
>
> dsync-local(root): Error: read(remote) failed: EOF (version not
> received)
>
>  
>
> I am attaching my dovecot.conf main.cf  and
> master.cf .
>
>  
>
> I think my problem is with permissions  but I can figure out how
> to workaround it.
>
>  
>
> Best regards 
>
>
>
> -- 
>
>   
>   
>
>   


Re: Sieve scripting

2019-05-13 Thread Lefteris Tsintjelis via dovecot

On 13/5/2019 11:45, Aki Tuomi via dovecot wrote:


On 13.5.2019 11.14, Lefteris Tsintjelis via dovecot wrote:

I want to monitor a special folder and execute a shell script each
time I put an email to it. I would like to automate that way the
process of SPAM reporting (SPAMCop). Is that possible with sieve?

Lefteris


Yes, see

https://wiki2.dovecot.org/HowTo/AntispamWithSieve

Aki


Great! Seems exactly what I need. Thank you


dovecot 2.2.36 and wforce

2019-05-13 Thread Tobi via dovecot
Hi list

I'm trying to setup dovecot 2.2.36 on a Centos6 to communicate with a
wforce daemon on the remote side. wforce is latest released from git
repo. Daemon part is working and I can successfully send queries from
remote systems to wforce via curl

For dovecot I configured in /etc/dovecot/conf.d/95-wforce.conf

> auth_policy_server_url = http://REMOTE_IP:8084/
> auth_policy_hash_nonce = my_random
> auth_policy_server_api_header = Authorization: Basic 
> auth_policy_request_attributes = login=%{requested_username}
pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%s

restarted dovecot without errors, but upon testing via imap I cannot see
just one single tcp paket leaving direction REMOTE_IP on port 8084. It
looks like auth policy in not involved at all.

Thanks for any idea

tobi


Doveadm sync, Error: read(remote) failed: EOF, Error: read(remote) failed: EOF

2019-05-13 Thread Marc Roos via dovecot


In the manual page this command is used for converting a mailbox

doveadm sync -u test mdbox:~/mdbox -x INBOX -x INBOX/*

Yet I am getting this error and the mdbox folder is not created.

dsync-local(test): (version not received)
doveadm(test): Fatal: execvp(mdbox:~/mdbox) failed: No such file or 
directory

[@ dovecot]# doveconf  | grep mail_locat
mail_location = 
mbox:~/mail:INBOX=/var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/d
ovecot/%u/index:LAYOUT=maildir++

Users are not having shell access so something like su test -c '' will 
also not work. 

What would be a work-around for this?



Re: dovecot 2.2.36 and wforce

2019-05-13 Thread Aki Tuomi via dovecot


> On 13 May 2019 18:54 Tobi via dovecot  wrote:
> 
>  
> Hi list
> 
> I'm trying to setup dovecot 2.2.36 on a Centos6 to communicate with a
> wforce daemon on the remote side. wforce is latest released from git
> repo. Daemon part is working and I can successfully send queries from
> remote systems to wforce via curl
> 
> For dovecot I configured in /etc/dovecot/conf.d/95-wforce.conf
> 
> > auth_policy_server_url = http://REMOTE_IP:8084/
> > auth_policy_hash_nonce = my_random
> > auth_policy_server_api_header = Authorization: Basic  wforce:my_password>
> > auth_policy_request_attributes = login=%{requested_username}
> pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%s
> 
> restarted dovecot without errors, but upon testing via imap I cannot see
> just one single tcp paket leaving direction REMOTE_IP on port 8084. It
> looks like auth policy in not involved at all.
> 
> Thanks for any idea
> 
> tobi

Could you provide output of 'doveconf -n'? Also, any auth policy interaction 
should be logged with auth_debug=yes.

Aki


Re: dovecot 2.2.36 and wforce

2019-05-13 Thread Tobi via dovecot
> Also, any auth policy interaction should be logged with auth_debug=yes

after I enabled that in 10-logging.conf and it did not show any more
loglines I realized that this is a very old box (loads of karma) which
likes to have all its config in /etc/dovecot/dovecot.conf :-)
So after setting the auth policy settings in dovecot.conf it works like
charm :-)

Cheers

tobi


Am 13.05.19 um 18:12 schrieb Aki Tuomi:
> 
>> On 13 May 2019 18:54 Tobi via dovecot  wrote:
>>
>>  
>> Hi list
>>
>> I'm trying to setup dovecot 2.2.36 on a Centos6 to communicate with a
>> wforce daemon on the remote side. wforce is latest released from git
>> repo. Daemon part is working and I can successfully send queries from
>> remote systems to wforce via curl
>>
>> For dovecot I configured in /etc/dovecot/conf.d/95-wforce.conf
>>
>>> auth_policy_server_url = http://REMOTE_IP:8084/
>>> auth_policy_hash_nonce = my_random
>>> auth_policy_server_api_header = Authorization: Basic > wforce:my_password>
>>> auth_policy_request_attributes = login=%{requested_username}
>> pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%s
>>
>> restarted dovecot without errors, but upon testing via imap I cannot see
>> just one single tcp paket leaving direction REMOTE_IP on port 8084. It
>> looks like auth policy in not involved at all.
>>
>> Thanks for any idea
>>
>> tobi
> 
> Could you provide output of 'doveconf -n'? Also, any auth policy interaction 
> should be logged with auth_debug=yes.
> 
> Aki
> 


Re: Doveadm sync, Error: read(remote) failed: EOF, Error: read(remote) failed: EOF

2019-05-13 Thread Aki Tuomi via dovecot


 
 
  
   Hi, you need to put mdbox parameter as last.
  
  
   
  
  
   Aki
  
  
   
On 13 May 2019 18:55 Marc Roos via dovecot <
dovecot@dovecot.org> wrote:
   
   

   
   

   
   
In the manual page this command is used for converting a mailbox
   
   

   
   
doveadm sync -u test mdbox:~/mdbox -x INBOX -x INBOX/*
   
   

   
   
Yet I am getting this error and the mdbox folder is not created.
   
   

   
   
dsync-local(test): (version not received)
   
   
doveadm(test): Fatal: execvp(mdbox:~/mdbox) failed: No such file or
   
   
directory
   
   

   
   
[@ dovecot]# doveconf | grep mail_locat
   
   
mail_location =
   
   
mbox:~/mail:INBOX=/var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/d
   
   
ovecot/%u/index:LAYOUT=maildir++
   
   

   
   
Users are not having shell access so something like su test -c '' will
   
   
also not work.
   
   

   
   
What would be a work-around for this?
   
  
  
   
  
  
   ---
Aki Tuomi
   
 



RE: Doveadm sync, Error: read(remote) failed: EOF, Error: read(remote) failed: EOF

2019-05-13 Thread Marc Roos via dovecot
 
Indeed, Thanks!!! :)


-Original Message-
From: Aki Tuomi [mailto:aki.tu...@open-xchange.com] 
Sent: maandag 13 mei 2019 19:48
To: Marc Roos; Marc Roos via dovecot
Subject: Re: Doveadm sync, Error: read(remote) failed: EOF, Error: 
read(remote) failed: EOF

Hi, you need to put mdbox parameter as last. 

Aki 

On 13 May 2019 18:55 Marc Roos via dovecot < dovecot@dovecot.org> 
wrote: 


In the manual page this command is used for converting a mailbox 

doveadm sync -u test mdbox:~/mdbox -x INBOX -x INBOX/* 

Yet I am getting this error and the mdbox folder is not created. 

dsync-local(test): (version not received) 
doveadm(test): Fatal: execvp(mdbox:~/mdbox) failed: No such file or 

directory 

[@ dovecot]# doveconf | grep mail_locat 
mail_location = 
mbox:~/mail:INBOX=/var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/
var/d 
ovecot/%u/index:LAYOUT=maildir++ 

Users are not having shell access so something like su test -c '' 
will 
also not work. 

What would be a work-around for this? 


---
Aki Tuomi




LMTP and Sieve with

2019-05-13 Thread Paul Muster via dovecot
Hi there,

Dovecot's LMTP implementation and Pigeonhole Sieve already do support
the  format. RfC 5233, the Sieve subaddress
extension, also offers .

Could Docecot's LMTP and Pigeonhole be extended to that effect?

Thanks & greetings,

Paul


Frequent Out of Memory for service(config)

2019-05-13 Thread Root Kev via dovecot
Hello Group,

We have dovecot deployed as solely a Pop3 service that is used by our
applications to pass mail from one application to another internally.  We
have roughly 4 applications that connect to the Pop3 service every 2
seconds, to check for new messages and pop them for processing if they are
present.  Depending on the site, we have between 1024-2048MB of memory set
for default_vsz_limit.  In all systems we see the Out of memory alert
several times a day. We previously did not see this at all when running on
CentOS6, with less memory.

We have tried increasing the memory to the vsz_limit up to 2gb without
success.

We are running on CentOS 7 servers, running dovecot 2.3.6 (7eab80676) (from
the dovecot repo).

Can anyone advise any other settings that could be modified in order to
correct these out of memory issues?

# dovecot -n
# 2.3.6 (7eab80676): /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-957.5.1.el7.x86_64 x86_64 CentOS Linux release 7.6.1810
(Core)
# Hostname: ** #
auth_cache_size = 10 M
auth_verbose = yes
default_vsz_limit = 1 G
instance_name = Pop3 Mail Service
listen = 10.*.*.* #
log_path = /var/log/dovecot.log
login_greeting = Pop3 Mail Service
login_trusted_networks = 10.*.*.* 10.*.*.* 10.*.*.* 10.*.*.* 10.*.*.*
#
mail_location = maildir:~/Maildir
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 = cache_key=#hidden_use-P_to_show#
  driver = pam
}
protocols = pop3
ssl_cert = 

Userdb userdb_mail=, error Mailbox list driver maildir++: maildir_name not supported by this driver

2019-05-13 Thread Marc Roos via dovecot



I have this default configuration [0], when use the userdb_mail to point 
to the mdbox location, the inbox subfolders show differently in a 
firebird client. So I decided to copy the whole default mail_location 
into the userdb_mail configuration [2]. But then I get errors [3]. 
Should I change the namespace configuration here, how? My default 
namespaces are inbox and 4archives 

[0]
[@ ]# doveconf | grep mail_loc
mail_location = 
mbox:~/mail:INBOX=/var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/d
ovecot/%u/index:LAYOUT=maildir++

[1]
[@dovecot]# cat special-userdb
test:x:8267:231:Account with special settings for 
dovecot:/home/popusers/test:/bin/false:userdb_mail=mdbox:~/mdbox

[2]
[@dovecot]# cat special-userdb
test:x:8267:231:Account with special settings for 
dovecot:/home/popusers/test:/bin/false:userdb_mail=mdbox:~/mdbox:INBOX=/
var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/dovecot/%u/index:LAY
OUT=maildir++

[3]
May 13 22:41:32 mail04 dovecot: imap-login: Login: user=, 
method=PLAIN, rip=192.168.10.219, lip=192.168.10.44, mpid=1138, TLS, 
session=
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Loading modules from 
directory: /usr/lib64/dovecot
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Module loaded: 
/usr/lib64/dovecot/lib15_notify_plugin.so
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Module loaded: 
/usr/lib64/dovecot/lib20_listescape_plugin.so
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Added userdb setting: 
mail=mdbox:~/mdbox:INBOX=/var/spool/mail/test:CONTROL=~/mail/control:IND
EX=/var/dovecot/test/index:LAYOUT=maildir++
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Effective uid=8267, 
gid=231, home=/home/popusers/test
May 13 22:41:32 mail04 dovecot: imap(test): Debug: Namespace inbox: 
type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes 
location=mdbox:~/mdbox:INBOX=/var/spool/mail/test:CONTROL=~/mail/control
:INDEX=/var/dovecot/test/index:LAYOUT=maildir++
May 13 22:41:32 mail04 dovecot: imap(test): Error: Namespace '': Mailbox 
list driver maildir++: maildir_name not supported by this driver
May 13 22:41:32 mail04 dovecot: imap(test): Namespace '': Mailbox list 
driver maildir++: maildir_name not supported by this driver in=0 out=378


Re: Userdb userdb_mail=, error Mailbox list driver maildir++: maildir_name not supported by this driver

2019-05-13 Thread Aki Tuomi via dovecot


> On 14 May 2019 00:05 Marc Roos via dovecot  wrote:
> 
>  
> I have this default configuration [0], when use the userdb_mail to point 
> to the mdbox location, the inbox subfolders show differently in a 
> firebird client. So I decided to copy the whole default mail_location 
> into the userdb_mail configuration [2]. But then I get errors [3]. 
> Should I change the namespace configuration here, how? My default 
> namespaces are inbox and 4archives 
> 
> [0]
> [@ ]# doveconf | grep mail_loc
> mail_location = 
> mbox:~/mail:INBOX=/var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/d
> ovecot/%u/index:LAYOUT=maildir++
> 
> [1]
> [@dovecot]# cat special-userdb
> test:x:8267:231:Account with special settings for 
> dovecot:/home/popusers/test:/bin/false:userdb_mail=mdbox:~/mdbox
> 
> [2]
> [@dovecot]# cat special-userdb
> test:x:8267:231:Account with special settings for 
> dovecot:/home/popusers/test:/bin/false:userdb_mail=mdbox:~/mdbox:INBOX=/
> var/spool/mail/%u:CONTROL=~/mail/control:INDEX=/var/dovecot/%u/index:LAY
> OUT=maildir++
> 

Are you intentionally mixing mbox and mdbox? You see that [0] has mbox, and [2] 
has mdbox.

Aki


Re: Sieve scripting

2019-05-13 Thread Lefteris Tsintjelis via dovecot

On 13/5/2019 11:45, Aki Tuomi via dovecot wrote:


On 13.5.2019 11.14, Lefteris Tsintjelis via dovecot wrote:

I want to monitor a special folder and execute a shell script each
time I put an email to it. I would like to automate that way the
process of SPAM reporting (SPAMCop). Is that possible with sieve?


Yes, see

https://wiki2.dovecot.org/HowTo/AntispamWithSieve


It seems to work great but only within the same server. It I copy 
anything from a different server it simply does not work. Is there a way 
around this?