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

imap_fetchheader(): UID does not exist #717

Open
SkylineGTRS opened this issue Oct 20, 2023 · 2 comments
Open

imap_fetchheader(): UID does not exist #717

SkylineGTRS opened this issue Oct 20, 2023 · 2 comments
Labels
needs investigation This will be tested / debugged or checked out.

Comments

@SkylineGTRS
Copy link

SkylineGTRS commented Oct 20, 2023

Environment (please complete the following information):

  • PHP IMAP version: 5.0.1
  • PHP Version: 8.1
  • Type of execution: Web Server

Describe the bug
Unable to fetch mails $mailbox->getMail($$mailId, false);

The used code:

$mailbox = new Mailbox(
            config('imap.dec_host') . 'INBOX', // IMAP server and mailbox folder
            config('imap.dec_username'), // Username for the before configured mailbox
            config('imap.dec_password'), // Password for the before configured username
            null, // Directory, where attachments will be saved (optional)
            'UTF-8', // Server encoding (optional)
            true, // Trim leading/ending whitespaces of IMAP path (optional)
            false, // Attachment filename mode (optional; false = random filename; true = original filename)
        );

        // set some connection arguments (if appropriate)
        $mailbox->setConnectionArgs(CL_EXPUNGE);
        
        try {
            $mailsIds = $mailbox->searchMailbox('UNSEEN');

            if (count($mailsIds)) {
                foreach ($mailsIds as $id) {
                    $mail = $mailbox->getMail($id, false);
                }
            }
        } catch (Throwable $ex) {
            report($ex);
        }

Additional context
Composer is up to date and all required php extensions are installed.

What could be causing this issue? any ideas?

@SkylineGTRS SkylineGTRS added the needs investigation This will be tested / debugged or checked out. label Oct 20, 2023
@trittler
Copy link

trittler commented Jun 3, 2024

@SkylineGTRS same Problem here. Still trying to find out what the problem is. Suddenly did not work anymore with the error message: "imap_fetchheader(): UID does not exist"

@trittler
Copy link

trittler commented Jun 3, 2024

@SkylineGTRS I solved the problem in my project. I did not select the correct folder using switchMailbox($folder).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This will be tested / debugged or checked out.
Projects
None yet
Development

No branches or pull requests

2 participants