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

O365Interactive or O365Manual using terminal #377

Open
floatious opened this issue Dec 20, 2024 · 2 comments
Open

O365Interactive or O365Manual using terminal #377

floatious opened this issue Dec 20, 2024 · 2 comments

Comments

@floatious
Copy link

Hello Mickaël,

Thank you very much for your work on davmail.
I use it daily.

I usually start davmail in the terminal.

The problem is when my outlook login session times out, and I am not at home.

It would be really nice if you could print the login URL on the stdout in the console,
and then read the URL/token after login on stdin.

If not by default, perhaps you could add an option for this.

Then when I am connected via SSH, I could simply restart davmail and get the new token using the browser,
and simply paste the URL/token in the console.

@esabol
Copy link

esabol commented Dec 20, 2024

@floatious : I would find this useful as well. I'd be happy if the login URL would just be printed to the log file.

I think there is a way of doing at least O365Manual completely from a terminal, but it's not exactly universal. I haven't done it myself (for the reason given later), but I know the first step is to set (in your davmail.properties file) davmail.oauth.tokenFilePath to a separate file in which to store the token. Then you run some script to update the token in the token file, but the script created by @mguessan for doing that is Windows-only. You can find it at https://github.com/mguessan/o365psauth. I would like to think it should be possible to convert that to something that would run on Linux and Mac, but I haven't looked into it and maybe not with the Windows .dll it uses.

@esabol
Copy link

esabol commented Dec 22, 2024

@floatious : Oh, I forgot about issue #338. Please read that relevant issue. I think you need to start DavMail with the -token argument. I've never attempted this myself, so I might be misunderstanding how it works. If what I'm reading there is correct, you don't need to use https://github.com/mguessan/o365psauth anymore. Executing DavMail with the -token argument on a regular basis should be sufficient. Make sure you also have the property davmail.oauth.persistToken=true set.

Note: I think you need to be using DavMail 6.2.2 for this.

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