Re: How to use dovecot only as POP3 server / prevent it from creating .imap directories?

2020-06-18 Thread Joseph Tam

On Wed, 17 Jun 2020, Josef 'Jeff' Sipek wrote:


On Tue, Jun 09, 2020 at 12:32:18 +0200, Binarus wrote:
...

./mail/inbox
./mail/.imap
./mail/.imap/dovecot-uidvalidity
./mail/.imap/dovecot.list.index.log
./mail/.imap/dovecot-uidvalidity.5edce848
./mail/.imap/INBOX
./mail/.imap/INBOX/dovecot.index.log
./mail/.imap/INBOX/dovecot.index
./mail/.imap/INBOX/dovecot.index.log.2
./mail/.imap/INBOX/dovecot.index.cache


The .imap directory isn't really about IMAP.  It is sort of a generic
directory that just happens to have "imap" in the name.  The index files you
see are required for various features inside dovecot to work properly.  Many
of them are related to performance rather than a specific protocol.


Spot on.


If you don't want the index files to live inside the users' home
directories, take a look at the INDEX and CONTROL keys in the mail_location
docs:

https://doc.dovecot.org/configuration_manual/mail_location/#format

While that still creates the files, you can move them off to a location that
the users do not see.


Or you can create in-memory indices, but that is a solution to the wrong
problem.

By specifically stating in mail_location that ~user holds mailboxes,
you are telling Dovecot an untruth.  It's better to tell Dovecot user
mailboxes (other than INBOX) don't exist, rather than to push all the
indices under the carpet.

Joseph Tam 


Updating wiki content

2020-06-18 Thread Dan
Greetings, I'd like to contribute to the Dovecot wiki in regards to 
clients that lack the ability to support SNI. However the captcha 
doesn't make sense, I get a question "What do you do to prevent spam?". 
This is a loaded question which I'm uncertain what the answer should be.



Thanks.



replicator: Panic: data stack: Out of memory

2020-06-18 Thread Thomas Tsiakalakis
Hi,

I have set up 2 SLES 15 Hosts with dovecot and replication. Everything seems to 
work fine but every time a message is delivered, I get an out of memory error 
in the logs. The Replication itself seems to work fine though.

I increased default_vsz_limit to 512M but  the only thing that changed was that 
dovecot was trying to allocate 1073741864 bytes instead of 268435496

As I said, I’m running SLES 15 SP1 and Dovecot 2.3.10 (0da0eff44) (both Hosts 
have the same version)

Each Host currently has 8GB of Memory.
# free -h
  totalusedfree  shared  buff/cache   available
Mem:  7.8Gi   278Mi   7.3Gi47Mi   183Mi   7.2Gi
Swap: 4.0Gi  0B   4.0Gi

# journalctl -f
Jun 18 15:55:48 mail1 postfix/pickup[3457]: 18533C009C8: uid=0 from=
Jun 18 15:55:48 mail1 postfix/cleanup[3669]: 18533C009C8: 
message-id=<20200618135548.18533C009C8@mail1>
Jun 18 15:55:48 mail1 postfix/qmgr[3458]: 18533C009C8: from=, 
size=431, nrcpt=1 (queue active)
Jun 18 15:55:48 mail1 dovecot[1833]: lmtp(3673): Connect from local
Jun 18 15:55:48 mail1 dovecot[1833]: replicator: Panic: data stack: Out of 
memory when allocating 268435496 bytes
Jun 18 15:55:48 mail1 dovecot[1833]: replicator: Error: Raw backtrace: 
/usr/lib64/dovecot/libdovecot.so.0(backtrace_append+0x42) [0x7f8346d6d262] -> 
/usr/lib64/dovecot/libdovecot.so.0(backtrace_get+0x1e) [0x7f8346d6d37e] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0xebcee) [0x7f8346d77cee] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0xebd91) [0x7f8346d77d91] -> 
/usr/lib64/dovecot/libdovecot.so.0(i_fatal+0) [0x7f8346cd1f8b] -> 
/usr/lib64/dovecot/libdovecot.so.0(t_pop_last_unsafe+0) [0x7f8346d73660] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0xe7a50) [0x7f8346d73a50] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0x10eb58) [0x7f8346d9ab58] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0xe3ac5) [0x7f8346d6fac5] -> 
/usr/lib64/dovecot/libdovecot.so.0(buffer_write+0xf2) [0x7f8346d6fdb2] -> 
dovecot/replicator(replicator_queue_push+0xde) [0x5648989a5cde] -> 
dovecot/replicator(+0x5464) [0x5648989a5464] -> dovecot/replicator(+0x4a0b) 
[0x5648989a4a0b] -> dovecot/replicator(+0x4c02) [0x5648989a4c02] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x69) [0x7f8346d90c99] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x134) 
[0x7f8346d92574] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x4c) [0x7f8346d90d9c] 
-> /usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7f8346d90fc8] -> 
/usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f8346d01873] -> 
dovecot/replicator(main+0x1a0) [0x5648989a3cb0] -> 
/lib64/libc.so.6(__libc_start_main+0xea) [0x7f83468f534a] -> 
dovecot/replicator(_start+0x2a) [0x5648989a3d5a]
Jun 18 15:55:48 mail1 dovecot[1833]: 
lmtp(t...@example.com)<3673>: Warning: 
replication(t...@example.com): Sync failure:
Jun 18 15:55:48 mail1 dovecot[1833]: 
lmtp(t...@example.com)<3673>: Warning: 
replication(t...@example.com): Remote sent invalid input: -
Jun 18 15:55:48 mail1 dovecot[1833]: 
lmtp(t...@example.com)<3673>: 
msgid=<20200618135548.18533C009C8@mail1>: saved mail to INBOX
Jun 18 15:55:48 mail1 dovecot[1833]: lmtp(3673): Disconnect from local: Client 
has quit the connection (state=READY)
Jun 18 15:55:48 mail1 postfix/lmtp[3672]: 18533C009C8: to=, 
orig_to=, relay=mail1[private/dovecot-lmtp], delay=0.17, 
delays=0.02/0.01/0.02/0.13, dsn=2.0.0, status=sent (250 2.0.0 
 q5sLCGRy615ZDgAATn/NZw Saved)
Jun 18 15:55:48 mail1 postfix/qmgr[3458]: 18533C009C8: removed
Jun 18 15:55:48 mail1 dovecot[1833]: replicator: Fatal: master: 
service(replicator): child 2948 killed with signal 6 (core not dumped - 
https://dovecot.org/bugreport.html#coredumps - set /proc/sys/fs/suid_dumpable 
to 2)

Thomas Tsiakalakis

Team Applikationsbetrieb
GDV Dienstleistungs-GmbH
Tel: +49(40)33449-4318
Fax:
E-Mail: thomas.tsiakala...@gdv-dl.de



GDV Dienstleistungs-GmbH
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Niederlassungen:

Wilhelmstraße 43 / 43 G
10117 Berlin

Frankenstraße 18
20097 Hamburg

Sitz und Registergericht: Hamburg
HRB 145291
USt.-IdNr : DE 205183123

Geschäftsführer:
Dr. Jens Bartenwerfer
Fred di Giuseppe Chiachiarella

Aufsichtsratsvorsitzender: Werner Schmidt

--
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich 
geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese 
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und 
vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte 
Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged 
information. If you are not the intended recipient (or have received this 
e-mail in error) please notify the sender immediately and destroy this e-mail. 
Any unauthorised copyi

Re: Sieve-scripts won't replicate

2020-06-18 Thread Niels Kobschätzki
We installed now from the Dovecot-community repos instead of the 
official Debian 10-repos and it works now.


Best,

Niels

On 18 Jun 2020, at 8:22, Niels Kobschätzki wrote:


Hi,

I am trying to use dovecot replication for a two-way sync. And 
whatever I do, sieve-scripts won’t replicate. Mails replicate near 
instantaneous. When I disable the sieve-script in roundcube, the other 
server will create in the home of the user on the other side a folder 
sieve/tmp but enabling won’t create the roundcube.sieve and the 
symlink .dovecot.sieve -> sieve/roundcube.sieve


The home of a virtual mail user on server1 looks like this:

drwx-- 4 vexim vexim 4096 Jun 18 08:02 .
drwx-- 8 vexim vexim 4096 Jun 18 07:59 ..
lrwxrwxrwx 1 vexim vexim   21 Jun 18 07:59 .dovecot.sieve -> 
sieve/roundcube.sieve

drwx-- 5 vexim vexim 4096 Jun 18 08:14 Maildir
drwx-- 3 vexim vexim 4096 Jun 18 08:02 sieve

A ps auxwww|grep dove looks like this (maybe some user is wrong?):

ps auxwww |grep dove
root   847  0.0  0.0   4200  3044 ?Ss   07:54   0:00 
/usr/sbin/dovecot -F
root   849  0.0  0.0   4060  2544 ?S07:54   0:00 
dovecot-team1/replicator
dovecot850  0.0  0.0   3912  1092 ?S07:54   0:00 
dovecot-team1/anvil
root   851  0.0  0.0   4048  2464 ?S07:54   0:00 
dovecot-team1/log
dovecot852  0.0  0.0   4048  2692 ?S07:54   0:00 
dovecot-team1/stats
root   853  0.0  0.0   6072  4368 ?S07:54   0:00 
dovecot-team1/config
dovecot855  0.0  0.0  17412  6620 ?S07:54   0:00 
dovecot-team1/auth
dovenull   856  0.0  0.0   8200  6344 ?S07:54   0:00 
dovecot-team1/imap-login
vexim  858  0.0  0.0   7092  5300 ?S07:54   0:00 
dovecot-team1/imap
dovecot902  0.0  0.0   3912  1096 ?S07:55   0:00 
dovecot-team1/aggregator
dovenull  1929  0.0  0.0   8200  6256 ?S08:15   0:00 
dovecot-team1/imap-login
vexim 1930  0.0  0.0   6984  5284 ?S08:15   0:00 
dovecot-team1/imap
dovenull  1931  0.0  0.0   8200  6248 ?S08:15   0:00 
dovecot-team1/imap-login
vexim 1932  0.0  0.0   6964  5140 ?S08:15   0:00 
dovecot-team1/imap
root  2210  0.0  0.0   6048   892 pts/0S+   08:21   0:00 grep 
dove


I do not see any errors in the log. Here is the doveconf -n output. 
The partner looks identical except the replication target.


# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.4 ()
# OS: Linux 4.19.0-9-amd64 x86_64 Debian 10.4
# Hostname: team.snafu.de
auth_mechanisms = plain login
auth_verbose = yes
doveadm_password = # hidden, use -P to show it
doveadm_port = 12345
instance_name = team1
mail_location = maildir:~/mail:INBOX=/var/vmail/%d/%u
mail_plugins = " notify replication"
mail_privileged_group = mail
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 spamtest spamtestplus
 virustest editheader servermetadata imapflags notify 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 =
  separator = /
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
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 = *
  mail_replica = tcps:server2.domain.de:12345
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_extensions = +notify +imapflags +editheader +regex +spamtest 
+spamtestplus +virustest +servermetadata

  sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve-pipe
  sieve_plugins = sieve_imapsieve sieve_extprograms
}
protocols = " imap lmtp sieve sieve"
replication_dsync_parameters = -D -d -N -l 30 -U
service aggregator {
  fifo_listener replication-notify-fifo {
mode = 0666
user = vexim
  }
  unix_listener replication-notify {
mode = 0666
user = vexim
  }
}
service auth {
  unix_listener auth-client {
group = vexim
mode = 0660
user = Debian-exim
  }
  unix_listener auth-userdb {
group = vexim
mode = 0666
user = vexim
  }
}
service config {
  unix_listener config {
user = vexim
  }
}
service doveadm {
  inet_listener {
port = 12345
ssl = yes
  }
  user = vexim
}
service managesi