Your question
Hi everyone!
Checking in to see if I hit a bug or doing something wrong.
I am running vandelay 1.0.14 with the following options:
vandelay import exchange-ews --url https://XXX.XXX.XXX.XXX/EWS/Exchange.asmx --allow-invalid-certs --mailbox [email protected] --mailbox-kind primary --auth-basic XXX/XXX db.sqlite
The issue I am having is that the default mailbox of the user used in --auth-basic is imported and not the mailbox set via --mailbox.
The user used for --auth-basic has FullAccess on the Exchange for the mailbox set via --mailbox and can manage the mailbox without issues within Outlook.
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on
This looks like expected behaviour rather than a bug, going by the docs. I couldn’t find anything saying that --mailbox switches the mailbox under Basic authentication.
The EWS importer docs only describe Vandelay acting on the mailbox named by --mailbox through Exchange impersonation in the application-only flow. That is --auth-bearer with --ews-client-secret and --ews-client-id. With --auth-basic, --mailbox is only used to give Vandelay the mailbox’s SMTP address when it can’t work it out from the credentials. Your Basic user (XXX/XXX) isn’t an address, so the address is needed, but that doesn’t make Vandelay read someone else’s mailbox. FullAccess is also something Outlook handles by opening the extra mailbox as a separate store. It doesn’t carry over to a plain EWS request made as the Basic user.
I can’t confirm from the docs whether Basic authentication with delegate or impersonation access is supported, so a human will need to confirm that. Two things that might help in the meantime:
- If your Exchange Server accepts OAuth, use the application-only flow with
--auth-bearer --ews-client-id ... --ews-client-secret .... The application needs permission to access the target mailbox.
- Otherwise, run the import with the target mailbox’s own credentials in
--auth-basic.
Please also post the first lines of the run output, or the mailbox recorded in the archive, so others can see which mailbox was actually read.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Hi,
This was a bug in Vandelay. With Basic authentication, --mailbox was only used for Autodiscover and as a routing hint; the folder requests themselves didn’t name a mailbox, so Exchange answered them from the signed-in user’s own mailbox. Full Access was never the problem. Worse, the archive got recorded under the --mailbox address even though it held the other user’s mail.
Vandelay now addresses every folder in the mailbox given by --mailbox, which is exactly what Full Access permits. The fix ships in the next Vandelay release (1.0.15), and your command will work unchanged. Start from a fresh db.sqlite, though, because the current one contains the wrong mailbox.