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

TNEF support #21

Open
DjeyKey opened this issue Oct 8, 2020 · 3 comments
Open

TNEF support #21

DjeyKey opened this issue Oct 8, 2020 · 3 comments

Comments

@DjeyKey
Copy link

DjeyKey commented Oct 8, 2020

Hi everyone,

Im using the lib 2.1.8 on Laravel 8.0.2 / PHP 7.4 and an MS exchange server.
Im able to connect to the account, count the number of emails in a specific folder, but cannot get the messages. Here's the code and the stack error.

Conf imap :


$oClient = new Client([
	 'host'  => 'Server',
        'port'  => 993,
        'protocol'  => 'imap', //might also use imap, [pop3 or nntp (untested)]
        'encryption'    => 'ssl', // Supported: false, 'ssl', 'tls'
        'validate_cert' => true,
        'username' => 'name@dns.com',
        'password' => 'password'
	]);
'options' => [
        'delimiter' => '/',
        'fetch_body' => true,
        'fetch_flags' => true,
        'message_key' => 'list',
        'fetch_order' => 'asc',
        'open' => [
            // 'DISABLE_AUTHENTICATOR' => 'GSSAPI'
        ],
        'decoder' => [
            'message' => 'utf-8', // mimeheader
            'attachment' => 'utf-8' // mimeheader
        ]
    ]

Connect : OK
Count messages : OK
Get All messages from folder : KO

Code :

$oClient->connect();
	$oFolder = $oClient->getFolder('Orange');
	$count = $oFolder->query()->all()->count();
	$messages = $oFolder->query()->all()->get();
	echo "$count";

Error seems to append when fecthing the messages.

Capture d’écran 2020-10-08 095712

Thx,
Djey

@Webklex Webklex added bug Something isn't working validating labels Oct 8, 2020
@Webklex
Copy link
Owner

Webklex commented Oct 8, 2020

Hi @DjeyKey ,
thanks for your well written report. I'm just missing one important thing: how can I reproduce this behavior?

Please try to narrow it down by sending yourself a simple test email and try to fetch just this one.

$count = $oFolder->query()->subject("test")->count();
$messages = $oFolder->query()->subject("test")->get();
echo "$count";

..then try to expand the amount of mails:

$count = $oFolder->query()->all()->limit(5)->count();
$messages = $oFolder->query()->limit(5)->get();
echo "$count";

..until you find the one that fails. If you can identify a single troubling email, please dump the complete (anonymized) message structure $message->getStructure() and post it here or send it to github@webklex.com if you want to keep it "private".

Best regards,

@DjeyKey
Copy link
Author

DjeyKey commented Oct 8, 2020

Thanks for your reply.
Research for "troubling" email is done, but i cant get the structure, i still got the same error.
Additionnal information about the "troubling" email :

  • this is a forwarded message from Outlook Office 2019
  • maybe this is a special MIME type : TNEF ?

I just sent you the message for some privacy, this is a ZIP for keeping its original structure.
Best regards

@DjeyKey
Copy link
Author

DjeyKey commented Oct 12, 2020

After few exchage with Webklex support,

i tried as advised to cahnge the conf param from "imap" to ""legacy-imap" but this protocol dont seems to be effective, because i get a client connection error.
Anyway, most of my investigations are coming clother to the TNEF encapsluation from MS excahnge when theres multipart messages and attachments.

@Webklex Webklex added enhancement New feature or request validated and removed validating labels Oct 13, 2020
@Webklex Webklex removed bug Something isn't working validated labels Oct 23, 2020
@Webklex Webklex changed the title Cant get messages on MS exchange TNEF support Oct 24, 2020
@Webklex Webklex added Feature request and removed enhancement New feature or request labels Oct 30, 2020
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

2 participants