index corruption weirdness

2018-10-09 Thread William Taylor
We have started seeing index corruption ever since we upgraded (we 
believe) our imap servers from SL6 to Centos 7. Mail/Indexes are stored 
on Netapps mounted via NFS. We have 2 lvs servers running surealived in 
dr/wlc, 2 directors and 6 backend imap/pop servers.

Most of the core dumps I've looked at for different users are like 
"Backtrace 2" with some variations on folder path.

This latest crash (Backtrace 1) is different from others I've seen.
It is also leaving 0byte files in the users .Drafts/tmp folder.

# ls -s /var/spool/mail/15/00/user1/.Drafts/tmp | awk '{print $1}'  
  |sort | uniq -c
   9692 0
  1 218600

I believe the number of cores here is different from the number of tmp 
files because this is when we moved the user to our debug server so we
could get the core dumps.
# ls -la /home/u/user1/core.* |wc -l   
  8437

Any help/insight would be greatly appreciated.

Thanks,
  William


OS Info:
CentOS Linux release 7.5.1804 (Core)
3.10.0-862.14.4.el7.x86_64

NFS:
# mount -t nfs |grep mail/15
172.16.255.14:/vol/vol1/mail/15 on /var/spool/mail/15 type nfs 
(rw,nosuid,nodev,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nordirplus,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.16.255.14,mountvers=3,mountport=4046,mountproto=udp,local_lock=none,addr=172.16.255.14)

Dovecot Info:
dovecot -n
# 2.1.17: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.0-862.14.4.el7.x86_64 x86_64 CentOS Linux release 
  7.5.1804 (Core)  auth_failure_delay = 0
auth_master_user_separator = *
auth_username_format = %Ln
auth_verbose = yes
auth_verbose_passwords = sha1
auth_worker_max_count = 64
login_log_format_elements = user=<%u> session=%{session} method=%m 
rip=%r lip=%l mpid=%e %c
login_trusted_networks = 172.16.0/24
mail_debug = yes
mail_fsync = always
mail_log_prefix = "%s(%u): session=%{session} "
mail_plugins = zlib
maildir_very_dirty_syncs = yes
mmap_disable = yes
passdb {
  args = /etc/dovecot/master-users
  driver = passwd-file
  master = yes
}
passdb {
  args = imap
  driver = pam
}
plugin {
  lazy_expunge = DELETED_MESSAGES.
  mail_log_events = delete expunge flag_change
  mail_log_fields = uid box msgid from flags size
  quota = fs:User quota
  stats_refresh = 30 secs
  stats_track_cmds = yes
}
protocols = imap pop3
service anvil {
  client_limit = 1
}
service auth {
  client_limit = 1
  vsz_limit = 1 G
}
service doveadm {
  inet_listener {
port = 1842
  }
  unix_listener doveadm-server {
mode = 0666
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
  process_limit = 7000
  process_min_avail = 32
  vsz_limit = 256 M
}
service imap-postlogin {
  executable = script-login -d /etc/dovecot/bin/foo-imap-postlogin
  user = $default_internal_user
}
service imap {
  executable = imap imap-postlogin
  process_limit = 7000
  vsz_limit = 1492 M
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
  process_limit = 2000
  process_min_avail = 32
  vsz_limit = 256 M
}
service pop3-postlogin {
  executable = script-login -d /etc/dovecot/bin/foo-pop3-postlogin
  user = $default_internal_user
}
service pop3 {
  executable = pop3 pop3-postlogin
  process_limit = 2000
}
shutdown_clients = no
ssl = required
ssl_ca = , 31683224, 
140725444114256, 31908720, 140457858143945, 31683224}}, sa_flags = 
-457466710, sa_restorer = 0x0}
sigs = {__val = {32, 0 }}
#2  0x7fbee4bbdb65 in default_fatal_finish (type=, 
status=status@entry=0) at failures.c:191
backtrace = 0x1e372d0 
"/usr/lib64/dovecot/libdovecot.so.0(+0x46b55) [0x7fbee4bbdb55] -> 
/usr/lib64/dovecot/libdovecot.so.0(+0x46c1e) [0x7fbee4bbdc1e] -> 
/usr/lib64/dovecot/libdovecot.so.0(i_fatal+0) [0x7fbee4b90dda] -> 
/usr"...
#3  0x7fbee4bbdc1e in i_internal_fatal_handler (ctx=0x7ffd321b77a0, 
format=, args=) at failures.c:649
status = 0
#4  0x7fbee4b90dda in i_panic (format=format@entry=0x7fbee4ee0588 
"file %s: line %d (%s): assertion failed: (%s)") at failures.c:263
ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 0x0}
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7ffd321b7890, reg_save_area = 0x7ffd321b77d0}}
#5  0x7fbee4ea96ad in index_mail_parse_body_finish (mail=0x1e69570, 
field=field@entry=MAIL_CACHE_FLAGS) at index-mail.c:769
parser_input = 0x1e6e370
ret = 1
__FUNCTION__ = "index_mail_parse_body_finish"
#6  0x7fbee4eaaa2b in index_mail_cache_parse_deinit 
(_mail=, received_date=, 
success=)
at index-mail.c:1624
mail = 
#7  0x7fbee4e5dce3 in maildir_save_finish_real (_ctx=0x1e68560) at 
maildir-save.c:551
ctx = 0x1e68560
e = 0x1e574d0
output_errno = 
path = 0x1e37218 
"/var/spool/mail/15/00/user1/.Drafts/tmp/1539107164.M157986P9449.debug.imapd.foo.com"
real_size = 
size = 1539107194
#8  

Re: mbox locking

2018-10-09 Thread Aki Tuomi


> On 09 October 2018 at 17:18 Martin Johannes Dauser  
> wrote:
> 
> 
> On Tue, 2018-10-09 at 15:30 +0200, Selmeci Tamás wrote:
> > On Tue, 9 Oct 2018 12:08:00 +0200 Sami Ketola  > > wrote:
> > 
> > > How do you deliver then mails to the server? 
> > > 
> 
> > 
> > OpenSMTPD and Dovecot run on the same machine. OpenSMTPD receives
> > incoming mails and stores them in a mailbox (/var/spool/mail/user).
> > Dovecot then fetches mails from this mailbox file.
> > 
> 
> Regarding locks, OpenSMTPD's config should match methods AND order of
> dovecot's mbox_write_locks. 
> 
> Methods known by dovecot are dotlock, flock, fcntl and lockf. I
> couldn't find out, which methods are used by OpenSMTPD.
> 
> Dovecot's mbox_read_locks should match too, but dotlock isn't used.
> 
> https://wiki.dovecot.org/MailLocation/mbox
> https://wiki.dovecot.org/MboxLocking
> https://wiki.dovecot.org/MailboxFormat/mbox
> 
> Martin

You could use LMTP instead of direct delivery, too.

Aki


Re: mbox locking

2018-10-09 Thread Martin Johannes Dauser
On Tue, 2018-10-09 at 15:30 +0200, Selmeci Tamás wrote:
> On Tue, 9 Oct 2018 12:08:00 +0200 Sami Ketola  > wrote:
> 
> > How do you deliver then mails to the server? 
> > 

> 
> OpenSMTPD and Dovecot run on the same machine. OpenSMTPD receives
> incoming mails and stores them in a mailbox (/var/spool/mail/user).
> Dovecot then fetches mails from this mailbox file.
> 

Regarding locks, OpenSMTPD's config should match methods AND order of
dovecot's mbox_write_locks. 

Methods known by dovecot are dotlock, flock, fcntl and lockf. I
couldn't find out, which methods are used by OpenSMTPD.

Dovecot's mbox_read_locks should match too, but dotlock isn't used.

https://wiki.dovecot.org/MailLocation/mbox
https://wiki.dovecot.org/MboxLocking
https://wiki.dovecot.org/MailboxFormat/mbox

Martin


Re: Problem getting quota-warning script to function.

2018-10-09 Thread Aki Tuomi
Hi!

We have not been able to reproduce this issue yet.

Aki


> On 09 October 2018 at 16:28 Ted  wrote:
> 
> 
> Hello,
> 
> I don't suppose there's been any thoughts or progress on this one?  Is
> there further information I can provide or anything I could try or check
> on the mailserver?
> 
> Thank you
> Ted
> easyDNS Technologies
> 
> On 2018-09-24 12:44 PM, Aki Tuomi wrote:
> > Hi!
> >
> > It can take some time for us to look into these...
> >
> > Aki
> >
> >> On 24 September 2018 at 19:38 Ted  wrote:
> >>
> >>
> >> Hello,
> >>
> >> I haven't received a reply since I sent my last logs in, so I thought
> >> I'd ask again and update the thread.  I had trouble getting the server
> >> to work properly on dovecot 2.3.2 so I rebuilt the server back on
> >> 2.2.27.  I've got the quota enforcement itself working, but the warnings
> >> still fail to fire.   I've attached logs with mail_debug=yes for the
> >> period from the send which put the quota at 90% all the way until it is
> >> blocking email for being overquota.
> >>
> >> Thank you
> >> Ted
> >> easyDNS Technologies
> >>
> >> On 2018-09-19 12:55 PM, Aki Tuomi wrote:
>  On 19 September 2018 at 19:49 Ted  wrote:
> 
> 
>  Hello,
> 
>  Most of the work was done with dovecot 2.2.27 but I just upgraded to
>  2.3.2 and didn't see any change.  Some debug logs are below, is there
>  something specific I could search them for?
> 
> >>> Can you maybe try delivery to an account which should trigger quota 
> >>> warning or overquota action with mail_debug=yes?
> >>>
> >>> Aki
> 
>


Re: immediate delete of mails

2018-10-09 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 9 Oct 2018, Selmeci Tamás wrote:


On Tue, 9 Oct 2018 12:08:00 +0200 Sami Ketola 
wrote:


How do you deliver then mails to the server?

also mbox is very unoptimised mailbox format for this. Each time mail is 
deleted from mbox mailbox the whole mbox while needs to be rewritten to remove 
the mail.


OpenSMTPD and Dovecot run on the same machine. OpenSMTPD receives
incoming mails and stores them in a mailbox (/var/spool/mail/user).
Dovecot then fetches mails from this mailbox file.

Mailbox file is indeed very unoptimal, but at this moment I'm more
curious about the reason why I can't expunge mails... perhaps it'd
simpler with maildir, where it just means a simple file deletion.


try out pure IMAP via telnet:

https://wiki2.dovecot.org/TestInstallation?highlight=(telnet)#Check_out_some_other_IMAP_commands

telnet server 143
1 login user pwd
2 select inbox
4 CREATE Trash
5 COPY 1 Trash
3 STORE 1 +FLAGS \Deleted
4 EXPUNGE

Try with another mailbox,

7 select Trash
3 STORE 1 +FLAGS \Deleted
4 EXPUNGE

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBW7ywrsQnQQNheMxiAQJKNgf/SqbCxUHv7Ga6COtUVeFxv51e5YGBJzrE
IDjD1bG/DAweaYDkWG+sJvwihpcYU7LRIX7nGGx7LiCOuFatWoQ2r/yIh1FSnMny
SBjRdaDP/V+JaM3t+wAQ8AS8ObLi3RSy5GXrSbQvxrXzillVC6lKl37jQ4vbxevm
MEazFDFubV9OSVs1n8oAUdKTvQVFL19xc2PYn8jkxXZMtED8a9Z7EAlwXFIbCQ/M
WMkRE2G2WFy5sxchEgxDdrXwHnr7fe6mIEm1fyp+1ed6NytDNEwXDCryh0PmR5p5
XT95amjqRlCc3YVB+Q3R8W5AcrG9/bWfaPTglA3o3MBR8iH7xkbQPg==
=znSD
-END PGP SIGNATURE-

Re: Problem getting quota-warning script to function.

2018-10-09 Thread Ted
Hello,

I don't suppose there's been any thoughts or progress on this one?  Is
there further information I can provide or anything I could try or check
on the mailserver?

Thank you
Ted
easyDNS Technologies

On 2018-09-24 12:44 PM, Aki Tuomi wrote:
> Hi!
>
> It can take some time for us to look into these...
>
> Aki
>
>> On 24 September 2018 at 19:38 Ted  wrote:
>>
>>
>> Hello,
>>
>> I haven't received a reply since I sent my last logs in, so I thought
>> I'd ask again and update the thread.  I had trouble getting the server
>> to work properly on dovecot 2.3.2 so I rebuilt the server back on
>> 2.2.27.  I've got the quota enforcement itself working, but the warnings
>> still fail to fire.   I've attached logs with mail_debug=yes for the
>> period from the send which put the quota at 90% all the way until it is
>> blocking email for being overquota.
>>
>> Thank you
>> Ted
>> easyDNS Technologies
>>
>> On 2018-09-19 12:55 PM, Aki Tuomi wrote:
 On 19 September 2018 at 19:49 Ted  wrote:


 Hello,

 Most of the work was done with dovecot 2.2.27 but I just upgraded to
 2.3.2 and didn't see any change.  Some debug logs are below, is there
 something specific I could search them for?

>>> Can you maybe try delivery to an account which should trigger quota warning 
>>> or overquota action with mail_debug=yes?
>>>
>>> Aki




Re: immediate delete of mails

2018-10-09 Thread Selmeci Tamás
On Tue, 9 Oct 2018 12:08:00 +0200 Sami Ketola 
wrote:

> How do you deliver then mails to the server? 
> 
> also mbox is very unoptimised mailbox format for this. Each time mail is 
> deleted from mbox mailbox the whole mbox while needs to be rewritten to 
> remove the mail.

OpenSMTPD and Dovecot run on the same machine. OpenSMTPD receives
incoming mails and stores them in a mailbox (/var/spool/mail/user).
Dovecot then fetches mails from this mailbox file.

Mailbox file is indeed very unoptimal, but at this moment I'm more
curious about the reason why I can't expunge mails... perhaps it'd
simpler with maildir, where it just means a simple file deletion.
-- 
Selmeci Tamás
http://www.486.hu/


Re: Submission / Postfix / XCLIENT

2018-10-09 Thread Aki Tuomi



On 09.10.2018 13:22, Anton Dollmaier wrote:
> Hi all,
>
>
> while testing the new Dovecot Submission Proxy feature, which we
> greatly appreciate and have been anticipating for a long time, some
> issues occured.
>
>
> Dovecot is unable to submit mails via XCLIENT:
>
> < XCLIENT ADDR=185.115.176.12PORT=39074
> > 501 5.5.4 Bad ADDR syntax: 185.115.176.12PORT=39074
>
> Postfix is unable to parse the XCLIENT command from Dovecot submission
> proxy, as a space seems to be missing.
>
> After checking the source code, the issue looks easy to fix - at least
> to me as a non-Developer.
>
> I created my first pull request for that:
>
>> https://github.com/dovecot/core/pull/90
>
> Would be great to see this merged.
>
> Any additional comments are also appreciated.
>
>
> Best,
> Anton

Hi!

Thank you for your merge request, we'll look into it.

Aki


Submission / Postfix / XCLIENT

2018-10-09 Thread Anton Dollmaier

Hi all,


while testing the new Dovecot Submission Proxy feature, which we greatly 
appreciate and have been anticipating for a long time, some issues occured.



Dovecot is unable to submit mails via XCLIENT:

< XCLIENT ADDR=185.115.176.12PORT=39074
> 501 5.5.4 Bad ADDR syntax: 185.115.176.12PORT=39074

Postfix is unable to parse the XCLIENT command from Dovecot submission 
proxy, as a space seems to be missing.


After checking the source code, the issue looks easy to fix - at least 
to me as a non-Developer.


I created my first pull request for that:


https://github.com/dovecot/core/pull/90


Would be great to see this merged.

Any additional comments are also appreciated.


Best,
Anton


Re: immediate delete of mails

2018-10-09 Thread Sami Ketola



> On 9 Oct 2018, at 11.19, Tamas Selmeci  wrote:
> 
> When I press DEL on a mail, the file /home/tselmeci/mail/Trash increases and 
> the deleted mail is appended to it. But it doesn't disappear from 
> /var/spool/mail/tselmeci. Once I expunge, /home/tselmeci/mail/Trash becomes 
> empty but the original mail is still present in /var/spool/mail/tselmeci.
> 
> Maybe the SMTP server holds a write lock on the spool file thus preventing 
> Dovecot from erasing the mail?

How do you deliver then mails to the server? 

also mbox is very unoptimised mailbox format for this. Each time mail is 
deleted from mbox mailbox the whole mbox while needs to be rewritten to remove 
the mail.

Sami




Re: immediate delete of mails

2018-10-09 Thread Tamas Selmeci
When I press DEL on a mail, the file /home/tselmeci/mail/Trash increases and 
the deleted mail is appended to it. But it doesn't disappear from 
/var/spool/mail/tselmeci. Once I expunge, /home/tselmeci/mail/Trash becomes 
empty but the original mail is still present in /var/spool/mail/tselmeci.

Maybe the SMTP server holds a write lock on the spool file thus preventing 
Dovecot from erasing the mail?
-- 
Selmeci Tamás
http://www.486.hu/



Re: cronjob hack to expunge deleted mails of USERNAME

2018-10-09 Thread Martin Johannes Dauser
Well, some dirty cronjob could periodically expunge all emails marked
as DELETED from a specific user. You would need to exchange USERNAME
with the real username in this little bash script. This should work,
use at your own risk. (^.~)

#!/bin/bash
doveadm mailbox list -u USERNAME | while read -r i 
do
doveadm expunge -u USERNAME mailbox $i DELETED
done


Finding the real issue would be best of course.

Martin 


Re: immediate delete of mails

2018-10-09 Thread Tamas Selmeci
On Tue, 9 Oct 2018 11:43:30 +0300
Aki Tuomi  wrote:
> Can you enable mail_log plugin as well?

Sure.

I've sent myself a mail from another account, opened it, deleted and then tried 
to expunge. Here's the log output:

Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: INBOX: Mailbox 
opened because: SELECT
Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25196 because: virtual size (Mail not cached, highest cached 
seq=2034 uid=25195: reset_id=1539075017)
Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25196 because: header stream
Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25196 because: full mail
Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: INBOX: Mailbox 
opened because: SELECT
Oct 09 10:53:42 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25196 because: header stream
Oct 09 10:53:55 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25196 because: full mail
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Trash: Mailbox 
opened because: UID COPY
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25117 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25130 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25131 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25132 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25133 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25135 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25136 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25137 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25138 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25139 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25140 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25141 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25142 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25143 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25144 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25145 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25146 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25148 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25149 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25150 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25151 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25152 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25153 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25154 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25155 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25156 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25157 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25158 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25159 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25161 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25163 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25164 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25165 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25167 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25168 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25169 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25170 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25171 because: copying
Oct 09 10:54:00 imap(tselmeci)<18236>: Debug: Mailbox INBOX: 
Opened mail UID=25172 

Re: immediate delete of mails

2018-10-09 Thread Aki Tuomi



On 09.10.2018 11:41, tselm...@486.hu wrote:
> On Tue, 9 Oct 2018 11:09:53 +0300
> Reio Remma  wrote:
>
>> Do you see anything in Dovecot logs? It should definitely log if there 
>> were permission issues.
> With 'mail_debug=yes' I see nothing relevant. Just something like this when I 
> want to expunge deleted mails:
>
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25188 because: header stream
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25189 because: header stream
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25190 because: header stream
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25191 because: header stream
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25192 because: header stream
> Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25147 because: full mail
> Oct 09 10:40:04 imap(tselmeci)<15816>: Debug: Mailbox 
> INBOX: Opened mail UID=25192 because: full mail
> Oct 09 10:40:18 imap(tselmeci)<15816>: Debug: dovecot: 
> Mailbox opened because: SELECT

Can you enable mail_log plugin as well?

Aki


Re: immediate delete of mails

2018-10-09 Thread tselm...@486.hu
On Tue, 9 Oct 2018 11:09:53 +0300
Reio Remma  wrote:

> Do you see anything in Dovecot logs? It should definitely log if there 
> were permission issues.

With 'mail_debug=yes' I see nothing relevant. Just something like this when I 
want to expunge deleted mails:

Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25188 because: header stream
Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25189 because: header stream
Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25190 because: header stream
Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25191 because: header stream
Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25192 because: header stream
Oct 09 10:40:01 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25147 because: full mail
Oct 09 10:40:04 imap(tselmeci)<15816>: Debug: Mailbox INBOX: 
Opened mail UID=25192 because: full mail
Oct 09 10:40:18 imap(tselmeci)<15816>: Debug: dovecot: 
Mailbox opened because: SELECT
-- 
Selmeci Tamás
http://www.486.hu/



Re: immediate delete of mails

2018-10-09 Thread Reio Remma

On 09/10/2018 10:54, tselm...@486.hu wrote:
I don't think it's relevant, since with the very same Sylpheed an 
older Dovecot (1.x) could erase the unneeded mails. Perhaps some file 
permission issue on my server...?


Do you see anything in Dovecot logs? It should definitely log if there 
were permission issues.


Good luck,
Reio



Re: immediate delete of mails

2018-10-09 Thread tselm...@486.hu
On Tue, 9 Oct 2018 09:31:36 +0200
Gerald Galster  wrote:

> most imap clients don't delete mails immediately, instead they are marked as 
> deleted and expunged a few days or weeks later.
> 
> From Sylpheed docs / Interface tab: 
> https://sylpheed.sraoss.jp/doc/manual/en/sylpheed-8.html
> 
>   • If Execute immediately when moving or deleting messages is not 
> selected, a new button appears in the button bar marked Execute. When 
> deleting or moving messages, they are first marked as deleted or moved but 
> Sylpheed does not move or delete them until you press the Execute button (or 
> the Execute entry of the Tools menu).

This setting is enabled in my Slypheed and mails don't disappear. Even if I 
switch this off and try to manually execute the expunge operation, the mails 
still remain.

> You could check if the filename of a deleted email has changed in your 
> maildir.

Perhaps I wasn't clear enough, Dovecot is using mbox files on my machine.

> This is old and may have been fixed:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208139

I don't think it's relevant, since with the very same Sylpheed an older Dovecot 
(1.x) could erase the unneeded mails. Perhaps some file permission issue on my 
server...?

Regards,
-- 
Selmeci Tamás
http://www.486.hu/



immediate delete of mails

2018-10-09 Thread tselm...@486.hu
Hello all!

I've got a home server running on an ARM Cortex-A7 with my custom Linux 
distribution. It's also responsible for handling incoming and outgoing mails. 
The SMTP server is OpenSMTPD-6.0.3p1. I'm using Dovecot-2.3.2.1 to export the 
mails (mailbox storage format) using IMAP.

My old server used to have Dovecot-1.2.0 and honestly, it was absolutely 
sufficient for me. However, I've decided to use the latest Dovecot on my new 
system, since all other software components of my system are up-to-date.

With my simple IMAP-configuration Dovecot is running fine, expect for one 
thing: when I press DEL in the mailer client, the mails don't get deleted. They 
simple reside in the mailbox file. It annoys me a lot, since the mailer client 
regularly makes them appear with a different (grey) color.

The mailer client is Sylpheed and I'm not willing to use another one. I've 
already tried Thunderbird, Evolution, Claws-mail, Sylpheed, and Sylpheed suits 
best to my needs.

The funny thing is that with the same Sylpheed the old Dovecot was willing to 
physically remove the mails from mailbox file, but the new Dovecot isn't 
willing to do so.

I've tried to search for an appropriate configuration option, but didn't find 
what I exactly need. Auto expunge, command-line expunging are nice, but I do 
want immediate mail delete from mailbox file when I press DEL in the mailer 
client. I know this can be dangerous and degrades performance.

Is there any option to configure Dovecot to behave like this? If it needs to 
recompile Dovecot I'm also in ;)

Thanks a lot!

---
dovecot -n output:

# 2.3.2.1 (0719df592): /etc/dovecot.conf
# OS: Linux 4.18.9 armv7l  
# Hostname: 486
auth_mechanisms = plain login
base_dir = /var/run/dovecot/
default_client_limit = 30
default_process_limit = 10
disable_plaintext_auth = no
listen = *
log_path = /var/log/dovecot.txt
mail_gid = 0
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
mail_uid = 0
namespace {
  hidden = no
  inbox = yes
  list = yes
  location = 
  mailbox {
auto = create
special_use = \Drafts
name = Drafts
  }
  mailbox {
auto = create
special_use = \Sent
name = Sent
  }
  mailbox {
auto = create
special_use = \Trash
name = Trash
  }
  prefix = 
  type = private
  name = inbox
}
passdb {
  driver = passwd
}
passdb {
  driver = shadow
}
protocols = imap
service replication-notify-fifo {
  name = aggregator
}
service anvil-auth-penalty {
  name = anvil
}
service auth-worker {
  name = auth-worker
}
service auth-client {
  name = auth
}
service config {
  name = config
}
service dict-async {
  name = dict-async
}
service dict {
  name = dict
}
service login/proxy-notify {
  name = director
}
service dns-client {
  name = dns_client
}
service doveadm-server {
  name = doveadm
}
service imap-hibernate {
  name = imap-hibernate
}
service imap {
  name = imap-login
}
service imap-urlauth {
  name = imap-urlauth-login
}
service imap-urlauth-worker {
  name = imap-urlauth-worker
}
service token-login/imap-urlauth {
  name = imap-urlauth
}
service imap-master {
  name = imap
}
service indexer-worker {
  name = indexer-worker
}
service indexer {
  name = indexer
}
service ipc {
  name = ipc
}
service lmtp {
  name = lmtp
}
service log-errors {
  name = log
}
service old-stats-mail {
  name = old-stats
}
service pop3 {
  name = pop3-login
}
service login/pop3 {
  name = pop3
}
service replicator-doveadm {
  name = replicator
}
service stats-reader {
  name = stats
}
service submission {
  name = submission-login
}
service login/submission {
  name = submission
}
ssl = no
submission_max_mail_size = 0
userdb {
  driver = passwd
}
verbose_proctitle = yes

-- 
Selmeci, Tamás
http://www.486.hu/