Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 04-18-2006, 04:49 AM
dee dee is offline
Junior Member
 
Posts: 7
Default

OK - it was out of space. There was a 160M busted download in the /opt/zimbra/tmp folder.

Thanks for the help!
Reply With Quote
  #12 (permalink)  
Old 04-19-2006, 09:11 AM
Junior Member
 
Posts: 5
Default

Is there any known workaround to the ?redirect=0 requirement short of waiting until a new version comes out that supports configuring that behavior on the server end? Our 3.1 upgrade went smoothly except for this as well. This change in behavior was unexpected, so we were caught a bit flatfooted. Zimbra's httpd doesn't appear to have mod_rewrite installed, so I don't have that tool available to me. Otherwise, I'd just add the ?redirect=0 to every URL.

Regards,
Edwin
Reply With Quote
  #13 (permalink)  
Old 04-19-2006, 11:34 AM
Project Contributor
 
Posts: 136
Default Workaround for /?redirect=0

I found a workaround for ?redirect=0, quick and VERY dirty :-)

First the theory:

The files checking this variable (with code introduced in 3.1) are in JavaScript. Now the default is to redirect. To change the default to redirect=0 do:

su - zimbra
cd apache-tomcat-5.5.15/webapps/zimbra/js

There you will find the following files:

AjaxNewWindow_all.js
Ajax_all.js
zimbraMail/share/view/ZmLogin.js

In all three files you will see the following lines of codes (only once in each):

var match = location.search ? location.search.match(/\bredirect=([01])/) : null;
var redirect = match ? match[1] : null;

For the newbies, this means:
- check if 'redirect=[01]' is part of the location string (first line)
- if it is, set 'redirect' to its value, otherwise set it to null (second line)

To make it work, it is enough to change null by '0', that is:

var redirect = match ? match[1] : '0';

Now the implementation:

If you just change the *.js code it will not work, because Zimbra uses the compressed versions of Ajax_all.js and AjaxNewWindow_all.js, named with the suffix ".zgz". If you uncompress these files, you will see that they have been stripped of all // comments, most \n and empty lines. So, once you have identified the lines to change in the *.js files, do the following:

gunzip -S zgz Ajax_all.js.zgz

This generates the file "Ajax_all.js." (observe the final dot, useful to avoid scratching the original *.js).

Edit Ajax_all.js. and change null to '0'. Then compress it again with:

gzip -S zgz Ajax_all.js.

The same for AjaxNewWindow_all.js.zgz.

ZmLogin has no zgz.

Then restart tomcat (tomcat restart), and in your browser clean the cache and the cookies for your zimbra host.

Probably in the source code there is a script that converts the *.js -> *.js.zgz, but the manual method works fine and fixes the problem in 10 minutes :-))
Reply With Quote
  #14 (permalink)  
Old 04-19-2006, 11:01 PM
Senior Member
 
Posts: 56
Default

Great! It works. Thank you very much.

Thomas
Reply With Quote
  #15 (permalink)  
Old 04-20-2006, 08:51 PM
Starter Member
 
Posts: 2
Default

Quote:
Originally Posted by cvidal
I found a workaround for ?redirect=0, quick and VERY dirty :-)

Probably in the source code there is a script that converts the *.js -> *.js.zgz, but the manual method works fine and fixes the problem in 10 minutes :-))

Thanks for the hack, it is much appreciated and works fine for me.



I assume someone logged a bug?
Reply With Quote
  #16 (permalink)  
Old 04-27-2006, 08:12 PM
Active Member
 
Posts: 49
Default Admin Site?

I applied this and it works so far on the reguar web mail site. However, there is one problem on the admin site. When I select another account and then click on the "View Mail" button. A new web browser window is opened and tries to connect directly to the server, not the aliased name.

I tried the same hacks in the zimbraAdmin folder, but they didn't seem to work. Neither did using the ?redirect=0 option.

any help is appreciated.
Reply With Quote
  #17 (permalink)  
Old 04-28-2006, 12:34 AM
Zimbra Employee
 
Posts: 4,792
Default

Quote:
Originally Posted by cutigersfan
I applied this and it works so far on the reguar web mail site. However, there is one problem on the admin site. When I select another account and then click on the "View Mail" button. A new web browser window is opened and tries to connect directly to the server, not the aliased name.

I tried the same hacks in the zimbraAdmin folder, but they didn't seem to work. Neither did using the ?redirect=0 option.

any help is appreciated.
Seems like a bug. Please file it in bugzilla.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #18 (permalink)  
Old 07-23-2006, 06:04 PM
ljm ljm is offline
Project Contributor
 
Posts: 81
Default ?redirect=0 and https ?

?redirect=0 works fine for me for when connecting via http. But the analogous setup with https doesn't work.

This is the apache config on the external-facing web server:
ServerName zimbra-external.example.com:443
ProxyPassReverse / https://zimbra-internal.example.com/
RewriteEngine on
RewriteRule ^/(.*)$ https://zimbra-internal.example.com/$1 [P]

Typing https://zimbra-external.example.com/zimbra/?redirect=0 into the browser serves the login page. But when I enter the username+password, zimbra redirects to zimbra-internal.example.com which isn't visible from the outside world.

I wonder whether I could be doing something wrong. The wierd thing is that the analogous arrangements all work fine over http.

Looking at the SOAP messages which follow the login attempt, the AuthRequest message seems to be ok, but it is followed by this request:

POST https://zimbra-external.example.com:...th/?redirect=0 HTTP/1.1
Referer: https://zimbra-external.example.com/...rect=0&debug=1
Cookie: AjxDebugWinOpen=true; JSESSIONID=B4CAC6F9C8BCE7E1344C6250948FCDF0; ls_last_username=user; ls_last_server=zimbra-external.example.com

authToken=a-big-number&atl=172800000

and here is the response:

HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Cache-control: public, max-age=604800, post-check=7200, pre-check=604800
Set-Cookie: ZM_AUTH_TOKEN=a-big-number; Path=/
Location: https://zimbra-internal.example.com:...ail?redirect=0
Content-length: 0
Via: 1.1 zimbra-external.example.com
Reply With Quote
  #19 (permalink)  
Old 08-02-2006, 07:19 PM
Zimbra Employee
 
Posts: 4,792
Default

What if you try by IP address? Not sure why this would not work for the https.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #20 (permalink)  
Old 08-05-2006, 12:58 AM
ljm ljm is offline
Project Contributor
 
Posts: 81
Default https reverse proxy

After bit more poking around ... ?redirect=0 works as expected for me under both http and https when going browser <==> zimbra. It's only browser <==> reverse proxy <==> zimbra that I'm having trouble with https.

Given that my ?redirect=0 problem only relates to https and only with a reverse proxy involved, no doubt my problem relates to the reverse proxy configuration. I'm blowed if I can figure it out. Anyway, with that said...

Yes, even using an IP address in the RewriteRule and ProxyPassReverse lines, the server sends a 302 redirect.

The SOAP request outbound to the reverse proxy:
POST https://zimbra.example.com:443/zimbra/auth/?redirect=0 HTTP/1.1
Host: zimbra.example.com
Referer: https://zimbra.example.com/zimbra/?redirect=0
Cookie: JSESSIONID=2F06A8C02BBD9F40FB5725B75B8952D5; ls_last_username=foo; ls_last_server=zimbra.example.com
Content-length: 195
X-Forwarded-For: 192.168.22.2

authToken=a-big-number

The ssl.conf doing the reverse proxy:
ProxyPassReverse / https://192.168.5.10/
RewriteRule ^/(.*)$ https://192.168.5.10/$1 [P]

The SOAP response from zimbra, coming back via the reverse proxy - note the ip address in the Location header:
HTTP/1.1 302 Moved Temporarily
Date: Sat, 05 Aug 2006 06:29:18 GMT
Server: Apache-Coyote/1.1
Expires: Sat, 12 Aug 2006 06:26:13 GMT
Cache-control: public, max-age=604800, post-check=7200, pre-check=604800
Set-Cookie: ZM_AUTH_TOKEN=a-big-number
Path=/
Location: https://192.168.5.10:443/zimbra/mail?redirect=0
Content-length: 0
Via: 1.1 zimbra.example.com
Content-Type: text/plain
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.