# HG changeset patch # User Ruslan Ermilov # Date 1345180122 0 # Node ID d794e59800ef123cdc89511c98c8a4b826a8b0f9 # Parent 2ccaaf838bc235f8ed8de0142975149679434297 Mail: fixed sorting of listen addresses (ticket #187). For http module this problem was already fixed in r4756. diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -539,6 +539,11 @@ ngx_mail_cmp_conf_addrs(const void *one, return 1; } + if (second->wildcard) { + /* a wildcard must be the last resort, shift it to the end */ + return -1; + } + if (first->bind && !second->bind) { /* shift explicit bind()ed addresses to the start */ return -1;