Bug 98720 - Check validity recipient addresses before sending mail
Summary: Check validity recipient addresses before sending mail
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-06 21:06 UTC by Dik Takken
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dik Takken 2005-02-06 21:06:57 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Gentoo Packages
OS:                Linux

Mail servers with some ISP's refuse to accept mail messages that contain invalid email addresses. I don't mean non-existing mail addresses but invalid ones, like "mailto:@mydomain".

The problem is that these servers tend to return cryptic error messages or provide them only in english. Not all users can read english well enough to understand what the problem is.

KMail might me able to perform a quick sanity check on the addresses in the to, cc and bcc fields and warn the user that a particular address might be incorrect or may even be refused by the ISP. It would save the user a lot of confusion.
Comment 1 Matt Douhan 2005-03-11 22:04:36 UTC
CVS commit by mdouhan: 

Update the validator to disallow foo:@mydomain try and help the user
a bit to not make mistakes and get weird and wonderful SMTP error msgs

BUG:98720


  M +7 -0      email.cpp   1.27
  M +2 -1      email.h   1.12


--- kdepim/libemailfunctions/email.cpp  #1.26:1.27
@@ -321,4 +321,8 @@ KPIM::EmailParseResult KPIM::isValidEmai
           }
           break;
+        case ':' :
+          if ( !inQuotedString ) {
+            return DisallowedChar;
+          }
         case '<' :
           if ( !inQuotedString ) {
@@ -467,4 +471,7 @@ QString KPIM::emailParseResultToString( 
                   "does not seem to contain an actual email address, i.e. "
                   "something of the form joe@kde.org.");
+    case DisallowedChar :
+      return i18n("The email address you entered is not valid because it "
+                  "contains an illegal character.");
   }
   return i18n("Unknown problem with email address");

--- kdepim/libemailfunctions/email.h  #1.11:1.12
@@ -47,5 +47,6 @@ enum EmailParseResult { AddressOk, Addre
                         TooManyAts, UnexpectedComma,
                         TooFewAts, MissingLocalPart,
-                        UnbalancedQuote, NoAddressSpec };
+                        UnbalancedQuote, NoAddressSpec,
+                        DisallowedChar };
 
 // Helper functions
Comment 2 Dik Takken 2005-03-12 11:25:29 UTC
> i18n("The email address you entered ....

Which address? Would it be possible to actually tell the user which address the message is referring to? In case you have a subtle typing error in a whole bunch of recipient addresses it's not very convenient if you have to go and search for mistakes.
Comment 3 Matt Douhan 2005-03-12 11:28:05 UTC
That is exactly what happens, in the msgbox that appears the offending email address is shown in bold so that you can edit that single address and do not have to look through all your addresses.
Comment 4 Dik Takken 2005-03-12 11:30:57 UTC
Wow, that's perfect. Thanks!
Comment 5 Chris Samuel 2007-07-13 01:43:47 UTC
This patch introduces a bug (118284) which prevents valid RFC 2822 group addresses from working, e.g.

Committee List: foo@bar.org, bar@baz.com;

That whole line is a valid group address according to section 3.4 "Address Specification", defined as:

group           =       display-name ":" [mailbox-list / CFWS] ";"

It would be nice if Kmail/Kontact was RFC 2822 compliant..