Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail not found, but whole source available #10361

Open
mat-m opened this issue Nov 16, 2024 · 4 comments · May be fixed by #10371
Open

Mail not found, but whole source available #10361

mat-m opened this issue Nov 16, 2024 · 4 comments · May be fixed by #10371

Comments

@mat-m
Copy link

mat-m commented Nov 16, 2024

Steps to reproduce

  1. I click on an email in the list (from 2 days ago, unread), and I get a "Not Found" error instead of the body, but headers are shown
  2. When I click the View Source in the mail headers, I get the full HTML body of the email

Expected behavior

Display the email body

Actual behavior

Error message in the page.

Also, in the logs, I have this error:

Exception
Call to a member function getEmail() on null in file '/var/www/html/custom_apps/mail/lib/Service/PhishingDetection/PhishingDetectionService.php' line 34

Mail app version

4.0.2

Nextcloud version

30.0.0

Mailserver or service

https://www.laposte.net/accueil

Operating system

Windows

PHP engine version

None

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

NC deployed through docker

@ChristophWurst
Copy link
Member

Dear @mat-m,
thank you very much for your report.
It seems there are some missing null checks in the phishing detection feature. Here's a patch: #10371.
I was not able to verify the changes myself, as the code paths only run for certain messages. I'd be happy if you can help test the changes.
See https://docs.nextcloud.com/server/30/admin_manual/issues/applying_patch.html#patching-apps for assistance.

@mat-m
Copy link
Author

mat-m commented Nov 30, 2024

Hello,

Patch applied, looks good. I skimmed through my mails and didn't find any issues.

@mat-m
Copy link
Author

mat-m commented Dec 2, 2024

OK, I found a half-broken one today. Displayed Not Found twice and then worked.
Since it is a newsletter (kisskissbank notification about a project), I can easily send it to you in eml format if you want to import it into a test mailbox.

@XueSheng-GIT
Copy link

XueSheng-GIT commented Dec 20, 2024

I'm also having issues with a lot of "Not found" mails although the source of the mail is ok.
The provided patch #10371 does not help.

Browser log:

10:04:57.551 [ERROR] mail: Could not fetch message 
Object { app: "mail", uid: "user-uid", level: 2, error: {…} }
​
app: "mail"
​
error: Object { isError: Getter & Setter, debug: Getter & Setter, type: Getter & Setter, … }
​
level: 2
​
uid: "user-uid"
​
<prototype>: Object { … }
ConsoleLogger.js:74:18
    value ConsoleLogger.js:74
    value ConsoleLogger.js:100
    fetchMessage ThreadEnvelope.vue:656

Nextcloud log:

{
    "reqId": "wPUwczb0g35m1FRfMJ4y",
    "level": 3,
    "time": "2024-12-20T10:04:57+01:00",
    "remoteAddr": "192.168.5.202",
    "user": "user-uid",
    "app": "mail",
    "method": "GET",
    "url": "/apps/mail/api/messages/99231/body",
    "message": "Failed to parse time string (Thu, 19 Dec 2024 13:41:07 +0100 (GMT+01:00)) at position 36 (+): Double timezone specification",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0",
    "version": "30.0.4.1",
    "exception": {
        "Exception": "DateMalformedStringException",
        "Message": "Failed to parse time string (Thu, 19 Dec 2024 13:41:07 +0100 (GMT+01:00)) at position 36 (+): Double timezone specification",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/TimeFactory.php",
                "line": 44,
                "function": "__construct",
                "class": "DateTime",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/Service/PhishingDetection/DateCheck.php",
                "line": 27,
                "function": "getDateTime",
                "class": "OC\\AppFramework\\Utility\\TimeFactory",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/Service/PhishingDetection/PhishingDetectionService.php",
                "line": 55,
                "function": "run",
                "class": "OCA\\Mail\\Service\\PhishingDetection\\DateCheck",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/IMAP/ImapMessageFetcher.php",
                "line": 530,
                "function": "checkHeadersForPhishing",
                "class": "OCA\\Mail\\Service\\PhishingDetection\\PhishingDetectionService",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/IMAP/ImapMessageFetcher.php",
                "line": 246,
                "function": "parseHeaders",
                "class": "OCA\\Mail\\IMAP\\ImapMessageFetcher",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
                "line": 312,
                "function": "fetchMessage",
                "class": "OCA\\Mail\\IMAP\\ImapMessageFetcher",
                "type": "->"
            },
            {
                "function": "OCA\\Mail\\IMAP\\{closure}",
                "class": "OCA\\Mail\\IMAP\\MessageMapper",
                "type": "->",
                "args": [
                    "*** sensitive parameters replaced ***"
                ]
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
                "line": 302,
                "function": "array_map"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
                "line": 75,
                "function": "findByIds",
                "class": "OCA\\Mail\\IMAP\\MessageMapper",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
                "line": 188,
                "function": "find",
                "class": "OCA\\Mail\\IMAP\\MessageMapper",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php",
                "line": 211,
                "function": "getImapMessage",
                "class": "OCA\\Mail\\Service\\MailManager",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 208,
                "function": "getBody",
                "class": "OCA\\Mail\\Controller\\MessagesController",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 114,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 161,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1003,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/index.php",
                "line": 24,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Utility/TimeFactory.php",
        "Line": 44,
        "message": "Failed to parse time string (Thu, 19 Dec 2024 13:41:07 +0100 (GMT+01:00)) at position 36 (+): Double timezone specification",
        "exception": [],
        "CustomMessage": "Failed to parse time string (Thu, 19 Dec 2024 13:41:07 +0100 (GMT+01:00)) at position 36 (+): Double timezone specification"
    },
    "id": "676533958ded2"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging a pull request may close this issue.

3 participants