Меню

Произошла ошибка при подключении к сборщику glpi

Describe the bug

When setting adding/editing a mail receiver, using an Office365 shared mailbox causes «Connection errors» message when trying to query the remote folders.

The error turns out to be a string with backslashes being escaped twice, resulting in four backslashes.

Page(s) URL

https://glpi.domain.com/front/mailcollector.form.php?id=X

To reproduce

Steps to reproduce the behavior:

  1. Add/edit a mail collector.
  2. Configure an Office365 shared mailbox: account@domain.comshared_mailbox@domain.com
  3. Fill in the rest ff the form.
  4. Click on the hamburger (three parallel lines)
  5. Observe error.

Expected behavior

Show remote folders.

Logs

_log/php-errors.log:

*** PHP Warning(2): imap_open(): Couldn't open stream {outlook.office365.com/imap/novalidate-cert/tls}
  Backtrace :
  :
  inc/mailcollector.class.php:1229                   imap_open()
  inc/mailcollector.class.php:378                    MailCollector->connect()
  ajax/mailcollector.php:73                          MailCollector->displayFoldersList()
*** PHP Notice(8): Unknown: LOGIN failed. (errflg=1)
 *** PHP Notice(8): Unknown: Too many login failures (errflg=2)

Additional context

Investigating the code, I found that the AJAX call results in backslashes being escaped twice.
The «login» field for example, becomes «account@domain.com\shared_mailbox@domain.com» and the login to Office365 fails.

I edited «ajax/mailcollector.php» and added the below line to remove the additional slashes.

//fix back-slashes being escaped too much (for shared mailboxes)
$input[‘login’] = str_replace (‘\’ , » , $input[‘login’]);

Describe the bug

When setting adding/editing a mail receiver, using an Office365 shared mailbox causes «Connection errors» message when trying to query the remote folders.

The error turns out to be a string with backslashes being escaped twice, resulting in four backslashes.

Page(s) URL

https://glpi.domain.com/front/mailcollector.form.php?id=X

To reproduce

Steps to reproduce the behavior:

  1. Add/edit a mail collector.
  2. Configure an Office365 shared mailbox: account@domain.comshared_mailbox@domain.com
  3. Fill in the rest ff the form.
  4. Click on the hamburger (three parallel lines)
  5. Observe error.

Expected behavior

Show remote folders.

Logs

_log/php-errors.log:

*** PHP Warning(2): imap_open(): Couldn't open stream {outlook.office365.com/imap/novalidate-cert/tls}
  Backtrace :
  :
  inc/mailcollector.class.php:1229                   imap_open()
  inc/mailcollector.class.php:378                    MailCollector->connect()
  ajax/mailcollector.php:73                          MailCollector->displayFoldersList()
*** PHP Notice(8): Unknown: LOGIN failed. (errflg=1)
 *** PHP Notice(8): Unknown: Too many login failures (errflg=2)

Additional context

Investigating the code, I found that the AJAX call results in backslashes being escaped twice.
The «login» field for example, becomes «account@domain.com\shared_mailbox@domain.com» and the login to Office365 fails.

I edited «ajax/mailcollector.php» and added the below line to remove the additional slashes.

//fix back-slashes being escaped too much (for shared mailboxes)
$input[‘login’] = str_replace (‘\’ , » , $input[‘login’]);

login an password is correct, yes it was working before.

[code]   GLPI 9.4.6 (/glpi => /home/domain/public_html/glpi) Installation mode: TARBALL

Operating system: Linux odedi56318.mywhc.ca 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 PHP 7.4.8 fpm-fcgi (Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, SourceGuardian, Zend OPcache, apcu, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, session, shmop, snmp, soap, sockets, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib) Setup: max_execution_time=»60″ memory_limit=»256M» post_max_size=»128M» safe_mode=»» session.save_handler=»files» upload_max_filesize=»128M» Software: Apache () Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 Server Software: MariaDB Server Server Version: 10.2.32-MariaDB Server SQL Mode: Parameters: domain_glpi32@localhost/domain_glpi32 Host info: Localhost via UNIX socket mysqli extension is installed ctype extension is installed fileinfo extension is installed json extension is installed mbstring extension is installed iconv extension is installed zlib extension is installed curl extension is installed gd extension is installed simplexml extension is installed xml extension is installed ldap extension is installed imap extension is installed Zend OPcache extension is installed APCu extension is installed xmlrpc extension is installed exif extension is installed CAS extension is not present Database version seems correct (10.2.32) — Perfect! /home/domain/public_html/glpi/files/_log : OK /home/domain/public_html/glpi/config : OK /home/domain/public_html/glpi/files : OK /home/domain/public_html/glpi/files/_dumps : OK /home/domain/public_html/glpi/files/_sessions : OK /home/domain/public_html/glpi/files/_cron : OK /home/domain/public_html/glpi/files/_graphs : OK /home/domain/public_html/glpi/files/_lock : OK /home/domain/public_html/glpi/files/_plugins : OK /home/domain/public_html/glpi/files/_tmp : OK /home/domain/public_html/glpi/files/_cache : OK /home/domain/public_html/glpi/files/_rss : OK /home/domain/public_html/glpi/files/_uploads : OK /home/domain/public_html/glpi/files/_pictures : OK Web access to files directory is protected : OK SELinux mode is Unknown SELinux boolean configuration for httpd_can_network_connect —> unkwown (Some features may require this to be on) SELinux boolean configuration for httpd_can_network_connect_db —> unkwown (Some features may require this to be on) SELinux boolean configuration for httpd_can_sendmail —> unkwown (Some features may require this to be on)

htmLawed version 1.2.4 in (/home/domain/public_html/glpi/lib/htmlawed) phpmailer/phpmailer version 6.0.7 in (/home/domain/public_html/glpi/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.3 in (/home/domain/public_html/glpi/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.3.2 in (/home/domain/public_html/glpi/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/home/domain/public_html/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/home/domain/public_html/glpi/vendor/true/punycode/src) iamcal/lib_autolink in (/home/domain/public_html/glpi/vendor/iamcal/lib_autolink) sabre/vobject in (/home/domain/public_html/glpi/vendor/sabre/vobject/lib) zendframework/zend-cache in (/home/domain/public_html/glpi/vendor/zendframework/zend-cache/src) zendframework/zend-i18n in (/home/domain/public_html/glpi/vendor/zendframework/zend-i18n/src) zendframework/zend-serializer in (/home/domain/public_html/glpi/vendor/zendframework/zend-serializer/src) monolog/monolog in (/home/domain/public_html/glpi/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/home/domain/public_html/glpi/vendor/sebastian/diff/src) elvanto/litemoji in (/home/domain/public_html/glpi/vendor/elvanto/litemoji/src) symfony/console in (/home/domain/public_html/glpi/vendor/symfony/console) leafo/scssphp in (/home/domain/public_html/glpi/vendor/leafo/scssphp/src)

Not active

Way of sending emails: PHP

Name: ‘support@domain.ca’ Active: Yes Server: ‘{domain.ca/imap/ssl/novalidate-cert/notls/debug}INBOX’ Login: ‘support@domain.ca’ Password: Yes

accounts Name: Accounts Version: 2.5.0 State: Not activated fields Name: Additional Fields Version: 1.10.0 State: Enabled dashboard Name: Dashboard Version: 0.9.7 State: Not activated databases Name: Databases Version: 2.2.0 State: Not activated domains Name: Domains Version: 2.1.0 State: Not activated environment Name: Environment Version: 2.3.0 State: Not activated datainjection Name: File injection Version: 2.7.0 State: Not activated formcreator Name: Forms Version: 2.7.0 State: Not activated fusioninventory Name: FusionInventory Version: 9.4+2.4 State: Enabled mod Name: GLPI Modifications Version: 1.5.2 State: Enabled resources Name: Human Resources Version: 2.6.0 State: Not activated mydashboard Name: My Dashboard Version: 1.7.4 State: Not activated officeonline Name: Office Online Version: 1.0.1 State: Not activated reservation Name: Reservation Version: 2.2.0 State: Enabled shellcommands Name: Shell Commands Version: 2.3.0 State: Not activated showconns Name: Show connected items Version: 0.1 State: Not activated webapplications Name: Web applications Version: 2.6.0 State: Not activated
[/code]

#1 2016-09-30 14:18:39

nikit0ss
Member
Registered: 2016-08-31
Posts: 24

SMTP connect() failed

The message I get when trying to create an ticket. Now that there is no error. But I do no longer receive any emails.

Error sending email
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ … leshooting

WHERE IS glpi mail logs ?
centos
var/www/html/glpi/files/_log

Last edited by nikit0ss (2016-09-30 15:55:36)

#2 2016-10-04 17:41:43

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: SMTP connect() failed

glpi/files/_log/mail.log


CentOS 6.5 — CentOS 7.x
PHP 5.6 — PHP 7.x — MySQL 5.6  — MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

#3 2016-10-04 20:35:44

andrew.k2
Member
From: Latvia
Registered: 2014-05-07
Posts: 60

Re: SMTP connect() failed

I get the same error, when updating GLPI from 0.8x.x to 9.1. I changed the notification settings

Setup > Notifications > Email followup configuration > Mail server

Check certificate changed from yes to no.
No it’s ok for me.


[prod] — GLPI 9.3; [test] — GLPI 9.3.1



7 ноября, 2019
7 ноября, 2019

Дано

GLPI + Linux Server + Apache + MySQL
Возникает ошибка при попытка прикрепить файлы к заявкам и не только.
Текст ошибки:

Сбой при создании папки /var/www/glpi/files/XML/b6. Проверьте правильность настройки прав доступа

Ошибка может ссылаться и на другие каталоги внутри “files”

Решение

Ошибка возникает при неверно установленных правах на каталог files или его подкаталоги.

Для исправления нужно установить права и владельца, согласно предписаниям по установке (описание на оф. сайте)

перейти в каталог glpi:

выполнить две команды:

chmod R 0755 files

chown R wwwdata:wwwdata files

Установка прав доступа и установка владельца и группы соответственно.

Обратите внимание на пользователя, под которым работает ваш веб сервер, он может отличаться от данного примера.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Произошла ошибка при проверке подлинности ps4
  • Произошла ошибка при пополнении 1хбет