Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Mail: send starttls flag value to auth script

Filipe Da Silva
March 07, 2015 05:36AM
I think that the half way solution is this one attached :

- when an SSL connection is active : "Auth-SSL: on" ( current code status)
- else when it could have been active (using STARTTLS): "Auth-SSL: off"
- else SSL was disabled: there is nothing to send.

Regards,
Filipe DA SILVA.

2015-03-03 17:28 GMT+01:00 Michael Kliewe <info@phpgangsta.de>:
> Hi Maxim,
>
> On Mar 3, 2015, at 4:50 PM, Maxim Dounin wrote:
>
>> Hello!
>>
>> On Tue, Mar 03, 2015 at 03:14:50PM +0100, Michael Kliewe wrote:
>>
>>> Hi again,
>>>
>>> On Mar 2, 2015, at 3:56 PM, Maxim Dounin wrote:
>>>
>>> I'm sorry, I don't really want to repeat my arguments, but as I
>>> said I don't have control over all nginx servers that are used.
>>> Some will be "older", some will be newer. And I cannot force
>>> "them" to introduce the auth_http_header to just send the nginx
>>> version or capability of sending Auth-SSL header or not...
>>
>> If you can't, than just switch off warnings till the update is
>> complete, as already suggested.
>
> That might take months or years, some are out of my control as I said.
> And we are already sending warnings currently because of the patch from Filipe, which works fine.
> I cannot use your modified patch, I still have to patch Filipes version manually then.
>
>>
>>> Filipe's patch is working fine since > 6 month, it's either
>>> sending 0 or 1. The 0 is an important information and should not
>>> be dropped.
>>>
>>> Can you tell me the disadvantage of sending "off" in case the
>>> connection is unencrypted? I don't really see the problem at the
>>> moment why you don't add the else branch, you are dropping
>>> information that is needed (and that was there in the original
>>> patch)... It's just 3 lines more code and doesn't hurt anybody,
>>> but provides important information to the auth script.
>>
>> As already explained, the problem is that the header will be added
>> forever for all setups, and it will be waste of resources in all
>> these setups. It will be waste of resources in your setup as well
>> after the transition period.
>
> But you are already adding the header in case it is an encrypted connection, which currently is >90% of all cases, at least here in Germany. If you call that "waste of ressources", you are already doing that for 90% of all IMAP/POP3 connections, I'm just asking to do that for the last 10% that are unencrypted (and will fade away during the next years, as more and more providers disallow unencrypted connections).
> I'm just asking for the last 10% of connections, which are the important ones, if you need that feature.
>
> Otherwise I still have to use the patch from Filipe everywhere, because it allows slow migration and distinction between "encrypted", "unencrypted" and "unknown" in the auth script.
>
> If you want to be as efficient as possible, you should send just "AUTH_SSL: off" in case of an unencrypted connection, and no header at all for an encrypted connection. That would be a lot better, because >90% of all IMAP/POP3 connections are encrypted today.
>
> Michael
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
# HG changeset patch
# Parent b3dc82de188c6954b5f761d11900309165e77813
Mail: Modify Auth-SSL header to indicate when SSL is not used
when it could be (STARTTLS enabled).

diff -r b3dc82de188c -r 9aecb997009e src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c Sat Mar 07 10:54:11 2015 +0100
+++ b/src/mail/ngx_mail_auth_http_module.c Sat Mar 07 11:04:39 2015 +0100
@@ -1244,7 +1244,7 @@ ngx_mail_auth_http_create_request(ngx_ma
+ sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len + sizeof(CRLF) - 1
+ sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len + sizeof(CRLF) - 1
#if (NGX_MAIL_SSL)
- + sizeof("Auth-SSL: on" CRLF) - 1
+ + sizeof("Auth-SSL: off" CRLF) - 1
+ sizeof("Auth-SSL-Verify: ") - 1 + verify.len + sizeof(CRLF) - 1
+ sizeof("Auth-SSL-Subject: ") - 1 + subject.len + sizeof(CRLF) - 1
+ sizeof("Auth-SSL-Issuer: ") - 1 + issuer.len + sizeof(CRLF) - 1
@@ -1383,7 +1383,12 @@ ngx_mail_auth_http_create_request(ngx_ma
*b->last++ = CR; *b->last++ = LF;
}
}
-
+ else if ( s-> starttls )
+ {
+ /* SSL isn't used when it could be. */
+ b->last = ngx_cpymem(b->last, "Auth-SSL: off" CRLF,
+ sizeof("Auth-SSL: off" CRLF) - 1);
+ }
#endif

if (ahcf->header.len) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Mail: send starttls flag value to auth script

Filipe da Silva 1056 March 06, 2014 05:00AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 467 March 06, 2014 11:28AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 494 March 06, 2014 12:04PM

Re: [PATCH] Mail: send starttls flag value to auth script

Filipe Da Silva 565 June 19, 2014 04:12PM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 383 July 30, 2014 10:34PM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 351 August 01, 2014 03:00PM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 391 August 01, 2014 04:16PM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 373 February 04, 2015 04:10PM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 388 February 05, 2015 08:02AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 279 February 25, 2015 10:30AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 327 February 25, 2015 10:32AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 302 March 02, 2015 07:14AM

Re: [PATCH] Mail: send starttls flag value to auth script

Filipe Da Silva 308 March 02, 2015 08:14AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 282 March 02, 2015 09:16AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 302 March 02, 2015 09:34AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 293 March 02, 2015 09:58AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 365 March 03, 2015 09:16AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 341 March 03, 2015 10:52AM

Re: [PATCH] Mail: send starttls flag value to auth script

MKl 363 March 03, 2015 11:30AM

Re: [PATCH] Mail: send starttls flag value to auth script

Filipe Da Silva 341 March 07, 2015 05:36AM

Re: [PATCH] Mail: send starttls flag value to auth script

Filipe Da Silva 332 March 07, 2015 10:58AM

Re: [PATCH] Mail: send starttls flag value to auth script

Maxim Dounin 310 March 10, 2015 07:52AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 238
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready