# load balance your smtp servers

worker_processes  2;
error_log  logs/error.log;

events {
  worker_connections  16384;
}

# http {
#   ... your usual http block ...
# } # http end

stream {
  error_log  logs/stream_error_smtp.log;

  upstream backendsmtp {
    server 192.168.8.55:2525 weight=1 fail_timeout=5;
    server 192.168.8.56:2525 weight=1 fail_timeout=5;
    server 192.168.8.57:2525 weight=1 fail_timeout=5;
    least_conn;
  }

  server {
    listen 25;
    proxy_connect_timeout 30s;
    proxy_timeout 30s;
    proxy_pass backendsmtp;
#    allow 192.168.44.11;
    allow 192.168.44.0/24;
    deny  all;
  }

}
