email_versand_via_office_365_und_smtp

Deutschsprachiges Forum für Diskussionen und Fragen zu MantisBT

Moderators: Developer, Contributor

Post Reply
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo in die Runde,

freut mich hier zu sein und meine Frage/n stellen zu können. Ich möchte dann auch direkt loslegen, auch wenn die Frage nicht ganz neu ist und in ähnlicher Form hier schon einmal gestellt wurde. Ähnlich wie jedoch die anderen Forenbesucher auch, konnte ich mit den hier verfügbaren Informationen das Problem nicht lösen. Worum geht es also:

Im Unternehmen wurde auf Office365 umgestellt. Bis vor einigen Tagen wurden die Emails vom Mantis-BT auch über die Office365-Adressen / SMTP verschickt. Seit einigen Tagen funktioniert dies jedoch nicht mehr. Die Frage stellt sich nun, ob es an folgenden Dingen liegen könnte:

a) Version von MantisBT und Debian zu alt (MantisBT => 1.1.6; Debian => 6.0 "Squeeze")
b) Einstellungen in der config_php
c) Müssen Änderungen an der php.ini vorgenommen werden? (auch da gibt es ja Mail-Einstellungen)
d) oder doch ein Problem mit Office365 / Exchange?

Ich habe die aktuelle

Code: Select all

config.php 
hochgeladen, hier einige Zeilen aus dem Apache-Log

Code: Select all

PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/my_view_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/my_view_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/view.php?id=454
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/view.php?id=454
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/view.php?id=454
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/my_view_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php?return=my_view_page.php&error=1
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php?return=my_view_page.php&error=1
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/login_page.php?return=my_view_page.php&error=1
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/my_view_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/view.php?id=488
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/view.php?id=488
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17, referer: https://xyz/mantis/bug_change_status_page.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 17
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18, referer: https://xyz/mantis/view.php?id=488
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18, referer: https://xyz/mantis/bugnote_add.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18, referer: https://xyz/mantis/bugnote_add.php
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18
PHP Notice:  Use of undefined constant PHPMAILER_METHOD_SMTP - assumed 'PHPMAILER_METHOD_SMTP' in /var/www/mantis/config_inc.php on line 18
Ich würde mich sehr über Rückmeldungen freuen, da Mantis intensiv genutzt wird und dies auch weiter so bleiben soll. Wenn noch mehr Infos benötigt werden, werde ich diese auf Anfrage gerne hochladen.
Vorab vielen Dank für jegliche Rückmeldung(en).

Viele Grüße

Sasquatch
Attachments
mantis_bt_config_php_muster.txt
(1.67 KiB) Downloaded 396 times
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: email_versand_via_office_365_und_smtp

Post by atrol »

Sasquatch wrote:Bis vor einigen Tagen wurden die Emails vom Mantis-BT auch über die Office365-Adressen / SMTP verschickt. Seit einigen Tagen funktioniert dies jedoch nicht mehr.
Dann kann das Problem doch nicht an MantisBT liegen, zumindest solange dort nichts geändert wurde.
Die Änderungen

Code: Select all

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
kann in der Version 1.1.6 nicht funktionieren, da es diese Konstante in dieser alten MantisBT version noch gar nicht gab.
Ich habe den Eindruck hier wurde etwas "verschlimmbessert".

Ich kenne mich mit Office365 nicht aus. Vielleicht gibt es dort irgendwo ein Log mit Fehlern und Warnungen was den SMTP Versand angeht.
Please use Search before posting and read the Manual
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

Re: email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo Atrol,

vorab vielen Dank für deine Rückmeldung.
kann in der Version 1.1.6 nicht funktionieren, da es diese Konstante in dieser alten MantisBT version noch gar nicht gab.
Ich habe den Eindruck hier wurde etwas "verschlimmbessert".
So etwas habe ich mir auch schon gedacht. Es bringt mich aber enorm weiter zu wissen, dass das feature in der vorliegenden MantisBT-Version gra nicht vorgesehen ist.
An dem Ansatz kann ich zumindest weiterarbeiten. Ich werde nachforschen und mich ggf. noch mal melden.

Viele Grüße

Sasquatch
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

Re: email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo zum zweiten Mal in die Runde,

nach der Rückmeldung von atrol, wurde die Konfiguration wieder rückgängig gemacht. Die Emails werden aber trotzdem nicht mehr versendet. Als Test für ein mgl. Update sowohl des Debian/Apache-Servers als auch der darauf befindlichen MantisBT-Installation, habe ich eine virtuelle Maschine aufgesetzt (Debian Jessie). Ziel war es die alte Installation zunächst auf diesen neuen Server zu installieren und dann das Update auf die neueste Version von MantnisBT anzustoßen. Ich habe sowohl die Anweisungen aus dem Manual als auch hier im Forum einen Beitrag gelesen (den ich leider nicht mehr finden konnte). Nach den Ausführungen der anderen Forenteilnehmer habe ich das Update in diese Schritte heruntergebrochen:

1. Exportieren der Datenbank auf altem System (mit mysqldump)
2. Importieren der Datenbank auf neuem System (mit mysqldump)
3. Download von MantisBT auf neuem System entpacken
4. Datei config_inc.php von altem System in den entpackten Download von neuem System kopieren und ggf. Anpassen
5. Start von http://www.NeuesMantisBT/admin/install.php

Die Schritte haben auch soweit funktioniert, aber folgende Fehlermeldung taucht leider immer wieder auf:

Code: Select all

Could not create 'mantis_plugin_table', ... already exists
Auch zu diesem Thema hatte ich hier im Forum einen Beitrag gelesen, der besagte, dass man an dieser Stelle am besten statt

Code: Select all

CreateTableSQL 

Code: Select all

ChangeTableSQL 
schreiben solle, leider hat dies auch nichts gebracht.

Ich habe ebenfalls eine hier Forum vorgeschlagenen Lösung ausprobiert, die besagte überhaupt keine config_ini.php zu kopieren, sondern diese durch den Installationsprozess erstellen zu lassen. Dies hat leider auch nicht funktioniert und folgende Fehlermeldung kam dabei heraus:

Code: Select all

Does administrative user have access to the database (Access denied for user 'abc'@'xyz' (using password no))
So langsam frage ich mich, ob es nicht besser wäre, sich von Debian zu verabschieden und Ubunutu zu verwenden, da die Fehler so langsam meine Kenntnisse überschreiten. Ziel ist auf jeden Fall ein Update des bestehenden Systems mit garantierter Übernahme bzw. Weiterverwendung der bestehenden / verwendeteten Datensätze, da, wie eingangs erwähnt, MantisBT intensiv genutzt wird.

Freue mich auf sämtliche Rückmeldungen und bedanke mich vorab bei allen Helfer/innen.

Viele Grüße

Sasquatch
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

Re: email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo zusammen,

nach einem erneuten Versuch konnte eine Installation des neuen Mantis auf einer virtuellen Maschine erreicht werden. Die alte Datenbank ist ebenfalls eingebunden.
Die config_ini.php wurde folgendermaßen erweitert:

Code: Select all

<?php
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'bugtracker_new';
$g_db_username = 'root';
$g_db_password = '******';
$g_allow_signup    = ON;  
$g_enable_email_notification = ON;
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.office365.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_smtp_username = '******@xyz';
$g_smtp_password = '******';
$g_administrator_email = '******@xyz';

// Email logging. Ggf. auskommentieren, falls nicht mehr benoetigt
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/tmp/mantisbt.log';
Das Loggen der Emails funktioniert sehr gut, bis auf die letzten Zeilen sagen mir die Fehlermeldungen leider überhaupt nichts, ich konnte auch keine brauchbaren Hinweise im Netz finden. Wie kann ich denn die entsprechende Berechtigung erteilen bzw. was bedeuten die Fehlermeldungen und wie ist das Problem zu lösen?
Zur Ansicht ist hier das log.file:

Code: Select all

2016-03-21 13:11 CET mail_recipient Issue = #488, add Reporter = @U89
2016-03-21 13:11 CET mail_recipient Issue = #488, add Handler = @U89
2016-03-21 13:11 CET mail_recipient Issue = #488, add Note Author = @U89
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U8
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U6
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U9
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U68
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U78
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U89
2016-03-21 13:11 CET mail_recipient Issue = #488, add Project User = @U93
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U89 (own)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U8 (pref email_on_status off)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U6 (pref email_on_status off)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U9 (pref email_on_status off)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U68 (pref email_on_status off)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U78 (pref email_on_status off)
2016-03-21 13:11 CET mail_recipient Issue = #488, drop @U93 (pref email_on_status off)
2016-03-21 13:11 CET mail Processing e-mail queue (12 messages)
2016-03-21 13:11 CET mail Sending message #4823 queued on 2016-03-21 12:36 CET
2016-03-21 13:11 CET mail ERROR: Message could not be sent - SMTP Error: Data not accepted.<p>SMTP server error: 5.7.60 SMTP; Client does not have permissions to send as this sender^M
</p>

2016-03-21 13:11 CET mail Server not responding for 5 seconds, aborting
~                        
Freue mich auf eure Rückmeldung(en).

Viele Grüße und vorab vielen Dank

Sasquatch
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: email_versand_via_office_365_und_smtp

Post by atrol »

Ich würde mal noch die folgenden beiden Konfigurationen in confing_inc.php eintragen und entsprechend anpassen.
Ich hatte schon mal mit SMTP Servern zu tun, die 'noreply@example.com' ablehnten.

Code: Select all

/**
 * the sender email, part of 'From: ' header in emails
 * @global string $g_from_email
 */
$g_from_email			= 'noreply@example.com';

/**
 * the return address for bounced mail
 * @global string $g_return_path_email
 */
$g_return_path_email	= 'admin@example.com';
Please use Search before posting and read the Manual
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

Re: email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo atrol,

vielen Dank für die Rückmeldung. Ich habe die Zeilen hinzugefügt und geändert, bin aber nicht sicher ob ich jeweils die richtige Adressen dort eingetragen habe, weil das log jetzt folgendermaßen aussieht:

Code: Select all

2016-03-21 13:11 CET mail Server not responding for 5 seconds, aborting
2016-03-21 15:35 CET mail_recipient Issue = #488, add Reporter = @U89
2016-03-21 15:35 CET mail_recipient Issue = #488, add Handler = @U89
2016-03-21 15:35 CET mail_recipient Issue = #488, add Note Author = @U89
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U8
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U6
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U9
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U68
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U78
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U89
2016-03-21 15:35 CET mail_recipient Issue = #488, add Project User = @U93
2016-03-21 15:35 CET mail_recipient Issue = #488, drop @U89 (own)
2016-03-21 15:35 CET mail Issue = #488, Type = closed, Msg = 'email_notification_title_for_status_bug_closed', User = @U8, Email = 'abc@xyz.de'.
2016-03-21 15:35 CET mail message #4835 queued
Nur zum Verständnis: Beschwert sich Mantis, das den Projekten kein User zugeordnet ist, oder habe ich @U da falsch als Userliste gedeutet?

Vielen Dank für sämtliche Rückmeldungen und die schnelle Hilfe.

Viele Grüße

Sas
Sasquatch
Posts: 13
Joined: 15 Mar 2016, 10:42

Re: email_versand_via_office_365_und_smtp

Post by Sasquatch »

Hallo in die Runde,

hier eine kurze Rückmeldung. Nach Anpassen der default_config_inc in Bezug auf die SMTP-Einstellungen funktioniert es jetzt. Die hier gelisteten Fehlermeldungen wurden auch vom System als nicht-zustellbare Emails an das dafür
bereitgestellte Postfach geschickt. Es handelt sich dabei um Mailadressen aus einem nicht mehr verwendeteten Email-System, also so etwas wie Karteileichen. Nach dem die entsprechenden Konten deaktiviert wurden, traten die Fehlermeldungen nicht mehr auf (andere Baustellen gibt es aber trotzdem noch).

Viele Grüße

Sas
Post Reply