mirror of https://github.com/nginx/nginx
Mail: Add Client-Port in auth header.
in order to send it to authentication script.
This commit is contained in:
parent
d25139db01
commit
f783df56d8
|
|
@ -1244,6 +1244,7 @@ ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool,
|
||||||
+ sizeof("Client-IP: ") - 1 + s->connection->addr_text.len
|
+ sizeof("Client-IP: ") - 1 + s->connection->addr_text.len
|
||||||
+ sizeof(CRLF) - 1
|
+ sizeof(CRLF) - 1
|
||||||
+ sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1
|
+ sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1
|
||||||
|
+ sizeof("Client-Port: ") - 1 + sizeof("65535") - 1 + sizeof(CRLF) - 1
|
||||||
+ ahcf->header.len
|
+ ahcf->header.len
|
||||||
+ sizeof(CRLF) - 1;
|
+ sizeof(CRLF) - 1;
|
||||||
|
|
||||||
|
|
@ -1342,6 +1343,9 @@ ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool,
|
||||||
s->connection->addr_text.len);
|
s->connection->addr_text.len);
|
||||||
*b->last++ = CR; *b->last++ = LF;
|
*b->last++ = CR; *b->last++ = LF;
|
||||||
|
|
||||||
|
b->last = ngx_sprintf(b->last, "Client-Port: %ui" CRLF,
|
||||||
|
ngx_inet_get_port(c->sockaddr));
|
||||||
|
|
||||||
if (s->host.len) {
|
if (s->host.len) {
|
||||||
b->last = ngx_cpymem(b->last, "Client-Host: ",
|
b->last = ngx_cpymem(b->last, "Client-Host: ",
|
||||||
sizeof("Client-Host: ") - 1);
|
sizeof("Client-Host: ") - 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue