reverse proxy imap

vicosoft at gmail.com vicosoft at gmail.com
Wed Feb 9 13:50:50 MSK 2011


Imap works reverse proxy on port 143 successfully. With this setting.

File -> mailauth.pm:

package mailauth;
use nginx;

sub handler {
    my $r = shift;
    $r->header_out("Auth-Status", "OK");
    $r->header_out("Auth-Server", '172.18.1.9');
    $r->header_out("Auth-Port", '143');
    $r->send_http_header("Auth Plain", "text/html");
#    warn 'H: ',$r->remote_addr;
    return OK;
}
1;


But I'm not clear how to do work against the SSL port 993. I generate
certificates in the proxy server or Lotus Domino server? I have no idea.
Help.

---
Jose Antonio Vico Palomino
E-Mail: vicosoft at gmail.com

Visita mi Blogs:
    http://www.vicosoft.org/blog/
    http://www.mobileme.es
    http://www.manchegox.org
    http://www.todosconsoftwarelibre.es
    http://www.caminodesantiago.vicosoft.org

Facebook: http://www.facebook.com/Quijote
Twitter: http://twitter.com/vicosoft

Skype: vicosoft
Google Talk: vicosoft at gmail.com





2011/2/9 vicosoft at gmail.com <vicosoft at gmail.com>

> Someone has set up a reverse proxy imap, you connect to a Lotus Domino
> server on port 993? It is the typical question, but could send the
> configuration files? It would help me a lot to understand how to configure
> it. Thanks.
>
> I installed nginx from the Fedora repository, version is 0.8.53.
>
> My nginx.conf:
>
>
> user              nginx;
> worker_processes  1;
> error_log  /var/log/nginx/error.log info;
> pid        /var/run/nginx.pid;
>
> events {
>     worker_connections  1024;
>     multi_accept on;
> }
>
>
> mail {
>         auth_http localhost:80;
>         auth_http_timeout 6000;
>         imap_auth plain;
>         imap_capabilities  "IMAP4rev1"  "UIDPLUS";
>
>     server {
>         listen     993;
>         protocol   imap;
>         proxy      on;
>     }
>
> }
>
> http {
>         include mime.types;
>         default_type application/octet-stream;
>         perl_modules lib/perl5;
>         perl_require mailauth.pm;
>
>         sendfile on;
>
>         keepalive_timeout 65;
>
>         server {
>                 listen 80;
>                 server_name localhost;
>                 location /auth {
>                  perl mailauth::handler;
>                 }
>         location / {
>                 root html;
>                 index index.html index.htm;
>                 }
>         error_page 500 502 503 504 /50x.html;
>         location = /50x.html {
>                 root html;
>                 }
>         }
> }
>
>
>
> The mailauth.pm  (is in /usr/lib/perl5/ )
>
> package mailauth;
> use nginx;
>
> our $auth_ok;
> our $mail_server_ip={"172.18.1.9"};
> our $protocol_ports={};
> $domino="172.18.1.9";
> $protocol_ports->{'imap'}=993;
>
> sub handler {
> my $r=shift;
> $auth_ok=1;
> if ($auth_ok==1){
> $r->header_out("Auth-Status", "OK");
> $r->header_out("Auth-Server", $domino);
> $r->header_out("Auth-Port",
> $protocol_ports->{$r->header_in("Auth-Protocol")});
> $r->header_out("Auth Plain",$r->header_in("Auth Plain"));
> } else {
> $r->header_out("Auth-Status", "Invalid login or password") ;
> }
>
> $r->send_http_header("text/html");
>
> return OK;
> }
>
> 1;
>
> Thanks!
>
>
> ---
> Jose Antonio Vico Palomino
> E-Mail: vicosoft at gmail.com
>
> Visita mi Blogs:
>     http://www.vicosoft.org/blog/
>     http://www.mobileme.es
>     http://www.manchegox.org
>     http://www.todosconsoftwarelibre.es
>     http://www.caminodesantiago.vicosoft.org
>
> Facebook: http://www.facebook.com/Quijote
> Twitter: http://twitter.com/vicosoft
>
> Skype: vicosoft
> Google Talk: vicosoft at gmail.com
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110209/ca1aae8e/attachment-0001.html>


More information about the nginx mailing list