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

Missing CC, BCC and TO in Google Mail #156

Closed
eduardo-romao opened this issue Aug 25, 2021 · 0 comments
Closed

Missing CC, BCC and TO in Google Mail #156

eduardo-romao opened this issue Aug 25, 2021 · 0 comments

Comments

@eduardo-romao
Copy link

Describe the bug
In Gmail raw headers some addresses comes in same line without \r\n. In this situation the framework ignores this e-mails from CC, BCC and TO addresses in Message Object.

Used config

$clientGmail = $cm->make([
                'host'          => 'imap.googlemail.com',
                'port'          => 993,
                'encryption'    => 'ssl',
                'validate_cert' => true,
                'username'      => '[email protected]',
                'password'      => 'xxxxx',
                'protocol'      => 'imap'
            ]);
$clientGmail->connect();
            $inbox = $clientGmail->getFolders(false)->filter(fn($item) => mb_strtolower($item->path) === 'inbox')->first();
            /** @var Message $message */
            $message = $inbox->messages()->fetchOrderDesc()->subject("Teste Supper #1")->paginate(5, 0)->first();
            dd($message->getCc());

image

Raw Header
Raw Header comes from Gmail:
image

Solution:
In simple test just replacing ", " for ",\r\n " in raw header (src/Header.php) solves te problem.

$raw_headers = str_replace(", ", ",\r\n ", $raw_headers);

After replace raw header:
image

CC Adresses after changes in Message Object:

image

eduardo-romao added a commit to eduardo-romao/php-imap that referenced this issue Aug 25, 2021
Fix CC, BCC and TO Adresses comes in same line with "," in Gmail.
@Webklex Webklex closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants