#94 401 for hosted domains

Jan Jergus

For the last few months, checkgmail hasn't been working with any of my hosted domain accounts. (I tried with at least two different domains, always the same result.)

Output from checkgmail -v:

CheckGmail v1.14pre-svn
Copyright © 2005-7 Owen Marshall

Initialisation complete
Saved cookie: GALX

Saved cookie: GALX

Logging in to Gmail ...
Error: 401 Unauthorised

I looked through the code a bit, and found that it makes the following POST request: https://www.google.com/a/$hosted/LoginAction2|at=null&continue=http%3A%2F%2Fmail.google.com%2Fa%2F$hosted&service=mail&Email=$URI_user&Passwd=$URI_passwd

Simulating this request in Firefox (using Poster plugin to make the request using POST) returned a 200 OK + the login form, so it seems that this request is indeed wrong.

Perhaps some parameters are missing? I looked at the Google Apps login process in FireBug. The request to .../LoginAction2 is made with additional parameters, e.g. GALX, and a lot of cookies.

I'll gladly help with debugging this (I know my way around HTTP, and even Perl doesn't seem so hard from what I've seen today), however, I'd appreciate some guidance to help me understand what requests checkgmail makes and why.


  • Andrew Reid

    Andrew Reid - 2010-12-22

    Same thing happens for me (v1.14pre2-svn) on a hosted domain. Adding the "-no_cookies" argument makes it work, but with reduced functionality.

  • Jan Jergus

    Jan Jergus - 2010-12-22

    You can now make it work by migrating your domain to the new version of Google Apps. You can then log in to your hosted account as if it were a normal Gmail account (use the whole e-mail address as login). CheckGmail works fully when you configure it as a normal account, not a hosted account.


Log in to post a comment.