OAuth2 email authentication method needed

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

jkwtw
Posts: 3
Joined: 06 Nov 2023, 14:24

Re: OAuth2 email authentication method needed

Post by jkwtw »

Hi,
I'm also trying to get sambucas fork to work. From the Microsoft portal it seems the OAuth works but when I try to run the script on the server I get:

Code: Select all

Call to undefined method Javanile\Imap2\Roundcube\ImapClient::getMailboxName()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/core/mail_api.php: 400: IMAP - -> - getCurrentMailBox()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/core/mail_api.php: 251: ERP_mailbox_api - -> - process_imap_mailbox()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/pages/bug_report_mail.php: 74: ERP_mailbox_api - -> - process_mailbox()
/var/www/html/mantisbt-2.25.7/plugin.php: 74: - - - - include( <string>'/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/pages/bug_report_mail.php' )
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/scripts/bug_report_mail.php: 28: - - - - require_once( <string>'/var/www/html/mantisbt-2.25.7/plugin.php' )

Start checking all mailboxes: Monday 6th of November 2023 14:30:26

INTERNAL APPLICATION ERROR:
user@server:/var/www/html/mantis/plugins/EmailReporting/scripts$
I know pretty much nothing about php, so any help would be highly appreciated.
jkwtw
Posts: 3
Joined: 06 Nov 2023, 14:24

Re: OAuth2 email authentication method needed

Post by jkwtw »

Hi, it seems my last post shows up everywhere but in the thread itself, so I'll just quote it in hopes it goes through this time.
Sorry, if the original post shows up after all and this ends up being a double post.
jkwtw wrote: 06 Nov 2023, 14:33 Hi,
I'm also trying to get sambucas fork to work. From the Microsoft portal it seems the OAuth works but when I try to run the script on the server I get:

Code: Select all

Call to undefined method Javanile\Imap2\Roundcube\ImapClient::getMailboxName()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/core/mail_api.php: 400: IMAP - -> - getCurrentMailBox()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/core/mail_api.php: 251: ERP_mailbox_api - -> - process_imap_mailbox()
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/pages/bug_report_mail.php: 74: ERP_mailbox_api - -> - process_mailbox()
/var/www/html/mantisbt-2.25.7/plugin.php: 74: - - - - include( <string>'/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/pages/bug_report_mail.php' )
/var/www/html/mantisbt-2.25.7/plugins/EmailReporting/scripts/bug_report_mail.php: 28: - - - - require_once( <string>'/var/www/html/mantisbt-2.25.7/plugin.php' )

Start checking all mailboxes: Monday 6th of November 2023 14:30:26

INTERNAL APPLICATION ERROR:
user@server:/var/www/html/mantis/plugins/EmailReporting/scripts$
I know pretty much nothing about php, so any help would be highly appreciated.
jkwtw
Posts: 3
Joined: 06 Nov 2023, 14:24

Re: OAuth2 email authentication method needed

Post by jkwtw »

For future reference:

The getMailboxName function is not implemented. However, it is only called when the IMAP Basefodler is not set. When specified, the plugin works correctly.
There are also some errors when using php 8 with unescaped hyphons in regular expressions. These can be fixed by escaping the hyphons.
The previously mentioned expunge method seems to be missing as well and is marked as todo.
databird
Posts: 1
Joined: 13 May 2024, 05:57

Re: OAuth2 email authentication method needed

Post by databird »

Hi everyone,

We managed to activate OAUTH2 on MantisBT (v1.2.7) with plugin "Email Reporting" (v0.9.3.1) :D

Have a look on our GitHub repository : https://github.com/databird/mantisbt_oauth2
and enjoy it :wink:

Image
Rainer
Posts: 1
Joined: 20 Jan 2026, 06:20

Re: OAuth2 email authentication method needed

Post by Rainer »

is this still working?
we have
Email Reporting 0.11.0-DEV
PHP 8.3.26
MantisBT 2.27.1

but I am unable to test the mailbox with the procedure you have mentioned.
I just get operationed failed and have not signin logs in O365.
Sau3333
Posts: 5
Joined: 23 Apr 2026, 08:30

Re: OAuth2 email authentication method needed

Post by Sau3333 »

I have the same problem than you it gets imposible for me to make it work and the plugin its 3 years old so I think that could be the problem. Theres someone else active in thise forum that could help us?
Last edited by Sau3333 on 23 Apr 2026, 09:18, edited 1 time in total.
Sau3333
Posts: 5
Joined: 23 Apr 2026, 08:30

Re: OAuth2 email authentication method needed

Post by Sau3333 »

Sau3333 wrote: 23 Apr 2026, 09:08 I have the same problem than you it gets imposible for me to make it work and the plugin its 3 years old so I think that could be the problem. Theres someone else active in thise forum that could help us?
I`ve been searching and I have found a Emailreporting 0.12.0 DEV that supports OAUTH autentication according to the documentation could someone help me to make it work?
EvilDennisR
Posts: 3
Joined: 05 May 2026, 15:47

Re: OAuth2 email authentication method needed

Post by EvilDennisR »

Our company is absolutely interested in using the EmailReporting plugin with IMAP with OAuth for Office365.

Both Google and Microsoft are phasing out (if they haven't already) normal user/password logins, and they now require an authentication token.
SL-Gundam
Posts: 781
Joined: 06 Jul 2011, 14:17

Re: OAuth2 email authentication method needed

Post by SL-Gundam »

Well the good news is that i have an Experimental version that supports Microsoft OAuth, not google just yet. Google still supports app passwords for the moment.
I hope that in 2 weeks i will be able to launch a version with Microsoft OAuth. No promises though.

Somebody else created a version that already supports OAuth. I believe its somewhere in this thread.
SL-Gundam
Posts: 781
Joined: 06 Jul 2011, 14:17

Re: OAuth2 email authentication method needed

Post by SL-Gundam »

Alright a "beta" version is ready. You can try it if you want.
The Microsoft OAuth is tested and works. Google Workspace on the other hand i was not able to test.
There are no instructions as that is the part i need to start working on.

See the experimental branch.
https://github.com/mantisbt-plugins/Ema ... perimental

Please also check the powershell script "EmailReporting Microsoft Entra App.ps1" in the "scripts" directory.
Hopefully it makes the whole process easier.

You will need to install all the composer packages yourself. If you don't know how composer works, wait for later this week for the release with everything included.

Rough todo list
// - Update readme requirements specification
// - cleanup script to remove not needed directories for distribution package
// - storage certificate outside document root (error if unsafe)
// - check TODO translations for german and spanish
// - Incase of XOAUTH2 should we get the login token before starting the mailbox connection?
// - Should we force a default hostname for XOAUTH2?
// - Add help info for new oauth config options
// - Test google oauth
// - Change error handling of OAuth API
Changelog so far
- Drop support for MantisBT 1.3.x
- PHP requirement change: minimum PHP required 8.1
- Updated PEAR packages: PEAR, Auth_SASL
- Add Powershell script for Microsoft Entra App creation
- Improve charset conversion. Iconv is used as fallback
- Changed simple_html_dom to php-core/simplehtmldom (Composer)
- Composer migration: PEAR, Auth_SASL, Net_IMAP, Net_POP3, Net_Socket, Net_mimeDecode, Markdownify (ERP version), EmailReplyParser
- TNEF decoder (winmail.dat) support using QualityUnit/TNEFDecoder
- Support for OAuth authentication with Microsoft and Google
- Removed safe_mode check (deprecated)
- Changed set_time_limit from infinite to 5 minutes per mailbox
Post Reply