View Issue Details

IDProjectCategoryView StatusLast Update
0005466SOGoWeb Mailpublic2022-04-25 20:21
Reporterdragoangel Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status newResolutionopen 
Platform[Client] MicrosoftOSWindowsOS Version8
Product Version5.4.0 
Summary0005466: Issue moving to Junk multiply emails
Description

If in SOGo Web Mail you select one email and move it to Junk - it will be move to junk as expected.
But if you choose multiply emails via checkbox and click on "move to junk button" it will not lock ui or add loading icon instantly. Loading icon appear only after some 4-6 seconds just before really move mail to junk. It result that end user trying click on "move to junk button" many times, and each time it will actually create a "copy of email in junk". I think this not intended way to work?

TagsNo tags attached.

Activities

dragoangel

dragoangel

2022-01-18 13:39

reporter   ~0015777

Note: if click too quickly user even allow to a DoS for a minute the sogo or give hight load on imap.

francis

francis

2022-01-19 18:54

administrator   ~0015781

How many messages were selected when you started having issues?

dragoangel

dragoangel

2022-01-19 19:14

reporter   ~0015782

it even can be reproduced on 1 email

francis

francis

2022-01-19 19:42

administrator   ~0015785

Have you defined SOGoMailJunkSettings in your sogo.conf? What are its values?

dragoangel

dragoangel

2022-01-19 19:44

reporter   ~0015787

I have: SOGoJunkFolderName= "Junk";

dragoangel

dragoangel

2022-01-19 19:50

reporter   ~0015789

I don't have SOGoMailJunkSettings, mail learn by dovecote sieve script to rspamd.

francis

francis

2022-01-19 20:28

administrator   ~0015790

Can you share the timings from your browser? You should have two XHR requests when clicking the Junk button:

mark-as-junk.jpg (65,016 bytes)   
mark-as-junk.jpg (65,016 bytes)   
dragoangel

dragoangel

2022-01-19 20:50

reporter   ~0015792

Move to junk take more time then move to another folder.

moveToAnyOtherFolder.png (4,074 bytes)   
moveToAnyOtherFolder.png (4,074 bytes)   
moveToJunk.png (7,682 bytes)   
moveToJunk.png (7,682 bytes)   
francis

francis

2022-01-19 20:56

administrator   ~0015793

The moveMessages action performs an IMAP MOVE operation regardless of the destination mailbox.

Check your Dovecot log and configuration.

dragoangel

dragoangel

2022-01-19 22:04

reporter   ~0015795

For example on 1 eml I click quickly 3 times on move to junk and in junk folder I get 3 eml (duplicates) and in dovecot I see that it actually copy and delete and somehow it copy same message that should be deleted:

19/01/2022, 23:50:08 info imap(my@example.com)<3187908><I6ZYXvbVisysFgH4>: expunge: box=INBOX, uid=4397, msgid=<MID@spammer.com>, size=13171
19/01/2022, 23:50:08 info imap(my@example.com)<3187908><I6ZYXvbVisysFgH4>: copy from INBOX: box=Junk, uid=2355, msgid=<MID@spammer.com>, size=13171
19/01/2022, 23:50:08 info imap(my@example.com)<3187904><p9ZVXvbVeMysFgH4>: expunge: box=INBOX, uid=4397, msgid=<MID@spammer.com>, size=13171
19/01/2022, 23:50:08 info imap(my@example.com)<3187904><p9ZVXvbVeMysFgH4>: copy from INBOX: box=Junk, uid=2354, msgid=<MID@spammer.com>, size=13171
19/01/2022, 23:50:08 info imap(my@example.com)<3187896><IZhSXvbVaMysFgH4>: expunge: box=INBOX, uid=4397, msgid=<MID@spammer.com>, size=13171
19/01/2022, 23:50:08 info imap(my@example.com)<3187896><IZhSXvbVaMysFgH4>: copy from INBOX: box=Junk, uid=2353, msgid=<MID@spammer.com>, size=13171

Can SOGo have a sort of delay to get response from IMAP before allow moving same message or another message at least from\to Junk folder?
I can't reproduce it on Trash as it has confirm dialog. Move operation on other folders react too quickly as well to be able to drug and drop them multiply times before they actually move.
Due to that I actually can reproduce moving to\out of Junk because dovecot run spam\ham learning and it takes more time (3-4s in my case, but based on email size it can be a bit more).

dragoangel

dragoangel

2022-01-19 22:07

reporter   ~0015796

I sure many people use learning based not on sogo option, but on dovecot to get it working on plain imap as well in addition to SOGo webmail, and they will face same bug.

francis

francis

2022-01-20 20:21

administrator   ~0015800

Is your Dovecot exposing the MOVE capability?

dragoangel

dragoangel

2022-01-20 20:38

reporter   ~0015801

How I can quickly check this?

francis

francis

2022-01-20 20:44

administrator   ~0015802

❯ telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot (Debian) ready.
. login username password
. 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 METADATA SPECIAL-USE QUOTA ACL RIGHTS=texk] Logged in
. logout
* BYE Logging out
. OK Logout completed (0.001 + 0.000 secs).
Connection closed by foreign host.
dragoangel

dragoangel

2022-01-20 20:53

reporter   ~0015803

had to openssl s_client -connect mx.example.com:143 -starttls imap as plain is not allowed :D and hoped find it in config honestly.

* 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 PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY METADATA SPECIAL-USE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk
dragoangel

dragoangel

2022-01-20 20:54

reporter   ~0015804

one note that I also has this: https://doc.dovecot.org/configuration_manual/spam_reporting/ with exact same COPY syntax, don't know if that important honestly.

francis

francis

2022-01-20 21:05

administrator   ~0015805

SOGo is doing a MOVE operation when the extension is exposed. Therefore I would suspect the COPY/EXPUNGE sequence to come from your global Sieve script and slow down the whole operation. You can try disabling the spam reporting configuration in Dovecot to see if it decreases the delay.

dragoangel

dragoangel

2022-01-20 21:20

reporter   ~0015806

But problem that I need that future to work :p
I agree that if delay will be small it will be harder to face, or even impossible maybe. But it possible in some configurations, and this is the issue

dragoangel

dragoangel

2022-01-20 21:22

reporter   ~0015807

There was request to ask confirmation on move to spam, in same way it done for move to trash, maybe it will resolve particularly (hide) this bug.

dragoangel

dragoangel

2022-01-25 08:48

reporter   ~0015814

Hi Francis, I double checked with people deep in dovecot and they say that's it okay that dovecot log show copy+expunge, this exactly what done by move. So can SOGo wait for end of move operation or timeout for x seconds? Or as proposed use confirmation dialog. This will save from:

  1. Abusing move to junk which now allow users to learn strongly one email as spam
  2. Stop from dublicating emails

Issue History

Date Modified Username Field Change
2022-01-18 13:38 dragoangel New Issue
2022-01-18 13:39 dragoangel Note Added: 0015777
2022-01-19 18:54 francis Note Added: 0015781
2022-01-19 19:14 dragoangel Note Added: 0015782
2022-01-19 19:42 francis Note Added: 0015785
2022-01-19 19:44 dragoangel Note Added: 0015787
2022-01-19 19:50 dragoangel Note Added: 0015789
2022-01-19 20:28 francis Note Added: 0015790
2022-01-19 20:28 francis File Added: mark-as-junk.jpg
2022-01-19 20:50 dragoangel Note Added: 0015792
2022-01-19 20:50 dragoangel File Added: moveToAnyOtherFolder.png
2022-01-19 20:50 dragoangel File Added: moveToJunk.png
2022-01-19 20:56 francis Note Added: 0015793
2022-01-19 22:04 dragoangel Note Added: 0015795
2022-01-19 22:07 dragoangel Note Added: 0015796
2022-01-20 20:21 francis Note Added: 0015800
2022-01-20 20:38 dragoangel Note Added: 0015801
2022-01-20 20:44 francis Note Added: 0015802
2022-01-20 20:53 dragoangel Note Added: 0015803
2022-01-20 20:54 dragoangel Note Added: 0015804
2022-01-20 21:05 francis Note Added: 0015805
2022-01-20 21:20 dragoangel Note Added: 0015806
2022-01-20 21:22 dragoangel Note Added: 0015807
2022-01-25 08:48 dragoangel Note Added: 0015814
2022-04-25 20:21 francis Severity major => minor