Page 1 of 1

What's happening with the SMTP in Mantis?

Posted: 02 Jul 2007, 17:22
by HiDDeN
Everyone is having problems! The more I search for a solution, the more messages I find with frustrated tries from users.

I have installed Mantis 1.1.0a3 and configured it properly.

Ok, the check.php page is returning me an error when I try to send a test email. It says this:

Testing Mail - PROBLEMS SENDING MAIL TO: xxx@yyy.com. Please check your php/mail server settings.
Email Address: xxx@yyy.com

Of course, the specified e-mail is different and functional. This is my configuration:

// EMAIL
$g_administrator_email = 'xxx@yyy.com';
$g_webmaster_email = 'xxx@yyy.com';
$g_from_email = 'xxx@yyy.com';
$g_enable_email_notification = 'ON';
$g_allow_signup = 'ON';
$g_send_reset_password = 'ON';
$g_validate_email = 'ON';
$g_use_phpMailer = 'ON';
$g_phpMailer_path = '/var/www/mantis/core/phpmailer/';
$g_phpMailer_method = 2;
$g_smtp_host = 'smtp.myserver.com';
$g_smtp_username = 'myuser';
$g_smtp_password = 'mypassword';

What am I doing wrong? Whether I delete the $g_phpMailer_path variable, or modify it to point the phpMailer that my Linux distro has in another directory, it fails.


What's happening?? 8O

Posted: 02 Jul 2007, 18:08
by vboctor
The problem you are facing may be a repro of the following bug which is fixed in CVS and will be included in the next release:
http://www.mantisbt.org/bugs/view.php?id=8016

Did you test to see if Mantis is able to send notifications from the actual code?

Posted: 05 Jul 2007, 10:44
by HiDDeN
Nope, it is not sending any e-mail notification with the configuration that I specified in my first post....

What should I do?

Posted: 09 Jul 2007, 03:31
by dingfelder
I am a bit confused looking at the phpcode in this area.

email used to work for me, and I tried to ge the cron thing working (on windows) but it never sent any messages.

there are a number of messages in the db table mantis_email_table but even wehen the cron runs, they never get sent, and the table stays full.

so, trying to get it back to where it was before, I turned email back to how I think it was before, and stuff is still getting added to the db table and not getting sent.

# --- email variables -------------
$g_administrator_email = 'me@my.com';
$g_webmaster_email = 'me@my.com';
# the 'From: ' field in emails
$g_from_email = 'me@my.com';
# the return address for bounced mail
$g_return_path_email = 'me@my.com';

$g_phpMailer_method = 2; # Use SMTP server
$g_smtp_username = ''; # no authentication
$g_smtp_password = '';
$g_email_send_using_cronjob = OFF;
$g_smtp_host = 'smtp.abc.com'; // some real smptaddress here

when I send a message from the check page, I get the error: Testing Mail - PROBLEMS SENDING MAIL... and yes, I did update the code as listed above.

what I am confused about, is that if I have

$g_email_send_using_cronjob = OFF;

why is it adding to the db instead of sending it right away?

Posted: 09 Jul 2007, 14:14
by vboctor
For consistency we always add to the DB then send the email. This also has the benefit that if an SMTP failure occurs, we don't just show an error and lose the notification, but we have it in the database and it can be re-sent later.

The check.php email check used to be broken and has been fixed recently. You may want to check the http://www.mantisbt.org/bugs/changelog_page.php to check if your version had the fix or not.

My recommendation is to set the notify own configuration option to ON, and then test using the real bug tracker rather than check.php.

Posted: 09 Jul 2007, 20:59
by dingfelder
ok, so if the email doesn't get sent with either the check page or the normal system, how can I debug what is failing?

Posted: 23 Jul 2007, 21:15
by dingfelder
this discussion is continued in a new thread that I started by mistake http://www.mantisbt.org/forums/viewtopi ... =9470#9470

Posted: 24 Jul 2007, 18:06
by armanic

Posted: 24 Jul 2007, 21:48
by dingfelder
I think we are seeing a different issue (no emails are getting through for me bus some are for you) but for both of us it is apparent that a better way of debugging email sending issues is clearly needed.

vbdoctor mentioned a way in another thread (enabling logging for LOG_EMAIL | LOG_EMAIL_RECIPIENT)

searching the forums, I see that you can set:

$g_log_level = LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/tmp/email.log';