cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]. Supports IMAP/SMTP, JMAP and soon EWS
http://cypht.org
GNU Lesser General Public License v2.1
1.01k stars 164 forks source link

"All" Inbox, "Everything" and "History" are blank when connecting email accounts to local hosted IMAP server #1259

Open Geryishere opened 1 month ago

Geryishere commented 1 month ago

šŸ› Bugreport

When connecting Cypht webmail client to local hosted IMAP server (XEAMS), which is located in the same network as Cypht, and configurating two different email accounts, the "All" Inbox, "Everything" box and "History" box remain empty. This is NOT the case when connecting to external (commercial) IMAP servers such as GMX or Google. However, all email accounts are correctly displayed separately under "Email" and synchronise perfectly with the local IMAP host (XEAMS).

Version & Environment

v2.4.0 installed on Ubuntu 22.04 within LXD container

Steps to reproduce

  1. Add new IMAP server under "Servers" for first Email account. Use local IP for connecting to local hosted IMAP server (XEAMS) and use local email account and password provided by XEAMS. Port is 143 (no TSL or SSL).
  2. Add new SMTP server under "Servers". Use external SMTP server (GMX or Google). Use port 587 with TSL.
  3. Connections with IMAP (local) and SMTP (external) are correctly established. Synchronisation starts and emails are displayed in Inbox and Sent box.
  4. Add a second IMAP server under "Servers" for the second Email account. Use the same local IP as for the first account to connect to the local hosted IMAP server (XEAMS). Use a separate local email account and password provided by XEAMS. Port is 143 (no TSL or SSL).
  5. Add another SMTP server under "Servers" for the second email account. Use external SMTP server (GMX or Google). Use port 587 with TSL.
  6. Connections with IMAP (local) and SMTP (external) are correctly established for the second email account. Synchronisation starts and emails are displayed in Inbox and Sent box of the second account.
  7. "All" Inbox, "Everything" and "History" are blank.
indridieinarsson commented 1 month ago

Is it correctly understood that you can see the emails on the local server in the cypht inbox, but not in the "all" abd "everything" views? If so, it could be related to this : #1195 If that is the case, can you try to connect to the local server in a python shell using imaplib?

import imaplib
# presumably localhost, or just the address to your local imap server.
mail = imaplib.IMAP4_SSL('localhost') 
mail.login('you@yourownmailserver.com', 'yourveryprivatepassword')
mail.select('INBOX')
# choose a date below so that you know there are some mails in your inbox since then
status, data = mail.search(None, '(ALL) ALL SINCE "16-Aug-2024" NOT HEADER X-Auto-Bcc cypht')

inspect the data variable, it should contains as many id numbers as there are mails since that date. If there are none, try to repeat the last line but omit the NOT HEADER X-Auto-Bcc cypht part, and see if the results change.

marclaporte commented 1 month ago

Thank you @Geryishere

Some community members reported this on the chat: https://gitter.im/cypht-org/community

But AFAIK, none of the active developers were able to reproduce it. Could you join us on the chat and do a screenshare with one of the developers?

Geryishere commented 1 month ago

Thank you @indridieinarsson for your suggestions. I will try to figure out the imaplib data then and provide you with the results. Could you @marclaporte tell me how to join in the chat for a screenshare with one of the developers? Is it the community group https://gitter.im/cypht-org/community ? Is it a real time chat (UTC-4 timezone)?

Geryishere commented 1 month ago

As suggested by @indridieinarsson, I have carried out the python shell using imaplib. Here is the outcome:

import imaplib mail = imaplib.IMAP4_SSL('192.168..') mail.login('**@local', '***') ('OK', [b'LOGIN completed']) mail.select('INBOX') ('OK', [b'2']) status, data = mail.search(None, '(ALL) ALL SINCE "16-Aug-2024" NOT HEADER X-Auto-Bcc cypht')

result: no id numbers at all, although I received a lot of emails since 16-Aug-2024

then I tried:

status, data = mail.search(None, '(ALL) ALL SINCE "16-Aug-2024" ')

no Id number as well

indridieinarsson commented 1 month ago

@Geryishere that's weird. Might try with just '' ALL SINCE "16-Aug-2024", but I'm a bit outside of my expertise here. Since the normal Inbox is showing messages, but the aggregate views are not, I suspected an issue with the search. At least it's not the issue I was having.

As the aggregate views are using Imap search, this might still be a search issue - you might want to try to rebuild the search index in xeams : https://www.xeams.com/rebuildingsearchindex.htm (old article, but seams to still be valid).

Geryishere commented 1 month ago

As suggested by @indridieinarsson I rebuilt the search index in XEAMS for the last two days:

Building index for Good messages

Rebuilding 20241001 - 20 of 21

Building index for Possible spam messages


Building index for Spam messages


Building index for Good messages

Rebuilding 20241002 - 21 of 21

Building index for Possible spam messages


Building index for Spam messages

The result was not positive: All boxes "Everything", "History" and "All" remain empty,

indridieinarsson commented 1 month ago

@Geryishere ok. I think I'm out of ideas for the moment.

marclaporte commented 1 month ago

@Geryishere The offer for a screenshare is sti available :-)