Fw: Re: How to configure Nginx as IMAP/POP3 reverse proxy - IBM Lotus Domino Server

Sorry, should be problem with SMTP and not IMAP

— On Wed, 9/29/10, Juliana T. [email protected] wrote:

From: Juliana T. [email protected]
Subject: Re: How to configure Nginx as IMAP/POP3 reverse proxy - IBM
Lotus Domino Server
To: [email protected]
Date: Wednesday, September 29, 2010, 12:19 AM

Hi…
Â
Now the POP3 already running.
But still have problem with SMTP
Â
nginx.conf
Â
user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
error_log /usr/local/nginx/logs/error.log;
#pid logs/nginx.pid;
pid /usr/local/nginx/logs/nginx.pid;
 
events {
worker_connections 1024;
multi_accept on;
}
mail {
auth_http 127.0.0.1:80/auth;
auth_http_timeout 6000;
smtp_auth plain;
pop3_auth plain;
imap_auth plain;
pop3_capabilities “TOP” “USER”;
imap_capabilities “IMAP4rev1” “UIDPLUS”;
 
server {
listen 110;
protocol pop3;
proxy on;
}
server {
listen 143;
protocol imap;
proxy on;
}

server {
listen 25;
protocol smtp;
proxy on;
}
}
http {
include mime.types;
default_type application/octet-stream;
perl_modules perl/lib;
perl_require mailauth.pm;
#log_format main '$remote_addr - $remote_user [$time_local] “$request” ’

'$status $body_bytes_sent “$http_referer” ’

‘“$http_user_agent” “$http_x_forwarded_for”’;

#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#location /auth {
location /auth {
perl mailauth::handler;
}
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;

redirect server error pages to the static page /50x.html

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

proxy the PHP scripts to Apache listening on 127.0.0.1:80

#location ~ .php$ {

proxy_pass http://127.0.0.1;

#}

pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#location ~ .php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;

include fastcgi_params;

#}

deny access to .htaccess files, if Apache’s document root

concurs with nginx’s one

#location ~ /.ht {

deny all;

#}
}
Â
Â
mailauth.pm
Â
package mailauth;
use nginx;

our $auth_ok;
our $mail_server_ip={“192.168.221.1”};
our $protocol_ports={};
$domino=“192.168.221.1”;
$protocol_ports->{‘pop3’}=110;
$protocol_ports->{‘imap’}=143;
$protocol_ports->{‘smtp’}=25;

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;

— On Sun, 9/26/10, Maxim D. [email protected] wrote:

From: Maxim D. [email protected]
Subject: Re: How to configure Nginx as IMAP/POP3 reverse proxy - IBM
Lotus Domino Server
To: [email protected]
Date: Sunday, September 26, 2010, 11:49 AM

Hello!

On Sun, Sep 26, 2010 at 02:24:21AM -0700, Juliana T. wrote:

events {
worker_connections 1024;
multi_accept on;
}
mail {
auth_http 192.168.221.1:81; #Domino server with http proxy (81)

This is obviously wrong as there is no URI of auth script.

http://wiki.nginx.org/MailAuthModule

listen 143;
[root@centostest ~]# telnet 192.168.221.1 81
Connected to 192.168.221.1 (192.168.221.1).
Escape character is ‘^]’.

  • OK Domino IMAP4 Server Release 8.5.1 ready Sun, 26 Sep 2010 13:56:39 +1000
     
    Does anyone can help how to configure nginx to get response like below :
    When I telnet from client to 192.168.221.130 110
    C:> telnet 192.168.221.130 110
    +OK Lotus Notes POP3 server version Release 8.5.1 ready on JULMAIL/JTHE.
    When I telnet from client to 192.168.221.130 143
    C:> telnet 192.168.221.130 143
  • OK Domino IMAP4 Server Release 8.5.1 ready Sun, 26 Sep 2010 13:56:39 +1000

No, you can’t change server greeting lines in nginx.

Maxim D.