cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Email Notification via OAuth2

Open bdin1 opened this issue 1 year ago • 4 comments

Email Notification via OAuth2

Current I see the following email methods PHPMail() Sendmail SMTP

I'm running Version 1.2.26 Maybe this has been asked before, but so many email providers are looking for stronger security to send emails, having access to OAuth would be nice. I do see in the /cacti/include/vendor/phpmailer/src has a OAuth.php method, but not sure how to configure it in Cacti. I do have access to microsoft graph api (codes and token)

bdin1 avatar May 02 '24 14:05 bdin1

Thanks for raising this. We will look into it.

TheWitness avatar May 02 '24 14:05 TheWitness

So, which example works better for you option1 or option2?

https://github.com/PHPMailer/PHPMailer/blob/master/examples/gmail_xoauth.phps

Lines 54++ in that file.

TheWitness avatar Jul 31 '24 22:07 TheWitness

I think option 1 looks better, I think it could be modified to allow for Office 365 and then a call to lookup a stored token that is refreshed every hour

Thank you,

Eric C

From: TheWitness @.> Sent: Wednesday, July 31, 2024 5:30 PM To: Cacti/cacti @.> Cc: bdin1 @.>; Author @.> Subject: Re: [Cacti/cacti] Email Notification via OAuth2 (Issue #5739)

So, which example works better for you option1 or option2?

https://github.com/PHPMailer/PHPMailer/blob/master/examples/gmail_xoauth.phps

Lines 54++ in that file.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/cacti/issues/5739#issuecomment-2261565764 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQDIQ54RRH4VRBZV5OMC53ZPFQQBAVCNFSM6AAAAABHDZLDDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRRGU3DKNZWGQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AOQDIQ4NSHZG27KX76FEKK3ZPFQQBA5CNFSM6AAAAABHDZLDDCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUGZTAUI.gif Message ID: @.*** @.***> >

bdin1 avatar Aug 01 '24 17:08 bdin1

@bdin1,

Just looking at this. It's painful as there are so many settings to preserve, but it's also pretty strait forward. I'm on vacation this week, but will start to rough this in next week.

Larry

TheWitness avatar Oct 21 '24 14:10 TheWitness

Have you been able to spend any time here yet @xmacan? I'm going through issues this week since I won't have dev access.

TheWitness avatar Nov 16 '24 18:11 TheWitness

I'll do it in the next few days

xmacan avatar Nov 18 '24 07:11 xmacan

I've installed 1.3.0 - Dev f09d5b2a on a test system to see about using Oauth2, I have a process already gets a token. We also use Microsoft as our mail provider

bdin1 avatar Jan 02 '25 21:01 bdin1

Please wait few days. I'm working on it but I was busy. It is PR https://github.com/Cacti/cacti/pull/6024

xmacan avatar Jan 03 '25 10:01 xmacan

@bdin1 If you have token, you can use code from this PR now. I have tested it with google and it is working. I have only one issue with get token directly from cacti

xmacan avatar Jan 03 '25 10:01 xmacan

I did see that link, just not a way to use a token. Maybe I am missing something on how to use the OAuth2 process

bdin1 avatar Jan 03 '25 13:01 bdin1

Once the pull request is merged into the development Branch then there should be full oath2 to support including renewing your tokens. @xmacan and I are negotiating as to how to move forward to get this into the develop branch sooner than later.

TheWitness avatar Jan 03 '25 15:01 TheWitness

wonderful, thank you

bdin1 avatar Jan 03 '25 19:01 bdin1

@bdin1 Okay, the pull request is in. We have some issues, but we will handle them under QA. Please test and open issues as you find them.

I will close this as completed now. Open new tickets like I said when you run across issues.

TheWitness avatar Jan 11 '25 12:01 TheWitness