Configuring MantisBT to send emails using GMail - notifications

I am new to Mantis bug tracker and I want to enable the email notification after registering for a new account.
Well, I installed the MantisBT correctly without any problem on my local computer, I already changed the admin's password and removed the admin folder in the directory. After this I signed up for a new account, there was a confirmation message flashed saying that I need to verify my registration via email. My problem here is that no verification message was sent to my email. According to one of the tutorials I found, I need to configure first my config_inc.php. After the installation, the initial content of my config_inc.php was
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
?>
So I changed it to.
*I am using my gmail account here
<?php
$g_hostname = 'localhost';
$g_db_username = '<myUser>';
$g_db_password = '<myPass>';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
$g_allow_signup = ON;
$g_allow_anonymous_login = OFF;
$g_anonymous_account = '';
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = '<myUser#gmail.com>';
$g_smtp_password = '<myPass>';
$g_administrator_email = '<myUser#gmail.com>';
$g_webmaster_email = '<myUser#gmail.com>';
$g_from_name = 'Mantis Bug Tracker';
$g_from_email = '<myUser#gmail.com>';
$g_return_path_email = '<myUser#gmail.com>';
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;
$g_allow_file_upload = ON;
$g_file_upload_method = DATABASE;
$g_absolute_path_default_upload_folder = '';
$g_max_file_size = 5000000;
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files = '';
$g_disallowed_files = '';
$g_window_title = 'MantisBT';
$g_logo_image = 'images/mantis_logo.gif';
$g_favicon_image = 'images/favicon.ico';
$g_show_realname = OFF;
$g_show_user_realname_threshold = NOBODY;
$g_default_home_page = 'my_view_page.php';
?>
I overwrite my config_inc.php with this one and then register for a new account. After submitting the information, an error occured saying:
Fatal error: Call to undefined method SMTP::getError() in < myDirectory >\mantis\library\phpmailer\class.phpmailer.php on line 1910.
And now I'm stucked, please help me with this, I need to setup my email notification. I was just creating accounts but I cannot use them because I need to verify it.
Please let me know if I need to modify some of the related files and what are the steps.
Thanks for the help!

According to a posting on the MantisBT forums, these are working settings for GMail:
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = 'username#gmail.com';
$g_smtp_password = 'yourpassword';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;

Something to add about GMail. These settings are correct but GMail has instituted some new security that will still prevent email from being sent from Mantis or any other mailer using the SMTP connector.
In order to do this with GMail, you must "Allow less secure apps to access accounts". In GMail admin, there is a setting to allow users to control access from "less secure apps," which must be turned on, and then the user account used to send mail must turn on access from "less secure apps." The link above provides the information on how to configure this.
The frustrating thing is everything will appear to work fine but no emails are sent. There is no error indication from the SMTP server. However, the user account used to send mail may receive an email from GMail indicating someone is trying to access the account. I spent hours trying to track this down.

If anyone still faces issue or error while configuration add log level so that you can drill down the problem further. Below settings worked for me. Detailed explanation is written here
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = '465';
$g_smtp_connection_mode = 'ssl';
$g_smtp_username = 'letzdotesting#gmail.com';
$g_smtp_password = 'xxxxx';
$g_administrator_email = 'letzdotesting#gmail.com';
$g_webmaster_email = 'letzdotesting#gmail.com';
$g_from_email = 'letzdotesting#gmail.com';
$g_return_path_email = 'letzdotesting#gmail.com';
$g_default_timezone = 'UTC';
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:C:\mantisbt.log';

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_username = 'username'; // without #gmail.com
$g_smtp_password = 'password';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;
it Works for me

2017 update (MantisBT 2.3.0) Please follow the steps below:
[1] IF YOU'RE USING DOCKER
Access the docker instance running the command below:
docker exec -it {docker-id} bash
[2] INSIDE MANTISBT SERVER
if you dont have any editor:
# sudo apt-get update
# apt-get install vim
create a log file:
# touch /var/log/mantisbt.log
# cd /var/log/
# chmod 777 mantisbt.log
[3] EDITING MANTISBT CONFIGURATION
# vim /var/www/html/config/config_inc.php
add the following content to the file opened in the earlier step:
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_administrator_email = 'your-admin-email#gmail.com';
$g_webmaster_email = 'your-webmaster-email#gmail.com';
$g_return_path_email = 'your-return-email#gmail.com';
$g_from_email = 'your-from-email#gmail.com';
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_port = 465;
$g_smtp_connection_mode = 'ssl';
$g_smtp_username = 'username';
$g_smtp_password = 'password';
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/var/log/mantisbt.log';
$g_validate_email = OFF;
[4] EDITING GMAIL CONFIGURATION
You need to do this in order to allow MantisBT authentication:
Access the following URL:
https://myaccount.google.com
Navigate to the Sign-in & Security menu-item under menu-tree.
Check the "Allow less secure apps" option and set equals to true
Image:
You're good to go!
Tested and running with these configurations. =]

My issue was solved by updating ca certificates.
I am using Xampp, with PHP 7.2 on Windows sever 2012.
Although the below link provides you with the details, I mention the relavent part too:
Updating CA certificates
Updating CA certificates To update your CA certificates, make sure
your operating system is fully up to date - CA certs are usually
updated via OS updates. Alternatively, you can download the latest CA
cert file from curl, install it somewhere accessible (for example
/etc/ssl/cacert.pem) and point at it from the openssl.cafile and
curl.cainfo directives in your php.ini file (this location will vary
according to your OS and PHP config; where you need to put it is
beyond the scope of PHPMailer!):
openssl.cafile = /etc/ssl/cacert.pem
curl.cainfo = /etc/ssl/cacert.pem
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#updating-ca-certificates

Related

404 when executing docker push to gitlab-container-registry

I have installed gitlab-ce 13.2.0 on my server and the container-registry was immediately available.
from a other sever (or my local machine) I can login, but when pushing a image to the container-registry I get a 404-error: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html>\n<html>\n<head>...
in my gitlab.rb I have:
external_url 'https://git.xxxxxxxx.com'
nginx['enable'] = true
nginx['client_max_body_size'] = '250m'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/trusted-certs/xxxxxxxx.com.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/trusted-certs/xxxxxxxx.com.key"
nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
registry_external_url 'https://git.xxxxxxxx.com'
what is confusing, is that the registry_external_url is the same as the external_url. There are those lines in the gitlab.rb:
### Settings used by GitLab application
# gitlab_rails['registry_enabled'] = true
# gitlab_rails['registry_host'] = "git.xxxxxxxx.com"
# gitlab_rails['registry_port'] = "5005"
# gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
But when I uncomment this, I cannot login.
what can be the problem here?
This is actually because you are using https port without proxying the registry in nginx.
Fix these lines according to the following in gitlab.rb:
registry_nginx['enable'] = true
registry_nginx['listen_https'] = true
registry_nginx['redirect_http_to_https'] = true
registry_external_url 'https://registry.YOUR_DOMAIN.gtld'
You don't need to touch nginx['ssl_*] parameters when you are using letsencrypt since the chef would take care.
How is your image named? Your image name must match exactly not only the registry URL, but project too.
You can't just build "myimage:latest" and push it. It must be like git.xxxxxxxx.com/mygroup/myproject:latest. You can obtain correct name from $CI_REGISTRY_IMAGE predefined variable.

Splunk: How to enable Splunk SSO

I have splunk and try to enable splunk SSO instead of nornal authentiation. I have configuraitons as follows:
In /opt/splunk/etc/system/local/server.conf
[general]
trustedIP = 192.168.1.208
serverName = Splunk_Core_02
pass4SymmKey = $7$RRvdYDdIlj4P2geQdtHluTRb7OfvZhTFTZGJ7z5JiZAkJ6Q1at6j0Q==
sessionTimeout = 30s
[sslConfig]
sslPassword = $7$m6pB5a0PWFg64VlNZGgunhGElO3qLiAc6NrhfLO+tpX2jR7WC7qm1Q==
[lmpool:auto_generated_pool_download-trial]
description = auto_generated_pool_download-trial
quota = MAX
slaves = *
stack_id = download-trial
[lmpool:auto_generated_pool_forwarder]
description = auto_generated_pool_forwarder
quota = MAX
slaves = *
stack_id = forwarder
[lmpool:auto_generated_pool_free]
description = auto_generated_pool_free
quota = MAX
slaves = *
stack_id = free
[license]
active_group = Enterprise
[diskUsage]
minFreeSpace = 1024
[lmpool:test_splunk]
quota = MAX
slaves = *
stack_id = enterprise
In /opt/splunk/etc/system/local/web.conf
[settings]
#SSO
SSOMode = permissive
trustedIP = 192.168.1.208,192.168.2.15,127.0.0.1
remoteUser = REMOTE-USER
#tools.proxy.on = False
root_endpoint = /splunk
#SSL
enableSplunkWebSSL = 0
httpport = 8000
mgmtHostPort = 127.0.0.1:8089
appServerPorts = 8065
splunkdConnectionTimeout = 30
enableSplunkWebClientNetloc = False
# SSL certificate files.
privKeyPath = $SPLUNK_HOME/etc/auth/splunkweb/privkey.pem
serverCert = $SPLUNK_HOME/etc/auth/splunkweb/cert.pem
...
I see http://192.168.1.208:8000/debug/sso page, I see SSO is not enabled. What's wrong with my configurations?
There are several documentations says in server.conf, the trustedIP is 127.0.0.1. But none of them mention that only 127.0.0.1 is eligible to enable/activate SSO. So do not configure other IP address, instead of 127.0.0.1.
And in server.conf(/opt/splunk/etc/system/local/), you could only configure one trustedIP, and it is 127.0.0.1.
https://docs.splunk.com/Documentation/Splunk/8.0.3/Security/ConfigureSplunkSSO
Have you restarted splunk after making these changes?
In /opt/splunk/etc/system/local/web.conf,
remoteUser = REMOTE-USER is more likley to be REMOTE_USER
You have to use SAML.. I am using SAML for SSO purpose.. You need to contact IT guy and he will provide you IDP file upload it and share with your Splunk Connection file. You can download it from same window. Go to Users -> Authentication Method > SAML. Once everything is placed Then you have to create groups on AD and same thing you need to do on Splunk under SAML configuration.. Let me know if you need more details..
https://docs.splunk.com/Documentation/Splunk/8.0.3/Security/HowSAMLSSOworks

Different smarthosts for different domains with different credentials

Hello I have two (or maybe more later) domains:
domain1
domain2
I want to configure Exim (cPanel) to use SendGrid's or Mailgun SMTP servers, currently I'm trying with this config in Exim:
**Section: TRANSPORTSTART**
domain1_smtp:
driver = smtp
hosts = smtp.mailgun.org
hosts_require_auth = smtp.mailgun.org
hosts_require_tls = smtp.mailgun.org
domain2_smtp:
driver = smtp
hosts = smtp.mailgun.org
hosts_require_auth = smtp.mailgun.org
hosts_require_tls = smtp.mailgun.org
**Section: AUTH**
domain1_login:
driver = plaintext
public_name = LOGIN
client_send = : postmaster#mg.domain1.com : password
domain2_login:
driver = plaintext
public_name = LOGIN1
client_send = : postmaster#mg.domain2.com : password
**Section: PREROUTER**
send_via_domain1:
driver = manualroute
domains = ! +local_domains
senders = *#domain1.cm
transport = domain1_smtp
route_list = "* smtp.mailgun.org::2525 byname"
host_find_failed = defer
send_via_domain2:
driver = manualroute
domains = ! +local_domains
senders = *#domain2.com
transport = domain2_smtp
route_list = "* smtp.mailgun.org::2525 byname"
host_find_failed = defer
When I'm sending email from user#domain1.com I'm getting messages delivered by postmaster#mg.domain1.com and when I'm sending from user#domain2.com I'm getting messages delivered also from postmaster#mg.domain1.com.
I want to have smarthost for every domain with different credentials. Thanks
I have these setup (VPS + WHM/cPanel + Exim + Mailgun) and after doing some online research, I've found a few helpful websites regarding this topic and managed to come out with the correct configuration. Below are the solutions that I'm currently using on my VPS and hope it will help you as well. It should solve your "via" problem and might solve the intermittent "550 5.7.1 Relaying denied" error from Mailgun as well:
Go to the "Exim Configuration Editor" in WHM. Choose "Advanced Editor" and insert the configuration below:
Section: AUTH
mailgun_login:
driver = plaintext
public_name = LOGIN
hide client_send = ": ${extract{login}{${lookup{$sender_address_domain}lsearch{/etc/exim_mailgun}{$value}fail}}} : ${extract{password}{${lookup{$sender_address_domain}lsearch{/etc/exim_mailgun}{$value}fail}}}"
Section: ROUTERSTART
mailgun:
driver = manualroute
domains = ! +local_domains
transport = mailgun_transport
route_list = "* smtp.mailgun.org::587 byname"
host_find_failed = defer
no_more
Section: TRANSPORTSTART
mailgun_transport:
driver = smtp
hosts = smtp.mailgun.org
hosts_require_auth = smtp.mailgun.org
hosts_require_tls = smtp.mailgun.org
Then create a file named /etc/exim_mailgun and insert the content similar to the structure below (Replace it with your Mailgun's domain login credentials that was verified):
domain1.com: username=postmaster#mg.domain1.com password=abcdefghi
domain2.com: username=postmaster#mg.domain2.com password=jklmnopqr

change in phpmyadmin 3.3.9 config file not giving me access to phpmyadmin

I'm working on a legacy system that uses phpmyadmin 3.3.9, and ALL I did to the config.inc.php file was to change $cfg['Servers'][$i]['AllowNoPassword'] = true; to false. Next thing I know, I get this error:
MySQL said:
Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Then I tried to revert back but no matter what I do, it doesn't connect. I replaced the config file by a config file from a mirror system but no luck! This is the config file contents, what's gone wrong?
<?php
/* Servers configuration */
$i = 0;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/* End of servers configuration */
$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
?>
The application is able to access mysql fine, the issue is in accessing the web interface of phpmyadmin.
I almost feel like it's an error similar to how a file edited on windows and unix might have issues only because of the difference in newline character, because all I did was change one word and save it. But I'm working entirely in Windows.
I tried changing auth_type from config to http as well, but no luck.
Okay, I just restarted all WAMP services and then it ran fine! I thought of deleting this question but then figured it might just be useful for someone who's tearing their hair but have forgotten to simply restart.

KCFinder 'You do not have permission to list the files.'

I have a problem with the integration of KCFinder in ckeditor. The version of my ckeditor is 4.0 and the other (KCFinder version) is 2.52-dev.
Hi configure the config.js of ckeditor like that:
CKEDITOR.config.baseHref = "/ckeditor/";
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.contentsCss = 'contents.css';
config.language= 'it';
config.height = '400px';
config.uiColor = '#ffDC6E';
//kcfinder per l'uoload delle immagini
config.filebrowserBrowseUrl = 'kcfinder-2.51/browse.php?type=files';
config.filebrowserImageBrowseUrl = 'kcfinder-2.51/browse.php?type=images';
config.filebrowserFlashBrowseUrl = 'kcfinder-2.51/browse.php?type=flash';
config.filebrowserUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=files';
config.filebrowserImageUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=images';
config.filebrowserFlashUploadUrl = '../../../reserved/kcfinder-2.51/upload.php?type=flash';
// Remove some buttons, provided by the standard plugins, which we don't
// need to have in the Standard(s) toolbar.
config.removeButtons = 'Subscript,Superscript';
config.disableNativeSpellChecker = false;
};
The integration is of but when I click to "Show files in the server" or when I upload an image the system says "You do not have permission to list the files" though the permissions are correct.
What is the problem?
Tks
Salvo
I think the problem is that you also need to configure the setting in KCFinder. You need to locate config.php in KCFinder folder, for this:
'disabled' => true
change it to false then you should be able to upload file to your server.
Is not the best way for secure raison, because to disable it inside config.php allow to all user to access it, the best way add the little code bellow inside the php file wich include your textarea :
$_SESSION['KCFINDER'] = array(
'disabled' => false
);
Hopes that help.
From the kcfinder website:
By default KCFinder is disabled. If you just set this setting to false all public visitors can upload and manage files on your web site. It is recommended to override this setting with sesssion configuration so only authenticated users can use KCFinder.