Re: immediate delete of mails
On 10.10.2018 09:34, Tamas Selmeci wrote: > On Tue, 9 Oct 2018 15:44:14 +0200 (CEST) > Steffen Kaiser wrote: > >> try out pure IMAP via telnet: >> >> telnet server 143 >> 1 login user pwd >> 2 select inbox >> 4 CREATE Trash >> 5 COPY 1 Trash >> 3 STORE 1 +FLAGS \Deleted >> 4 EXPUNGE > Here's the output: > > * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ > AUTH=PLAIN AUTH=LOGIN] Dovecot ready. > 1 login > 1 BAD Error in IMAP command received by server. > 1 login user pass > 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT > SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND > URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED > I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH > LIST-STATUS BINARY MOVE SNIPPET=FUZZY LITERAL+ NOTIFY SPECIAL-USE] Logged in > 2 select inbox > * FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent $Forwarded $label1 > $Labelimportant receipt-handled NonJunk $label5 $label2 $label3 $label4 > $has_cal) > * OK [PERMANENTFLAGS ()] Read-only mailbox. > * 1995 EXISTS > * 0 RECENT > * OK [UNSEEN 1971] First unseen. > * OK [UIDVALIDITY 1250421210] UIDs valid > * OK [UIDNEXT 25219] Predicted next UID > 2 OK [READ-ONLY] Select completed (0.016 + 0.000 + 0.017 secs). > 4 create Trash > 4 NO [ALREADYEXISTS] Mailbox already exists (0.006 + 0.000 + 0.006 secs). > 5 Copy 1 Trash > 5 OK [COPYUID 1 4067 17246] Copy completed (0.020 + 0.000 + 0.019 secs). > 3 STORE 1 +FLAGS \Deleted > * 1 FETCH (FLAGS (\Deleted \Seen)) > 3 OK Store completed (0.003 + 0.000 + 0.002 secs). > 4 expunge > 4 OK Expunge completed (0.001 + 0.000 secs). > -- > The answer to "2 select inbox" contains "Read-only mailbox", it's suspicious > to me... doveadm user check the UID/GID value (or look mail_uid / mail_gid from config) namei -vl /path/to/your/mbox/file and check permissions are correct Aki
Re: immediate delete of mails
On Tue, 9 Oct 2018 15:44:14 +0200 (CEST) Steffen Kaiser wrote: > try out pure IMAP via telnet: > > telnet server 143 > 1 login user pwd > 2 select inbox > 4 CREATE Trash > 5 COPY 1 Trash > 3 STORE 1 +FLAGS \Deleted > 4 EXPUNGE Here's the output: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready. 1 login 1 BAD Error in IMAP command received by server. 1 login user pass 1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY LITERAL+ NOTIFY SPECIAL-USE] Logged in 2 select inbox * FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent $Forwarded $label1 $Labelimportant receipt-handled NonJunk $label5 $label2 $label3 $label4 $has_cal) * OK [PERMANENTFLAGS ()] Read-only mailbox. * 1995 EXISTS * 0 RECENT * OK [UNSEEN 1971] First unseen. * OK [UIDVALIDITY 1250421210] UIDs valid * OK [UIDNEXT 25219] Predicted next UID 2 OK [READ-ONLY] Select completed (0.016 + 0.000 + 0.017 secs). 4 create Trash 4 NO [ALREADYEXISTS] Mailbox already exists (0.006 + 0.000 + 0.006 secs). 5 Copy 1 Trash 5 OK [COPYUID 1 4067 17246] Copy completed (0.020 + 0.000 + 0.019 secs). 3 STORE 1 +FLAGS \Deleted * 1 FETCH (FLAGS (\Deleted \Seen)) 3 OK Store completed (0.003 + 0.000 + 0.002 secs). 4 expunge 4 OK Expunge completed (0.001 + 0.000 secs). -- The answer to "2 select inbox" contains "Read-only mailbox", it's suspicious to me... -- Selmeci Tamás http://www.486.hu/
Re: immediate delete of mails
-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: immediate delete of mails
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: immediate delete of mails
> 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
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: immediate delete of mails
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
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
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
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
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
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/