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

smtp_connection_helper fails with smtp: too longer line in input stream with Microsoft 365 SMTP host #43

Open
coffeegoddd opened this issue Jan 18, 2023 · 1 comment

Comments

@coffeegoddd
Copy link
Contributor

This can be reproduced using the Microsoft 365 host with --auth login:

smtp_connection_helper \ 
--host smtp.office365.com \
--port 587 \
--auth login \
--username [email protected] \
--password ***** \
--from [email protected] \
--to [email protected]

smtp: too longer line in input stream

smtp_connection_helper is actually getting an exception response from the email server that's too long for it to read. That's the input stream too longer failure.

The cause of the problem is that [email protected] is not authorized to send mail from [email protected]:

SendAsDenied; [email protected] not allowed to send as [email protected]; STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message [BeginDiagnosticData]Cannot submit message. // continued...
@coffeegoddd
Copy link
Contributor Author

If the --username email address/account has permission to send email from the --from email address, the smtp_connection_helper should be able to successfully send a test email.

Here is documentation on granting permission for sending emails on another user's behalf https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/give-mailbox-permissions-to-another-user?view=o365-worldwide

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

1 participant