简体   繁体   中英

Unable to relay recipient in non-accepted domain

All emails with the domain @mycompany.com are sent successfully. But, if MantisBT wants to send an email to anyone else, for example @othercontractor.com , or @gmail.com , etc , the email is not sent.

In addition, a collateral damage of this problematic email is that it will get stuck in "MySqlDatabase/mantis_email_table" and all the emails after this problematic email in that table won't be sent. So, to fix it, I have to manually delete that entry in the table. It is not very convenient when I want to add contractor who has his own email domain in our bug tracker.

This the email configuration in: /path_to_mantis_bt/config/config_inc.php

// Email Configuration
$g_email_send_using_cronjob = ON;
$g_allow_signup = ON; //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'edge.mycompany.com';
$g_smtp_connection_mode = '';
$g_smtp_port = 25;
$g_administrator_email = 'myname@mycompany.com';
$g_from_email = 'myname@mycompany.com';
$g_return_path_email = 'myname@mycompany.com';
$g_from_name = 'Mantis Bug Tracker';

I should mention that we are hosting MantisBT on our own server Microsoft Server 2012 R2 and WAMP(latest version).

The error: 2018-01-08 10:24 PST MAIL email_api.php:1379 email_send() ERROR: Message could not be sent - SMTP Error: The following recipients failed: xxx@gmail.com: 5.7.54 SMTP; Unable to relay recipient in non-accepted domain

It's working now, but I used sendmail instead of using the WAMP/SMTP.

To install SENDMAIL on WAMP, I followed these instructions

This the email configuration in: /path_to_mantis_bt/config/config_inc.php

$g_allow_signup    = ON;  //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL; //If not using sendmail, use: PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'edge.mycompany.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_smtp_username = 'xxx'; // my username for email myname@mycompany.com
$g_smtp_password = 'xxx'; // my password for email myname@mycompany.com
$g_administrator_email  = 'myname@mycompany.com';
$g_webmaster_email      = 'myname@mycompany.com';
$g_from_email           = 'myname@mycompany.com';
$g_return_path_email    = 'myname@mycompany.com';
$g_from_name = 'Mantis Bug Tracker';

// Log configuration
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT | LOG_FILTERING | LOG_AJAX;
$g_log_destination = 'file:/wamp64/logs/mantis.log';
?>

IF you follow the link above, you will know how to update php.ini and sendmail.ini . Update these 2 files with the information in config_inc.php.

I had the same issue. In my case, we were sending out emails from an application and there was a user bcced (hardcoded in the code) which was not in the domain and hence it failed

I had same issue once I changed to @newdomain.com. In my case I found suggestion on the web to clear cache of my browser. I did and all start working. Basically, you need to reload all config files from scratch with new globals... At least it worked for me.

Cheers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM