Bug 120890

Summary: KMail fails when @ is used in recipient's name
Product: [Applications] kmail Reporter: Diego Elio Pettenò <flameeyes>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bjoern, carlos-spam
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description Diego Elio Pettenò 2006-01-27 23:44:31 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Gentoo Packages
OS:                Linux

KMail disallow sending mails when the recipient's name contains an "@" character, thinking that is the address that contains two "@".

It's easy to reproduce, just try to send a mail setting the To field to "flameeyes\@gentoo.org" <flameeyes@gentoo.org> .

While it's rare to be done in actual mail's but it's unfortunately common for an italian webmail to set the default from value to the above example (with the real address of the sender, obviously), thus blocking on reply.
Comment 1 Diego Elio Pettenò 2006-01-30 01:25:14 UTC
Created attachment 14449 [details]
Proposed patch

Okay tonight I found some time and I wrote the attached patch, it's a rewrite
of the KPIM::isValidEmailAddress() function, replacing the stateful parser with
some regexps.
It doesn't seem to decrease performance noticeably, and it does not fail in the
situation it was failing before, and mails are sent fine.
Comment 2 Haris Kouzinopoulos 2006-03-30 21:51:22 UTC
*** Bug 124572 has been marked as a duplicate of this bug. ***
Comment 3 Haris Kouzinopoulos 2006-03-30 21:52:36 UTC
Hi, can someone please review this patch?
Comment 4 Ingo Klöcker 2006-04-01 00:49:34 UTC
Sorry, but your patch is not acceptable. If you want to know how a regular expression for checking the validity of RFC822 addresses looks like take a look at http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html. And no, we don't want to have this regular expression in KMail. Please try to fix the parser instead of trying to replace it by something else.
Comment 5 Björn Ruberg 2009-12-24 23:23:20 UTC
I checked with KDE 4.3. I can send a mail with "flameeyes@gentoo.org" <adress> , so I consider the main problem solved. I cannot send an mail like "flameeyes\@gentoo.org" <adress> , but that's a problem with the backslash.