We have email parsing running successfully. However, when a bug is updated via email, the note that is added to the bug does not include any information regarding who sent the email, and displays as "Mail (reporter)". (Reporter being the security level that Mail is set to.)
My question is: is there anyway to grab the sender from the header information of the email and have it be placed in the body of the email so that when the note is added to the bug we know who sent the email update?
Thanks.
Provider header information from emails
Moderators: Developer, Contributor
Re: Provider header information from emails
try setting
$g_mail_save_from = ON;
It gave me a line at the top of the issue Description like:-
Report from: "aaaaaa" <username@aaaaaa.xxx.yyy.zzz.com>
not great you could alter it in mail_api.php.
Nick
$g_mail_save_from = ON;
It gave me a line at the top of the issue Description like:-
Report from: "aaaaaa" <username@aaaaaa.xxx.yyy.zzz.com>
not great you could alter it in mail_api.php.
Nick
Re: Provider header information from emails
Thanks for the response.
It appears that $g_mail_save_from = ON; is already set in our system. I looked at little deeper and found this in mail_api.php:
Does each incoming message run through this code? (If yes, where do I look to see what $t_mail_user_reporter is set to?)
It appears that $g_mail_save_from = ON; is already set in our system. I looked at little deeper and found this in mail_api.php:
Code: Select all
if ( $t_mail_use_reporter ) {
// Always report as mail_reporter
$t_reporter_id = user_get_id_by_name( $t_mail_reporter );
$t_reporter = $t_mail_reporter;
} else {
// Try to get the reporting users id
$t_reporter_id = user_get_id_by_mail ( $v_mailaddress );
echo 'Reporter: ' . $t_reporter_id;
...
Re: Provider header information from emails
$t_mail_user_reporter is set at the top of function mail_get_user:-
This function is called in function mail_add_bug:-
Looking at the code in function mail_get_user, you will either have to set $g_mail_auto_signup = ON, or
the sending email address will have to already have to be a mantis user for this to work.
Nick
Code: Select all
# return the user id for the mail reporting user
function mail_get_user ($p_mailaddress) {
$t_mail_use_reporter = config_get( 'mail_use_reporter' );
$t_mail_auto_signup = config_get( 'mail_auto_signup' );
$t_mail_reporter = config_get( 'mail_reporter' );
Code: Select all
$t_bug_data->project_id = $p_account['id'];
$t_bug_data->reporter_id = mail_get_user( $p_mail['From'] );
if ( mail_is_a_bugnote( $p_mail['Subject'] ) ) {
# Add a bug note
the sending email address will have to already have to be a mantis user for this to work.
Nick