Configure Plugin to Office365

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

Moderators: Developer, Contributor

Post Reply
jcgallardo
Posts: 12
Joined: 30 Mar 2016, 14:14

Configure Plugin to Office365

Post by jcgallardo »

Hi, I have a problem with this plugin configuration to connect to a Office 365. I have tried several options but none works. We have configured Mantis to send mails with office 365 but i cant configure this.

Im running a XAMPP compilation with Mantis version 1.2.17 and EmailReporting plugin version 0.9.


Can anyone help me??



This is the result of execute the report mail task

D:\xampp\php>D:\xampp\php\php.exe D:\xampp\htdocs\mantis\plugins\EmailReporting\scripts\bug_report_mail.php

Start checking all mailboxes: Wednesday 30th of March 2016 17:17:56

array(14) {
["enabled"]=>
int(1)
["description"]=>
string(9) "SAT Account"
["mailbox_type"]=>
string(4) "IMAP"
["hostname"]=>
string(18) "smtp.office365.com"
["port"]=>
int(587)
["encryption"]=>
string(4) "None"
["ssl_cert_verify"]=>
int(0)
["erp_username"]=>
string(21) "sat@company.com"
["erp_password"]=>
string(12) "encripted_pass"
["auth_method"]=>
string(4) "USER"
["project_id"]=>
int(3)
["global_category_id"]=>
int(2)
["imap_basefolder"]=>
string(11) "AUTO_MANTIS"
["imap_createfolderstructure"]=>
int(0)
}
<p style="color:red">SYSTEM WARNING: 'Invalid argument supplied for foreach()' i
n 'D:\xampp\htdocs\mantis\plugins\EmailReporting\core_pear\Net\IMAPProtocol.php'
line 1006</p><p style="color:red">SYSTEM WARNING: 'Invalid argument supplied fo
r foreach()' in 'D:\xampp\htdocs\mantis\plugins\EmailReporting\core_pear\Net\IMA
PProtocol.php' line 1006</p><p style="color:red">SYSTEM WARNING: 'Invalid argume
nt supplied for foreach()' in 'D:\xampp\htdocs\mantis\plugins\EmailReporting\cor
e_pear\Net\IMAPProtocol.php' line 1006</p>

Mailbox: SAT Account
Location: Attempt login
[pear_error: message=", " code=0 mode=return level=notice prefix="" info=""]


Done checking all mailboxes


This is our mail configuration in config.inc.php
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.office365.com';
$g_smtp_username = 'sat@company.com';
$g_smtp_password = 'password';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 25;
$g_from_email = 'mailbox@company.com';
$g_from_name = 'Bug Tracker';
$g_return_path_email = 'mailbox@company.com';
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Configure Plugin to Office365

Post by SL-Gundam »

You need to use the imap hostname, not SMTP. Also please adjust the port number accordingly
encryption should be set to SSL or TLS, not none

SMTP is for sending emails so logically that would not work very well

https://support.office.com/en-us/articl ... 7113525f6c

Whether that fixes it i don't know since i don't have any office 365 available for testing but let me know the results
jcgallardo
Posts: 12
Joined: 30 Mar 2016, 14:14

Re: Configure Plugin to Office365

Post by jcgallardo »

Thanks for your answer.

I have tried several configurations and finally I got it. The principal problem is that, in my company, we have two kinds of office365 accounts: "desktop" and "non-desktop" accounts. I have solved it using a desktop account, I cant do it with a non-desktop account.

If anyone help, this is my correct configuration :

Description: Desktop 365 Account
Mailbox type: IMAP
Hostname: outlook.office365.com
TCP port (optional): 143
Connection encryption: STARTTLS
Verify SSL certificate: 0
Username: myaccount@mycompany.com
Password: ******
Authentication method: USER
Basefolder (optional): AUTO_MANTIS
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Configure Plugin to Office365

Post by SL-Gundam »

Non desktop probably have imap support for those accounts disabled. They are only available through webmail. You probably can't add those non-desktop accounts to phones either

Good to know it works at least
Post Reply