imap icon indicating copy to clipboard operation
imap copied to clipboard

Connect to Shared Mailbox

Open TwinMist opened this issue 6 years ago • 11 comments

Hi How do you connect to a shared mailbox? normally you would do authuser='.$username.'/user='.$shared.'}';

thanks

TwinMist avatar Jan 24 '19 11:01 TwinMist

I'm sorry, what exactly is a shared Mailbox? Is it a part of the IMAP standard?

Slamdunk avatar Jan 24 '19 11:01 Slamdunk

Yes normally do $hostnameporting = '{outlook.office365.com:993/imap/ssl/authuser='.$username.'/user='.$sharedmailbox.'}'; imap_open($hostnameporting, $username, $password)

TwinMist avatar Jan 24 '19 12:01 TwinMist

bit like changing to another mailbox USER EMAIL: [email protected] PASSWORD: password SHARED MAILBOX: [email protected]

imap_open("{outlook.office365.com:993/imap/ssl/[email protected]/[email protected]}", "[email protected]", "password");

TwinMist avatar Jan 24 '19 16:01 TwinMist

anyone got any ideas on how to do this?

thanks?

TwinMist avatar Feb 16 '19 18:02 TwinMist

Hi, you can start by creating a custom Server class with custom getServerString implementation. If you succeed, I can open a bit the official class allowing injection arbitrary server string for imap_open.

Slamdunk avatar Feb 16 '19 20:02 Slamdunk

I have no idea how to do this. Just need to turn my normal command which is $hostnameporting = '{outlook.office365.com:993/imap/ssl/authuser='.$username.'/user='.$sharedmailbox.'}'; imap_open($hostnameporting, $username, $password)

Can u help

On Sat, 16 Feb 2019, 20:22 Filippo Tessarotto <[email protected] wrote:

Hi, you can start by creating a custom Server https://github.com/ddeboer/imap/blob/master/src/Server.php class with custom getServerString implementation. If you succeed, I can open a bit the official class allowing injection arbitrary server string for imap_open.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ddeboer/imap/issues/393#issuecomment-464381080, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRHyx0mpx-gjN7ZV4iY9fuCBFuMijrNks5vOGhqgaJpZM4aQpbY .

TwinMist avatar Feb 17 '19 07:02 TwinMist

For me, $server->authenticate('<main email>\<mailbox>', $argv[1]); worked.

JamesCullum avatar Mar 12 '19 13:03 JamesCullum

Hey guys, had the same problem:

$connection = $server->authenticate('<main email>\<mailbox>', $argv[1]);

worked for me, but then I got issues with

$connection->getMailboxes()

My solution to fix the issue: Specific the server as follow:

$server = new Server($this->imapHost, $this->imapPort, '/imap/ssl/[email protected]>/[email protected]'); $connection = $server->authenticate('[email protected]'', 'mainPassword); return $connection->getMailboxes()

Might be helpful for some

llaurenz avatar Dec 12 '20 17:12 llaurenz

Hi, I don't know what shared mailboxes are: may you link me a provider of one so I can test them and document them?

Slamdunk avatar Dec 13 '20 07:12 Slamdunk

Hi Slamdunk,

a shared mailbox is a mailbox from an exchange mail server like office 365, designed that multiple people have access to this mailbox. Common examples where shared mailbox are used are [email protected], etc.

https://docs.microsoft.com/en-us/exchange/collaboration/shared-mailboxes/shared-mailboxes?view=exchserver-2019

We are using office 365. You might need a premium version to test there. Not sure.

Hope that helps, Laurenz

llaurenz avatar Dec 14 '20 15:12 llaurenz

In fact I'm unable to test Office 365 as I don't have a premium version.

Could you please send here a PR adding how you did it in the README.md please?

Slamdunk avatar Dec 15 '20 08:12 Slamdunk