Mercurial > hg > nginx-tests
comparison smtp.t @ 26:0880e0fafde4
Tests: implement smtp test backend and use it.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 02 Oct 2008 16:18:11 +0400 |
parents | 7e28c64edf55 |
children | fb94a224fef2 |
comparison
equal
deleted
inserted
replaced
25:fbda19df2fc4 | 26:0880e0fafde4 |
---|---|
23 ############################################################################### | 23 ############################################################################### |
24 | 24 |
25 select STDERR; $| = 1; | 25 select STDERR; $| = 1; |
26 select STDOUT; $| = 1; | 26 select STDOUT; $| = 1; |
27 | 27 |
28 my $t = Test::Nginx->new()->write_file_expand('nginx.conf', <<'EOF')->run(); | 28 my $t = Test::Nginx->new() |
29 ->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon) | |
30 ->write_file_expand('nginx.conf', <<'EOF')->run(); | |
29 | 31 |
30 master_process off; | 32 master_process off; |
31 daemon off; | 33 daemon off; |
32 | 34 |
33 events { | 35 events { |
38 proxy_pass_error_message on; | 40 proxy_pass_error_message on; |
39 auth_http http://localhost:8080/mail/auth; | 41 auth_http http://localhost:8080/mail/auth; |
40 xclient off; | 42 xclient off; |
41 | 43 |
42 server { | 44 server { |
43 listen localhost:10025; | 45 listen localhost:8025; |
44 protocol smtp; | 46 protocol smtp; |
45 smtp_auth login plain none; | 47 smtp_auth login plain none; |
46 } | 48 } |
47 } | 49 } |
48 | 50 |
63 set $reply OK; | 65 set $reply OK; |
64 } | 66 } |
65 | 67 |
66 add_header Auth-Status $reply; | 68 add_header Auth-Status $reply; |
67 add_header Auth-Server 127.0.0.1; | 69 add_header Auth-Server 127.0.0.1; |
68 add_header Auth-Port 25; | 70 add_header Auth-Port 8026; |
69 add_header Auth-Wait 1; | 71 add_header Auth-Wait 1; |
70 return 204; | 72 return 204; |
71 } | 73 } |
72 } | 74 } |
73 } | 75 } |