Log shows invalid email address

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Log shows invalid email address

Post by juggernautsei »

I have been trying to get the email to work. I have the information in my config_inc.php file that I copied from the default config file and filled in all the SMTP information.

The log file shows an invalid email address.


[10-Nov-2018 13:11:21 UTC] 2018-11-10 13:11 UTC MAIL email_api.php:1353 email_send() ERROR: Message could not be sent - Invalid address: (addAnAddress to): 1


No, it has never worked.
I am using smtp-pulse.com.

Any clues?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Log shows invalid email address

Post by atrol »

The error message tells that you are trying to send an email to address 1.
1 is not a valid email address.
Please use Search before posting and read the Manual
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

Could you share with me where this email address 1 could be possibly coming from in the system?

All users have a valid email address. The administrator has my email address. There are no 1 as the email address anywhere in the system.

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

Re: Log shows invalid email address

Post by atrol »

There is no code where e-mail address is set to 1.
It's hard to tell anything more, as you provided not much information about your configuration and the steps to reproduce the issue.

The information listed below may be useful:

- Exact version of MantisBT, PHP, Database, Web server and Operating System
- Relevant customizations (e.g. changes in config_inc.php, etc)
- Installed plugins or custom functions ?
- Was the MantisBT source code modified in any way ?
- Are there any errors or warnings in web server / PHP logs ?
Please use Search before posting and read the Manual
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

Thank you in advance.

MantisBT 2.18.0
No customization
No plugins or custom functions
Windows server 2008
WAMP 3.0.6
Apache 2.4.23
MySQL 5.7.14
PHP 7.0.10

Error
[12-Nov-2018 23:38:39 UTC] 2018-11-12 23:38 UTC MAIL email_api.php:1353 email_send() ERROR: Message could not be sent - Invalid address: (addAnAddress to): 1

Config_inc.php

#-Email COnfigurations -
###########################
# MantisBT Email Settings #
###########################

/**
* Webmaster email address. This is shown publicly at the bottom of each page
* and thus may be susceptible to being detected by spam email harvesters.
* @global string $g_webmaster_email
*/
$g_webmaster_email = 's***-**n@openmedpractice.com';

/**
* the sender email, part of 'From: ' header in emails
* @global string $g_from_email
*/
$g_from_email = 's***-**n@openmedpractice.com';

/**
* the sender name, part of 'From: ' header in emails
* @global string $g_from_name
*/
$g_from_name = 'Mantis Bug Tracker';

/**
* the return address for bounced mail
* @global string $g_return_path_email
*/
$g_return_path_email = 's***-**n@openmedpractice.com';

/**
* Allow email notification.
* Set to ON to enable email notifications, OFF to disable them. Note that
* disabling email notifications has no effect on emails generated as part
* of the user signup process. When set to OFF, the password reset feature
* is disabled. Additionally, notifications of administrators updating
* accounts are not sent to users.
* @global integer $g_enable_email_notification
*/
$g_enable_email_notification = ON;

/**
* When enabled, the email notifications will send the full issue with
* a hint about the change type at the top, rather than using dedicated
* notifications that are focused on what changed. This change can be
* overridden in the database per user.
*
* @global integer $g_email_notifications_verbose
*/
$g_email_notifications_verbose = OFF;

/**
* The following two config options allow you to control who should get email
* notifications on different actions/statuses. The first option
* (default_notify_flags) sets the default values for different user
* categories. The user categories are:
*
* 'reporter': the reporter of the bug
* 'handler': the handler of the bug
* 'monitor': users who are monitoring a bug
* 'bugnotes': users who have added a bugnote to the bug
* 'category': category owners
* 'explicit': users who are explicitly specified by the code based on the
* action (e.g. user added to monitor list).
* 'threshold_max': all users with access <= max
* 'threshold_min': ..and with access >= min
*
* The second config option (notify_flags) sets overrides for specific
* actions/statuses. If a user category is not listed for an action, the
* default from the config option above is used. The possible actions are:
*
* 'new': a new bug has been added
* 'owner': a bug has been assigned to a new owner
* 'reopened': a bug has been reopened
* 'deleted': a bug has been deleted
* 'updated': a bug has been updated
* 'bugnote': a bugnote has been added to a bug
* 'sponsor': sponsorship has changed on this bug
* 'relation': a relationship has changed on this bug
* 'monitor': an issue is monitored.
* '<status>': eg: 'resolved', 'closed', 'feedback', 'acknowledged', etc.
* this list corresponds to $g_status_enum_string
*
* If you wanted to have all developers get notified of new bugs you might add
* the following lines to your config file:
*
* $g_notify_flags['new']['threshold_min'] = DEVELOPER;
* $g_notify_flags['new']['threshold_max'] = DEVELOPER;
*
* You might want to do something similar so all managers are notified when a
* bug is closed. If you did not want reporters to be notified when a bug is
* closed (only when it is resolved) you would use:
*
* $g_notify_flags['closed']['reporter'] = OFF;
*
* @global array $g_default_notify_flags
*/

$g_default_notify_flags = array(
'reporter' => ON,
'handler' => ON,
'monitor' => ON,
'bugnotes' => ON,
'category' => ON,
'explicit' => ON,
'threshold_min' => NOBODY,
'threshold_max' => NOBODY
);

/**
* We don't need to send these notifications on new bugs
* (see above for info on this config option)
* @todo (though I'm not sure they need to be turned off anymore
* - there just won't be anyone in those categories)
* I guess it serves as an example and a placeholder for this
* config option
* @see $g_default_notify_flags
* @global array $g_notify_flags
*/
$g_notify_flags['new'] = array(
'bugnotes' => OFF,
'monitor' => OFF
);

$g_notify_flags['monitor'] = array(
'reporter' => OFF,
'handler' => OFF,
'monitor' => OFF,
'bugnotes' => OFF,
'explicit' => ON,
'threshold_min' => NOBODY,
'threshold_max' => NOBODY
);

/**
* Whether user's should receive emails for their own actions
* @global integer $g_email_receive_own
*/
$g_email_receive_own = OFF;

/**
* Email addresses validation
*
* Determines whether email addresses are validated.
* - When ON (default), validation is performed using the pattern given by the
* HTML5 specification for 'email' type form input elements
* {@link http://www.w3.org/TR/html5/forms.html#v ... il-address}
* - When OFF, validation is disabled.
*
* NOTE: Regardless of how this option is set, validation is never performed
* when using LDAP email (i.e. when $g_use_ldap_email = ON), as we assume that
* it is handled by the directory.
* @see $g_use_ldap_email
*
* @global integer $g_validate_email
*/
$g_validate_email = OFF;

/**
* Enable support for logging in by email and password, in addition to
* username and password. This will only work as long as there is a single
* user with the specified email address and the email address is not blank.
*
* @global integer $g_email_login_enabled
*/
$g_email_login_enabled = OFF;

/**
* Ensure that email addresses are unique.
*
* @global integer $g_email_ensure_unique
*/
$g_email_ensure_unique = ON;

/**
* set to OFF to disable email check
* @global integer $g_check_mx_record
*/
$g_check_mx_record = OFF;

/**
* if ON, allow the user to omit an email field
* note if you allow users to create their own accounts, they
* must specify an email at that point, no matter what the value
* of this option is. Otherwise they would not get their passwords.
* @global integer $g_allow_blank_email
*/
$g_allow_blank_email = OFF;

/**
* Only allow and send email to addresses in the given domain(s)
* For example:
* $g_limit_email_domains = array( 'users.sourceforge.net', 'sourceforge.net' );
* @global array $g_limit_email_domains
*/
$g_limit_email_domains = array();

/**
* This specifies the access level that is needed to get the mailto: links.
* @global integer $g_show_user_email_threshold
*/
$g_show_user_email_threshold = NOBODY;

/**
* This specifies the access level that is needed to see realnames on user view
* page
* @see $g_show_realname
* @global integer $g_show_user_realname_threshold
*/
$g_show_user_realname_threshold = NOBODY;

/**
* select the method to mail by:
* PHPMAILER_METHOD_MAIL - mail()
* PHPMAILER_METHOD_SENDMAIL - sendmail
* PHPMAILER_METHOD_SMTP - SMTP
* @global integer $g_phpMailer_method
*/
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;

/**
* Remote SMTP Host(s)
* Either a single hostname or multiple semicolon-delimited hostnames.
* You can specify for each host a port other than the default, using format:
* [hostname:port] (e.g. "smtp1.example.com:25;smtp2.example.com").
* Hosts will be tried in the given order.
* NOTE: This is only used with PHPMAILER_METHOD_SMTP.
* @see $g_smtp_port
* @global string $g_smtp_host
*/
$g_smtp_host = 'smtp-pulse.com';

/**
* SMTP Server Authentication user
* NOTE: must be set to '' if the SMTP host does not require authentication.
* @see $g_smtp_password
* @global string $g_smtp_username
*/
$g_smtp_username = 's***-**n@openmedpractice.com';

$g_administrator_email = 's***-**n@openmedpractice.com';
/**
* SMTP Server Authentication password
* Not used when $g_smtp_username = ''
* @see $g_smtp_username
* @global string $g_smtp_password
*/
$g_smtp_password = '***********A*********';

/**
* Allow secure connection to the SMTP server
* Valid values are '' (no encryption), 'ssl' or 'tls'
* @global string $g_smtp_connection_mode
*/
$g_smtp_connection_mode = 'tls';

/**
* Default SMTP port
* Typical ports are 25 and 587.
* This can be overridden individually for specific hosts.
* @see $g_smtp_host
* @global integer $g_smtp_port
*/
$g_smtp_port = 2525;

/**
* Enable DomainKeys Identified Mail (DKIM) Signatures (rfc6376)
* To successfully sign mails you need to enable DKIM and provide at least:
* - DKIM domain
* - DKIM private key or key file path
* - DKIM selector
* - DKIM identity
* @see $g_email_dkim_domain
* @see $g_email_dkim_private_key_file_path
* @see $g_email_dkim_private_key_string
* @see $g_email_dkim_selector
* @see $g_email_dkim_identity
* @global integer $g_email_dkim_enable
*/
$g_email_dkim_enable = OFF;

/**
* DomainKeys Identified Mail (DKIM) Signatures domain
* This is usually the same as the domain of your from email
* @see $g_from_email
* @see $g_email_dkim_enable
* @global string $g_email_dkim_domain
*/
$g_email_dkim_domain = 'openmedpractice.com';

/**
* DomainKeys Identified Mail (DKIM) Signatures private key path
* Path to the private key. If $g_email_dkim_private_key_string is specified
* this setting will not be used.
* @see $g_email_dkim_private_key_string
* @see $g_email_dkim_enable
* @global string $g_email_dkim_private_key_file_path
*/
$g_email_dkim_private_key_file_path = 'mantisbt-2.15.0/config/dkim_private_key.txt';


/**
* DomainKeys Identified Mail (DKIM) Signatures private key value
* This string should contain private key for signing. Leave empty
* string if you wish to load the key from the file defined with
* $g_email_dkim_private_key_file_path.
* @see $g_email_dkim_enable
* @see $g_email_dkim_private_key_file_path
* @global string $g_email_dkim_private_key_string
*/
$g_email_dkim_private_key_string = '';

/**
* DomainKeys Identified Mail (DKIM) Signatures selector
* DNS selector for the signature (rfc6376)
* DNS TXT field should have for instance:
* host mail.example._domainkey
* value v=DKIM1; t=s; n=core; k=rsa; p=[public key]
* @see $g_email_dkim_enable
* @global string $g_email_dkim_selector
*/
$g_email_dkim_selector = '1528920879.openmedpractice._domainkey';

/**
* DomainKeys Identified Mail (DKIM) Signatures private key password
* Leave empty string if your private key does not have password
* @see $g_email_dkim_enable
* @global string $g_email_dkim_passphrase
*/
$g_email_dkim_passphrase = '';

/**
* DomainKeys Identified Mail (DKIM) Signatures identity
* Identity you are signing the mails with (rfc6376)
* This is usually the same as your from email
* @see $g_from_email
* @see $g_email_dkim_enable
* @global string $g_email_dkim_identity
*/
$g_email_dkim_identity = 'noreply@openmedpractice.com';

/**
* It is recommended to use a cronjob or a scheduler task to send emails. The
* cronjob should typically run every 5 minutes. If no cronjob is used,then
* user will have to wait for emails to be sent after performing an action
* which triggers notifications. This slows user performance.
* @global integer $g_email_send_using_cronjob
*/
$g_email_send_using_cronjob = ON;

/**
* email separator and padding
* @global string $g_email_separator1
*/
$g_email_separator1 = str_pad('', 70, '=');
/**
* email separator and padding
* @global string $g_email_separator2
*/
$g_email_separator2 = str_pad('', 70, '-');
/**
* email separator and padding
* @global integer $g_email_padding_length
*/
$g_email_padding_length = 28;

/**
* Duration (in days) to retry failed emails before deleting them from queue.
* @global integer $g_email_retry_in_days
*/
$g_email_retry_in_days = 7;

$g_debug_email = ON;

$g_log_level = LOG_EMAIL;

//$g_log_destination = '';
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

I configured and executed the smtp_check.php file in the phpmail/example folder and these are the results. So this part works.

2018-11-12 23:57:54 Connection: opening to smtp-pulse.com:2525, timeout=30, options=array ( ) 2018-11-12 23:57:54

Connection: opened 2018-11-12 23:57:54 SERVER -> CLIENT: 220 smtp-pulse.com

ESMTP SendPulse SMTP Server 2018-11-12 23:57:54 CLIENT -> SERVER: EHLO WIN-H9ONBE9S18B 2018-11-12 23:57:54

SERVER -> CLIENT: 250-smtp-pulse.com Nice to meet you, [100.4.78.63] 250-PIPELINING 250-8BITMIME 250-SMTPUTF8 250 AUTH PLAIN LOGIN 2018-11-12 23:57:54

CLIENT -> SERVER: AUTH LOGIN 2018-11-12 23:57:54

SERVER -> CLIENT: 334 VXNlcm5hbWU6 2018-11-12 23:57:54

CLIENT -> SERVER: c2hlcndpbkBvcGVubWVkcHJhY3RpY2UuY29t 2018-11-12 23:57:54

SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2018-11-12 23:57:54 CLIENT ->

SERVER: QU5lUlNQVGVjQjVKY0o0 2018-11-12 23:57:54

SERVER -> CLIENT: 235 Authentication successful Connected ok!2018-11-12 23:57:54

CLIENT -> SERVER: QUIT 2018-11-12 23:57:54

SERVER -> CLIENT: 221 Bye 2018-11-12 23:57:54 Connection: closed
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

Tried sending a test message.

I go this error.

2018-11-13 00:06:23 SERVER -> CLIENT: 220 smtp-pulse.com ESMTP SendPulse SMTP Server
2018-11-13 00:06:23 CLIENT -> SERVER: EHLO omp.openmedpractice.com
2018-11-13 00:06:23 SERVER -> CLIENT: 250-smtp-pulse.com Nice to meet you, [100.4.78.63]250-PIPELINING250-8BITMIME250-SMTPUTF8250 AUTH PLAIN LOGIN
2018-11-13 00:06:23 CLIENT -> SERVER: AUTH LOGIN
2018-11-13 00:06:23 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2018-11-13 00:06:23 CLIENT -> SERVER: c2hlcndpbkBvcGVubWVkcHJhY3RpY2UuY29t
2018-11-13 00:06:23 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2018-11-13 00:06:23 CLIENT -> SERVER: QU5lUlNQVGVjQjVKY0o0
2018-11-13 00:06:23 SERVER -> CLIENT: 235 Authentication successful
2018-11-13 00:06:23 CLIENT -> SERVER: MAIL FROM:<sherwin@openmedpractice.com>
2018-11-13 00:06:24 SERVER -> CLIENT: 554 5.9.2 Sender domain is not valid.
2018-11-13 00:06:24 SMTP ERROR: MAIL FROM command failed: 554 5.9.2 Sender domain is not valid.
The following From address failed: sherwin@openmedpractice.com : MAIL FROM command failed,Sender domain is not valid.,554,5.9.2SMTP server error: MAIL FROM command failed Detail: Sender domain is not valid. SMTP code: 554 Additional SMTP info: 5.9.2
Mailer Error: The following From address failed: sherwin@openmedpractice.com : MAIL FROM command failed,Sender domain is not valid. ,554,5.9.2SMTP server error: MAIL FROM command failed Detail: Sender domain is not valid. SMTP code: 554 Additional SMTP info: 5.9.2SMTP server error: MAIL FROM command failed Detail: Sender domain is not valid. SMTP code: 554 Additional SMTP info: 5.9.22018-11-13 00:06:24 CLIENT -> SERVER: QUIT
2018-11-13 00:06:24 SERVER -> CLIENT: 221 Bye
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

The last post error that I have gotten is because the SMTP provider has not approved my account yet to send emails.

So, it is performing the way it is supposed to perform.

But would that cause the error in Mantis?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Log shows invalid email address

Post by atrol »

You have set

Code: Select all

$g_debug_email = ON;
You have to set it to a valid email address if you want to use it for diagnostic purposes.
All e-mails are sent to this address instead of the original recipients if it is set to any non blank value.

ON is a defined constant that is set to 1, which explains the error message.
Please use Search before posting and read the Manual
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

Thank you,

I am using all valid email addresses.
I turned off the debug and tried to send test message and the error returned in the log file is
[13-Nov-2018 12:30:23 UTC] 2018-11-13 12:30 UTC MAIL email_api.php:1401 email_send() ERROR: Message could not be sent - SMTP Error: Could not connect to SMTP host.

This is the correct response as in my last message the SMTP provider has not approved my account to send mail.

Appreciate your patience.
juggernautsei
Posts: 8
Joined: 13 Jun 2018, 21:02

Re: Log shows invalid email address

Post by juggernautsei »

SOLVED

//$g_smtp_connection_mode = 'tls';

This line was the problem for me.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Log shows invalid email address

Post by atrol »

Not sure, maybe the tls problem is caused by an invalid certificate.
There where some changes and discussions around this some while ago
https://www.mantisbt.org/bugs/view.php?id=21293#c53614
Please use Search before posting and read the Manual
Post Reply