Re: [Httpmail-devel] Could not log in ...
Status: Beta
Brought to you by:
fuzz
From: <Joc...@AC...> - 2002-06-25 23:31:17
|
>>>>> "KW" == kenneth westelinck writes: KW> Hi all, KW> I was trying to use HTTPMail to receive mail from my hotmail account. KW> After getting the "Could not log in" error, KW> I started to nose around in the code KW> and added some output for the login method in HTTPMailClient.pm . I actually also added some output for the login method (pls tell me whether you find this useful): httpmail-0.3/perl/Mail/HTTPMailClient.pm $req->content($findinitfolders); + print '*** ',$req->as_string(),"\n" + if 0; + my $res = $self->{ua}->request($req); KW> The error returned by $res->error_as_HTML is the following: KW> Logging in as ken...@ho...... KW> <HTML> KW> <HEAD><TITLE>An Error Occurred</TITLE></HEAD> KW> <BODY> KW> <H1>An Error Occurred</H1> KW> 302 Redirect to partner. KW> </BODY> KW> </HTML> KW> Any ideas what's causing this error? KW> (BTW: I am behind a proxy and I have put the name and port for this proxy in KW> the http_proxy environment variable.) Does your proxy not need authorization?? Mine does, so my "login" now looks like (obviously, this is not the entire patch, but this is, what applies to "login"): ================================================================================ sub login { my $self = shift; ! ($self->{user}, $self->{passwd}, $self->{'Proxy-Authorization'}) = @_; $self->{ua} = new RequestAgent; $self->{ua}->cookie_jar(new HTTP::Cookies); $self->{ua}->set_user($self->{user}, $self->{passwd}); my $req = new HTTP::Request(PROPFIND => $self->{server}); + $req->header( 'Proxy-Authorization' => $self->{'Proxy-Authorization'} ) + if $self->{'Proxy-Authorization'}; $req->content_type("text/xml"); $req->content($findinitfolders); + print '*** ',$req->as_string(),"\n" + if 0; + my $res = $self->{ua}->request($req); return 0 if not $res->is_success; ================================================================================ KW> Thanks in advance for your help. Anybody else interested in the code applying to a proxy with authorization? Did you get any step further? Jochen Hayek |