helloray / android-sms

Automatically exported from code.google.com/p/android-sms
0 stars 0 forks source link

When only a username is supplied append @gmail.com #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. enter your Google-account username without @gmail.com
2. start making a backup
3.

What is the expected output? What do you see instead?
the SMS created in Gmail of SMS that are send to me are send by "username" 
instead of "username@gmail.com". GMail will not replace the username with 
"Me" in the webinterface because it doesn't recognize the username.

What version of the product are you using? On what operating system?
1.0.0

Workaround is to manually add @gmail.com and backup again.

Original issue reported on code.google.com by balloob on 26 Jan 2009 at 9:53

GoogleCodeExporter commented 9 years ago
I was not aware that the IMAP server actually accepts just the username part as 
a 
login.

I'll try to fix this in the next version.

Original comment by chstu...@gmail.com on 26 Jan 2009 at 10:00

GoogleCodeExporter commented 9 years ago
I've done some testing.  Logins work with any combination of

 - username@gmail.com
 - username@googlemail.com
 - username

I've attached a small patch that adds @gmail.com when saving a login that does 
not
contain a domain.

The issue is complicated by the @googlemail.com - perhaps it's best to simply 
require
the user to enter their login+domain?

Original comment by joel.s...@gmail.com on 1 Feb 2009 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago
Hmm, the last attachment was wrong.  Try this one instead.

(also, CursorToMessage has a private method isGmailAddress.  If we could use 
this
from SmsSync that would be handy).

diff --git a/android-client/src/tv/studer/smssync/SmsSync.java
b/android-client/src/tv/studer/smssync/SmsSync.java
index 09a8958..92bf8de 100755
--- a/android-client/src/tv/studer/smssync/SmsSync.java
+++ b/android-client/src/tv/studer/smssync/SmsSync.java
@@ -172,6 +172,12 @@ public class SmsSync extends PreferenceActivity implements
OnPreferenceChangeLis
         SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
         String username = prefs.getString(PrefStore.PREF_LOGIN_USER,
                 getString(R.string.ui_login_label));
+
+               // Logins do not need the domain part of the address, but 
without it
+               // gmail will not recognise the from/to field to be the user.
+               if (!username.endsWith("@gmail.com") ||
!username.endsWith("@googlemail.com"))
+                       username += "@gmail.com";
+
         Preference pref =
getPreferenceManager().findPreference(PrefStore.PREF_LOGIN_USER);
         pref.setTitle(username);
     }

Original comment by joel.s...@gmail.com on 1 Feb 2009 at 6:14

GoogleCodeExporter commented 9 years ago
Thanks for your patches, Joel!

gmail.com and googlemail.com are not enough to test for, though, as Google Apps 
users 
can use arbitrary domains with their Gmail accounts. I think we'd rather 
enforce 
entering an e-mail address than appending @gmail.com. What do you think?

Original comment by chstu...@gmail.com on 1 Feb 2009 at 9:45

GoogleCodeExporter commented 9 years ago
Sorry, just noticed now that your patch exactly does what the title of the bug 
describes. Still, I think we should rather do what's described in my last 
comment.

Original comment by chstu...@gmail.com on 1 Feb 2009 at 9:48

GoogleCodeExporter commented 9 years ago
I agree with what you said in comment 4 as there's no obvious way to append the
correct domain for all users.

Original comment by joel.s...@gmail.com on 1 Feb 2009 at 9:58

GoogleCodeExporter commented 9 years ago
I agree this should enforce full email address login.

On the same note, maybe the wording should be made more clear to the user, 
letting them 
know that domain is required.

And maybe change the status of this to 'Won't Fix' so other users know.

Original comment by reukiodo on 4 Dec 2009 at 10:32