&gt added to all email addresses

Moderator: crythias

Locked
mmcdonald
Znuny newbie
Posts: 5
Joined: 22 Dec 2014, 14:35
Znuny Version: 4free
Real Name: Michael

&gt added to all email addresses

Post by mmcdonald »

OTRS postmaster is currently adding &gt (The greater than HTML entity) to the email address of the sender, so no automated emails or replies are sending successfully. Please see below:

Image

I haven't touched the source yet so I'm not sure how this had occurred. Can someone with previous OTRS experience tell me where this function, the collecting of the senders email, is carried out, so that I may try to find the offending line and fix it?

In the meantime I'll be hunting through.

Many thanks and happy new year,
Michael
Rooobaaat
Znuny wizard
Posts: 432
Joined: 11 Sep 2014, 16:28
Znuny Version: OTRS 5.0.x

Re: &gt added to all email addresses

Post by Rooobaaat »

Could be a charset issue in the db.
What does the output of your Service Center say?
My english is better than your german :P

"Produktiv": OTRS: 5.0.x, OTRS::ITSM 5.0.x
"Testing": OTRS 6 git
OS: Debian 8.0 (Jessie)
Apache2.4.10/MySQL 5.5.41
mmcdonald
Znuny newbie
Posts: 5
Joined: 22 Dec 2014, 14:35
Znuny Version: 4free
Real Name: Michael

Re: &gt added to all email addresses

Post by mmcdonald »

Thanks for the reply!

The only issue there is 'the setting 'max_allowed_packet' must be higher than 20 MB'. It's currently 16MB. I just haven't got around to changing that yet but can't believe it could be causing this issue in a million years.

Here's what the log there states:

Code: Select all

Impossible to send message to: Sophie Strong <alias1@email.co.uk> .
Can't send to 'Sophie': 5015.1.3 Invalid address
Impossible to send message to: Michael McDonald <alias2@email.co.uk> .
Can't send to 'Michael': 5015.1.3 Invalid address
Impossible to send message to: Michael McDonald <alias2@email.co.uk> .
Can't send to 'Michael': 5015.1.3 Invalid address
Rooobaaat
Znuny wizard
Posts: 432
Joined: 11 Sep 2014, 16:28
Znuny Version: OTRS 5.0.x

Re: &gt added to all email addresses

Post by Rooobaaat »

'<' and '>' are '<' and '>'

what email-address is configured for this customer?
My english is better than your german :P

"Produktiv": OTRS: 5.0.x, OTRS::ITSM 5.0.x
"Testing": OTRS 6 git
OS: Debian 8.0 (Jessie)
Apache2.4.10/MySQL 5.5.41
mmcdonald
Znuny newbie
Posts: 5
Joined: 22 Dec 2014, 14:35
Znuny Version: 4free
Real Name: Michael

Re: &gt added to all email addresses

Post by mmcdonald »

I knew what the &gt and &lt HTML entities were :)

I don't want to post the email addresses for obvious reasons, so I've masked them. Are you asking me to post the email addresses here or am I misreading your request? :?

Thanks for helping though, very much appreciated!
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: &gt added to all email addresses

Post by reneeb »

There was a similar thread recently. And I thought I have seen a patch on github, but I wasn't able to find it now. I'll have a look later...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
mmcdonald
Znuny newbie
Posts: 5
Joined: 22 Dec 2014, 14:35
Znuny Version: 4free
Real Name: Michael

Re: &gt added to all email addresses

Post by mmcdonald »

Oh excellent - I'll take a look around there and see if I can find anything useful, thanks!
henriqg
Znuny newbie
Posts: 6
Joined: 09 Jan 2015, 13:39
Znuny Version: OTRS 4

Re: &gt added to all email addresses

Post by henriqg »

I was having the same problem when a ticket was created via email.
When OTRS tried to send an email to the ticket owner/creator on an event, like ticket state update, the email failed. It tried to send a message to FirstName LastName <first.last@example.org> instead of FirstName LastName <first.last@example.org>.

To fix the "issue" I've edited Kernel/System/Ticket/Article.pm at the begining of sub ArticleSend { (around line 2500) and replaced the entities by it's character (something like:

Code: Select all

my $new = $Param{To} =~ s/</</r;
(this only replaces <, you should improve the regex to replace both < and >))

I'm curious if this is a bug or it's a misconfiguration.
OmarHermannsson
Znuny newbie
Posts: 2
Joined: 02 Feb 2015, 12:02
Znuny Version: 4.0.5
Real Name: Omar Hermannsson
Company: RVX

Re: &gt added to all email addresses

Post by OmarHermannsson »

This was happening with my install as well. After seeing the suggestion from Henriqg, I made the following changes to the Article.pm and it seems to be working now.

Code: Select all

    my $ToOrig      = $Param{To}          || '';
    $ToOrig =~ s/>/>/;
    $ToOrig =~ s/</</;
    $Param{To} = $ToOrig;
OmarHermannsson
Znuny newbie
Posts: 2
Joined: 02 Feb 2015, 12:02
Znuny Version: 4.0.5
Real Name: Omar Hermannsson
Company: RVX

Re: &gt added to all email addresses

Post by OmarHermannsson »

I found other errors due to html entities, this time it was "

So I reverted the earlier changes and made a different, more robust change to handle all html entities:

Code: Select all

use HTML::Entities ();

    my $decoded = HTML::Entities::decode($Param{To});
    $Param{To} = $decoded;
I'm new to OTRS so I'm not sure about where to file or look for bug reports but I thought this might be useful info for anybody else out there who is getting the same errors.
OmarHermannsson wrote:This was happening with my install as well. After seeing the suggestion from Henriqg, I made the following changes to the Article.pm and it seems to be working now.

Code: Select all

    my $ToOrig      = $Param{To}          || '';
    $ToOrig =~ s/>/>/;
    $ToOrig =~ s/</</;
    $Param{To} = $ToOrig;
Locked