view smtp.conf @ 9:f772e2a1a13f

Tests: change directory to allow runing from outside. Use FindBin to find out where tests reside and chdir() into it. This allows to use configs from the directory with tests and to use _common.pm.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 10 Sep 2008 17:41:04 +0400
parents 6c41dbb2954f
children f6bb0ffdb9b4
line wrap: on
line source

# Config for smtp.t tests.

worker_processes  1;

master_process off;
daemon         off;

events {
    worker_connections  1024;
}

mail {
    proxy_pass_error_message  on;
    auth_http  http://localhost:8080/mail/auth;
    xclient    off;

    server {
        listen     10025;
        protocol   smtp;
        smtp_auth  login plain none;
    }

    server {
        listen     10026;
        protocol   smtp;
        smtp_greeting_delay  100ms;
    }
}

http {
    access_log    off;

    server {
        listen       8080;
        server_name  localhost;

        location = /mail/auth {
            set $reply ERROR;

            if ($http_auth_smtp_to ~ example.com) {
                set $reply OK;
            }
            if ($http_auth_pass ~ secret) {
                set $reply OK;
            }

            add_header Auth-Status $reply;
            add_header Auth-Server 127.0.0.1;
            add_header Auth-Port 25;
            add_header Auth-Wait 1;
            return 204;
        }
    }
}