Mercurial > hg > nginx
comparison src/mail/ngx_mail_auth_http_module.c @ 5988:3b3f789655dc
Mail: added Auth-SSL header to indicate SSL.
Based on a patch by Filipe da Silva.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 25 Feb 2015 17:47:49 +0300 |
parents | 62c098eb4509 |
children | ec01b1d1fff1 |
comparison
equal
deleted
inserted
replaced
5987:62c098eb4509 | 5988:3b3f789655dc |
---|---|
1171 + sizeof(CRLF) - 1 | 1171 + sizeof(CRLF) - 1 |
1172 + sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1 | 1172 + sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1 |
1173 + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len + sizeof(CRLF) - 1 | 1173 + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len + sizeof(CRLF) - 1 |
1174 + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len + sizeof(CRLF) - 1 | 1174 + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len + sizeof(CRLF) - 1 |
1175 + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len + sizeof(CRLF) - 1 | 1175 + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len + sizeof(CRLF) - 1 |
1176 #if (NGX_MAIL_SSL) | |
1177 + sizeof("Auth-SSL: on" CRLF) - 1 | |
1178 #endif | |
1176 + ahcf->header.len | 1179 + ahcf->header.len |
1177 + sizeof(CRLF) - 1; | 1180 + sizeof(CRLF) - 1; |
1178 | 1181 |
1179 b = ngx_create_temp_buf(pool, len); | 1182 b = ngx_create_temp_buf(pool, len); |
1180 if (b == NULL) { | 1183 if (b == NULL) { |
1253 b->last = ngx_copy(b->last, s->smtp_to.data, s->smtp_to.len); | 1256 b->last = ngx_copy(b->last, s->smtp_to.data, s->smtp_to.len); |
1254 *b->last++ = CR; *b->last++ = LF; | 1257 *b->last++ = CR; *b->last++ = LF; |
1255 | 1258 |
1256 } | 1259 } |
1257 | 1260 |
1261 #if (NGX_MAIL_SSL) | |
1262 | |
1263 if (s->connection->ssl) { | |
1264 b->last = ngx_cpymem(b->last, "Auth-SSL: on" CRLF, | |
1265 sizeof("Auth-SSL: on" CRLF) - 1); | |
1266 } | |
1267 | |
1268 #endif | |
1269 | |
1258 if (ahcf->header.len) { | 1270 if (ahcf->header.len) { |
1259 b->last = ngx_copy(b->last, ahcf->header.data, ahcf->header.len); | 1271 b->last = ngx_copy(b->last, ahcf->header.data, ahcf->header.len); |
1260 } | 1272 } |
1261 | 1273 |
1262 /* add "\r\n" at the header end */ | 1274 /* add "\r\n" at the header end */ |