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

Error when marking multiple messages as spam #9718

Open
sgofferj opened this issue Jun 7, 2024 · 2 comments
Open

Error when marking multiple messages as spam #9718

sgofferj opened this issue Jun 7, 2024 · 2 comments

Comments

@sgofferj
Copy link

sgofferj commented Jun 7, 2024

Steps to reproduce

  1. Select multiple messages
  2. Mark as spam

Expected behavior

Mail should mark all selected messages as spam and move them to the junk follder

Actual behavior

Mail marks and moves one message

Mail app version

3.7.1

Mailserver or service

postfix/cyrus

Operating system

Linux/docker

PHP engine version

PHP 8.2

Web server

Nginx

Database

MariaDB

Additional info

Log:

{
    "reqId": "hRC9q1s3nKwVvCDDY2f6",
    "level": 3,
    "time": "2024-06-07T08:04:48+00:00",
    "remoteAddr": "192.168.10.1",
    "user": "sgofferj",
    "app": "PHP",
    "method": "PUT",
    "url": "/index.php/api/messages/12211/flags",
    "message": "Undefined array key 64539 at /var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php#344",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0",
    "version": "28.0.6.1",
    "data": {
        "app": "PHP"
    }
}
{
    "reqId": "hRC9q1s3nKwVvCDDY2f6",
    "level": 3,
    "time": "2024-06-07T08:04:48+00:00",
    "remoteAddr": "192.168.10.1",
    "user": "sgofferj",
    "app": "mail",
    "method": "PUT",
    "url": "/index.php/api/messages/12211/flags",
    "message": "OCA\\Mail\\IMAP\\MessageMapper::move(): Return value must be of type int, null returned in file '/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php' line 344",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0",
    "version": "28.0.6.1",
    "exception": {
        "Exception": "Exception",
        "Message": "OCA\\Mail\\IMAP\\MessageMapper::move(): Return value must be of type int, null returned in file '/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php' line 344",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/AppFramework/App.php",
                "line": 184,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    [
                        "OCA\\Mail\\Controller\\MessagesController"
                    ],
                    "setFlags"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Route/Router.php",
                "line": 315,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Mail\\Controller\\MessagesController",
                    "setFlags",
                    [
                        "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    ],
                    [
                        "12211",
                        "mail.messages.setFlags"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/base.php",
                "line": 1069,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/mail/api/messages/12211/flags"
                ]
            },
            {
                "file": "/var/www/html/index.php",
                "line": 39,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 169,
        "Previous": {
            "Exception": "TypeError",
            "Message": "OCA\\Mail\\IMAP\\MessageMapper::move(): Return value must be of type int, null returned",
            "Code": 0,
            "Trace": [
                {
                    "file": "/var/www/html/custom_apps/mail/lib/Service/MailManager.php",
                    "line": 410,
                    "function": "move",
                    "class": "OCA\\Mail\\IMAP\\MessageMapper",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\IMAP\\ImapClientRateLimitingDecorator",
                            [
                                "HICenv",
                                "HICflags",
                                "HIChdrs",
                                "HICdate",
                                "HICsize",
                                "And 1 more entries, set log level to debug to see all entries"
                            ],
                            true,
                            true
                        ],
                        "INBOX",
                        64539,
                        "INBOX.SPAM"
                    ]
                },
                {
                    "file": "/var/www/html/custom_apps/mail/lib/Service/MailManager.php",
                    "line": 305,
                    "function": "moveMessageOnSameAccount",
                    "class": "OCA\\Mail\\Service\\MailManager",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Account"
                        ],
                        "INBOX",
                        "INBOX.SPAM",
                        64539
                    ]
                },
                {
                    "file": "/var/www/html/custom_apps/mail/lib/Listener/MoveJunkListener.php",
                    "line": 73,
                    "function": "moveMessage",
                    "class": "OCA\\Mail\\Service\\MailManager",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Account"
                        ],
                        "INBOX",
                        64539,
                        [
                            "OCA\\Mail\\Account"
                        ],
                        "INBOX.SPAM"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
                    "line": 86,
                    "function": "handle",
                    "class": "OCA\\Mail\\Listener\\MoveJunkListener",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Events\\MessageFlaggedEvent"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 230,
                    "function": "__invoke",
                    "class": "OC\\EventDispatcher\\ServiceEventListener",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Events\\MessageFlaggedEvent"
                        ],
                        "OCA\\Mail\\Events\\MessageFlaggedEvent",
                        [
                            "Symfony\\Component\\EventDispatcher\\EventDispatcher"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 59,
                    "function": "callListeners",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        [
                            [
                                "Closure"
                            ],
                            [
                                "Closure"
                            ],
                            [
                                "Closure"
                            ],
                            [
                                "Closure"
                            ]
                        ],
                        "OCA\\Mail\\Events\\MessageFlaggedEvent",
                        [
                            "OCA\\Mail\\Events\\MessageFlaggedEvent"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
                    "line": 94,
                    "function": "dispatch",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Events\\MessageFlaggedEvent"
                        ],
                        "OCA\\Mail\\Events\\MessageFlaggedEvent"
                    ]
                },
                {
                    "file": "/var/www/html/custom_apps/mail/lib/Service/MailManager.php",
                    "line": 491,
                    "function": "dispatch",
                    "class": "OC\\EventDispatcher\\EventDispatcher",
                    "type": "->",
                    "args": [
                        "OCA\\Mail\\Events\\MessageFlaggedEvent",
                        [
                            "OCA\\Mail\\Events\\MessageFlaggedEvent"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/custom_apps/mail/lib/Controller/MessagesController.php",
                    "line": 799,
                    "function": "flagMessage",
                    "class": "OCA\\Mail\\Service\\MailManager",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Account"
                        ],
                        "INBOX",
                        64539,
                        "$junk",
                        true
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 230,
                    "function": "setFlags",
                    "class": "OCA\\Mail\\Controller\\MessagesController",
                    "type": "->",
                    "args": [
                        12211,
                        [
                            true,
                            false
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 137,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Controller\\MessagesController"
                        ],
                        "setFlags"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/App.php",
                    "line": 184,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        [
                            "OCA\\Mail\\Controller\\MessagesController"
                        ],
                        "setFlags"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Route/Router.php",
                    "line": 315,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::",
                    "args": [
                        "OCA\\Mail\\Controller\\MessagesController",
                        "setFlags",
                        [
                            "OC\\AppFramework\\DependencyInjection\\DIContainer"
                        ],
                        [
                            "12211",
                            "mail.messages.setFlags"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/base.php",
                    "line": 1069,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->",
                    "args": [
                        "/apps/mail/api/messages/12211/flags"
                    ]
                },
                {
                    "file": "/var/www/html/index.php",
                    "line": 39,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::",
                    "args": []
                }
            ],
            "File": "/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php",
            "Line": 344
        },
        "message": "OCA\\Mail\\IMAP\\MessageMapper::move(): Return value must be of type int, null returned in file '/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php' line 344",
        "exception": {},
        "CustomMessage": "OCA\\Mail\\IMAP\\MessageMapper::move(): Return value must be of type int, null returned in file '/var/www/html/custom_apps/mail/lib/IMAP/MessageMapper.php' line 344"
    }
}
@sgofferj
Copy link
Author

sgofferj commented Jun 7, 2024

Actually, it seems that I handled those messages already on my tablet and mail somehow hasn't figured out that they are gone. occ mail:accout:sync doesn't help...

@sgofferj
Copy link
Author

sgofferj commented Jun 7, 2024

Possibly related:
#8223
#9168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant