On Tue, May 29, 2007 at 10:00:08AM +0200, Antonio Guirado Puerta wrote:
> you are right. This actions must be done but the problem keep. The
> problem is that when IMAP_PROXY
> is active the imap session will only be served if the attribute
> mailhost hit PROXY_HOSTNAME.
> Although the session, by changing the ip address, get the rigth
> server, this always makes proxy to
> the down server.
Sorry I misunderstood - I thought you had a separate layer of proxy servers.
In this case there would be no problem, because you would set IMAP_PROXY=1
on the "front end" servers (which handle only proxying), and IMAP_PROXY=0 on
the "back end" servers (which accept only incoming proxied connections)
OK, so what you're interested in is the function checkhostname() in
imap/proxy.c. At the moment it says:
if ((proxyhostname=getenv("PROXY_HOSTNAME")) != NULL)
if (strcmp(proxyhostname, host) == 0) //<<<<<<<<<< HERE
... normal login
...
if (gethostname(hostbuf, sizeof(hostbuf)))
...
if (strcmp(hostbuf, host) == 0)
... normal login
One solution for you is to ensure that the mailhost attribute matches the
system's real hostname (as returned by 'gethostname'), and then use
PROXY_HOSTNAME as the 'alias' for the failed machine. But that only allows
one failed machine.
Otherwise you should make a simple patch at the line marked <<<<<<< above,
so that PROXY_HOSTNAME can contain a comma-separated list, and the mailhost
can match against any of them.
As a quick hack, try changing that line to
if (strstr(proxyhostname, host))
which will just see if the mailhost matches anywhere as a substring within
the PROXY_HOSTNAME. This will be OK as long as none of your mailhost names
is a substring of any other (e.g. one host called "mail1" and another host
called "mail")
Regards,
Brian.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap