How to change the link created from EmailReporting Plugin

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

Moderators: Developer, Contributor

m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

Hello Everyone,

I had created the initial setup of Mantis and EmailReporting Plugin under http://mydomain.something.com

Now i have changed everything to: http://newmydomainsite.something.com

But
The Email Reporting plugin when creating new ticket or replying to an old one, it keeps generating links under the old domain http://mydomain.something.com

Any ideas on how to fix this ?

Thank you in advance.
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

Any reply ? anyone ?
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

Usually MantisBT creates this URL automatically.
EmailReporting caches this value so that it can be used properly when sending notifications

Please check the following
  • $g_path in /mantisbt/config/config_inc.php. It should not be hard set but rather filled automatically. So remove if present.
  • Check the mantisbt/adm_config_report.php for plugin_EmailReporting_mail_mantisbt_url_fix. It should be the cached URL of $g_path. Delete if necessary but it should fix itself automatically if $g_path functions correctly
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

Hello,

Thank you for your reply.

The only variable that i found is $g_path = $t_protocol . '://' . $t_host . $t_path; in config_defaults_inc.php
No variable in config/config.php
No variable in adm_config_report.php

Maybe should i look elsewhere?

Thanks
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

You should leave that one as-is

Check the existence of plugin_EmailReporting_mail_mantisbt_url_fix in step 2.
If you do not see it, please let me know what webserver you are using and how PHP is added to it
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

I cannot find anywhere plugin_EmailReporting_mail_mantisbt_url_fix
The webserver is nginx and php is on the default location under CentOS.

whereis php
php: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini_orig /etc/php.ini /usr/share/php /usr/share/man/man1/php.1.gz



Please guide me.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

Please provide me with a copy of the output of phpinfo().
  1. Create a file on your webserver with the following code.

    Code: Select all

    <?php
    phpinfo();
    ?>
  2. Run it through the webserver
  3. and provide me with the output
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

PHP Version 7.3.25
System Linux Support 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Wed Jun 10 11:09:32 UTC 2020 x86_64
Build Date Nov 24 2020 11:10:55
Build System Red Hat Enterprise Linux release 8.2 (Ootpa)
Build Provider Remi's RPM repository <https://rpms.remirepo.net/>
Server API FPM/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc
Loaded Configuration File /etc/php.ini
Scan this dir for additional .ini files /etc/php.d
Additional .ini files parsed /etc/php.d/10-opcache.ini, /etc/php.d/20-bz2.ini, /etc/php.d/20-calendar.ini, /etc/php.d/20-ctype.ini, /etc/php.d/20-curl.ini, /etc/php.d/20-dom.ini, /etc/php.d/20-exif.ini, /etc/php.d/20-fileinfo.ini, /etc/php.d/20-ftp.ini, /etc/php.d/20-gd.ini, /etc/php.d/20-gettext.ini, /etc/php.d/20-iconv.ini, /etc/php.d/20-imap.ini, /etc/php.d/20-intl.ini, /etc/php.d/20-json.ini, /etc/php.d/20-ldap.ini, /etc/php.d/20-mbstring.ini, /etc/php.d/20-mysqlnd.ini, /etc/php.d/20-pdo.ini, /etc/php.d/20-phar.ini, /etc/php.d/20-simplexml.ini, /etc/php.d/20-sockets.ini, /etc/php.d/20-sqlite3.ini, /etc/php.d/20-tokenizer.ini, /etc/php.d/20-xml.ini, /etc/php.d/20-xmlwriter.ini, /etc/php.d/20-xsl.ini, /etc/php.d/30-mysqli.ini, /etc/php.d/30-pdo_mysql.ini, /etc/php.d/30-pdo_sqlite.ini, /etc/php.d/30-wddx.ini, /etc/php.d/30-xmlreader.ini
PHP API 20180731
PHP Extension 20180731
Zend Extension 320180731
Zend Extension Build API320180731,NTS
PHP Extension Build API20180731,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling enabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support available, disabled
Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

Thanks

That looks good so thats not the problem

This is the code that tries to cache your MantisBT url so that EmailReporting can use it
https://github.com/mantisbt-plugins/Ema ... g.php#L652

Please add the following code between line 666 and 667: https://github.com/mantisbt-plugins/Ema ... g.php#L667

Code: Select all

var_dump($t_path, $t_mail_mantisbt_url_fix, $t_absolute_path, $t_dir_script_filename);
exit;
After that visit any MantisBT webpage on your webserver.
It should a maximum of 4 lines of text.
Please post them here

After that remove the code again
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

..
Last edited by m0vidaHattie on 03 Feb 2021, 09:36, edited 1 time in total.
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

any update please ?
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

Is https://itsupport.linakis.com/ the correct new domain? or the old one?
Do you have an API or something else accessing MantisBT? https://40.113.150.68:443/ being in there is not normal.
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

..
Last edited by m0vidaHattie on 03 Feb 2021, 09:36, edited 1 time in total.
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: How to change the link created from EmailReporting Plugin

Post by SL-Gundam »

It's also weird that you could not find plugin_EmailReporting_mail_mantisbt_url_fix on the mantisbt/adm_config_report.php webpage
While https://40.113.150.68:443/ was returned from that very variable

The problem is based on the return variables that someone or something is visiting the page through the old URL and they are not being redirected to the new one. https://40.113.150.68:443/ also would confirm that something is accessing the MantisBT through non-conventional ways

How did you schedule /mantisbt/plugins/EmailReporting/scripts/bug_report_mail.php ?
Last edited by SL-Gundam on 01 Feb 2021, 21:21, edited 1 time in total.
m0vidaHattie
Posts: 26
Joined: 18 Jan 2021, 09:10

Re: How to change the link created from EmailReporting Plugin

Post by m0vidaHattie »

How did you schedule /mantisbt/plugins/EmailReporting/scripts/bug_report_mail.php ?
Through CronJob every X minutes or manually buy running the job manually.

I will try to search again and send you screenshot from the file with the result not found.
Post Reply