GNOME Bugzilla – Bug 503954
Google Calendar plugin won't accept non gmail usernames
Last modified: 2013-09-13 00:57:15 UTC
Please describe the problem: Currently, the google calender plugin (google-account-setup) only accepts usernames ending in @gmail.com. However, google calender has the option to use a custom domain name (via google apps), so usernames @ any domain should be accepted. Entering user@domain.com in the plugin setup currently results in the incorrect username user@domain.com@gmail.com being saved. I believe the best way to fix this is to modify plugins/google-account-seutp/google-source.c, and change line 186-188 from: if (!g_str_has_suffix (user, "gmail.com\0")) { user = g_strconcat (user, "@gmail.com", NULL); } to instead check if the username already contains any valid domain suffix, and if not, then apply the @gmail.com suffix. Steps to reproduce: 1. Add a new google calender with the username "user@domain.com" Actual results: The username is incorrectly saved as "user@domain.com@gmail.com" Expected results: Username should be saved as "user@domain.com" Does this happen every time? Yes Other information:
hi nyall, thanks for the report. interested in providing a patch and attaching it here?
Honestly, I've tried, back my c/regular expressions skills aren't up to scratch, so I'm not sure the most elegant way to replace g_str_has_suffix (user, "gmail.com\0") with a generic email-validation function would be. If someone can help me out with this I'd be happy to submit a patch :)
hmm, i don't expect regex magic here, i think the email account creation code in evolution also only parses for a "@". proposal: if there's no "@" in the text entered, then append @gmail.com, if not, then not. :-) (just my two cents, i'm not a developer.)
Ok, here's a patch. It uses the same is_email function from /mail/em-account-editor.c
Created attachment 101234 [details] [review] patch for incorrect handling of google calendar usernames
Nyall, It looks fine. Just attach patches here after with ChangeLogs. Approved to commit. (If you don't have commit rights, we would commit it during the release)
No commit rights sorry - I'll leave it in your hands :) Thanks for the assistance!!
Patch committed to SVN trunk as r34732 (http://svn.gnome.org/viewvc/evolution?view=revision&revision=34732)
Thanks for committing this. I've also posted what is essentially "part 2" of this issue in http://bugzilla.gnome.org/show_bug.cgi?id=504783 It's a small change needed in e-d-s, to the auth string in servers/google/libgdata-google/gdata-google-service.c This fixes some remaining authentication issues with custom domains. I'd appreciate it if you could take a quick look at that patch too!
*** Bug 506580 has been marked as a duplicate of this bug. ***