/[smeserver]/rpms/qpsmtpd/sme10/qpsmtpd-0.84-notls_conf.patch
ViewVC logotype

Annotation of /rpms/qpsmtpd/sme10/qpsmtpd-0.84-notls_conf.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 7 20:49:54 2016 UTC (8 years, 8 months ago) by stephdl
Branch: MAIN
CVS Tags: qpsmtpd-0_96-19_el7_sme, qpsmtpd-0_96-12_el7_sme, qpsmtpd-0_96-11_el7_sme, qpsmtpd-0_96-16_el7_sme, qpsmtpd-0_96-13_el7_sme, qpsmtpd-0_96-6_el7_sme, qpsmtpd-0_96-18_el7_sme, qpsmtpd-0_96-23_el7_sme, qpsmtpd-0_96-20_el7_sme, qpsmtpd-0_84-20_el7_sme, qpsmtpd-0_96-17_el7_sme, qpsmtpd-0_96-8_el7_sme, qpsmtpd-0_96-5_el7_sme, qpsmtpd-0_96-2_el7_sme, qpsmtpd-0_96-21_el7_sme, qpsmtpd-0_96-22_el7_sme, qpsmtpd-0_96-14_el7_sme, qpsmtpd-0_96-15_el7_sme, qpsmtpd-0_96-9_el7_sme, qpsmtpd-0_96-4_el7_sme, qpsmtpd-0_96-1_el7_sme, qpsmtpd-0_96-3_el7_sme, qpsmtpd-0_84-18_el7_sme, qpsmtpd-0_96-10_el7_sme, qpsmtpd-0_84-19_el7_sme, HEAD
* Sun Feb 7 2016 stephane de labrusse <stephdl@de-labrusse.fr> 0.84-18.sme
- Build new rpm for sme10

1 stephdl 1.1 diff -Nur qpsmtpd-0.84/lib/Qpsmtpd/SMTP.pm qpsmtpd-0.84_bz8863/lib/Qpsmtpd/SMTP.pm
2     --- qpsmtpd-0.84/lib/Qpsmtpd/SMTP.pm 2015-05-15 15:38:15.796000000 +0200
3     +++ qpsmtpd-0.84_bz8863/lib/Qpsmtpd/SMTP.pm 2015-05-15 15:39:30.602000000 +0200
4     @@ -240,7 +240,11 @@
5     }
6    
7     # Check if we should only offer AUTH after TLS is completed
8     - my $tls_before_auth = ($self->config('tls_before_auth') ? ($self->config('tls_before_auth'))[0] && $self->transaction->notes('tls_enabled') : 0);
9     + my $tls_before_auth = ($self->config('tls_before_auth') ?
10     + (
11     + ($self->config('tls_before_auth'))[0] &&
12     + ($self->transaction->notes('tls_enabled') || $self->connection->notes('tls_force_disabled'))
13     + ) : 0);
14     if ( %auth_mechanisms && !$tls_before_auth) {
15     push @capabilities, 'AUTH '.join(" ",keys(%auth_mechanisms));
16     $self->{_commands}->{'auth'} = "";
17     diff -Nur qpsmtpd-0.84/plugins/tls qpsmtpd-0.84_bz8863/plugins/tls
18     --- qpsmtpd-0.84/plugins/tls 2015-05-15 15:38:15.791000000 +0200
19     +++ qpsmtpd-0.84_bz8863/plugins/tls 2015-05-15 15:55:06.719000000 +0200
20     @@ -107,9 +107,15 @@
21     }
22    
23     sub hook_ehlo {
24     - my ($self, $transaction) = @_;
25     + my ($self, $transaction, $host) = @_;
26     return DECLINED unless $self->can_do_tls;
27     return DECLINED if $self->connection->notes('tls_enabled');
28     + return DECLINED unless $host;
29     + if ($self->_is_in_notls($host)) {
30     + $self->log(LOGINFO, "Disabling TLS as host matches one of the notls config file");
31     + $self->connection->notes('tls_force_disabled', 1);
32     + return DECLINED;
33     + }
34     return DENY, "Command refused due to lack of security" if $transaction->notes('ssl_failed');
35     my $cap = $transaction->notes('capabilities');
36     $cap ||= [];
37     @@ -165,6 +171,22 @@
38     return DECLINED;
39     }
40    
41     +sub _is_in_notls {
42     + my ($self, $host) = @_;
43     +
44     + $host = lc $host;
45     + foreach my $line ($self->qp->config('notls')) {
46     + # If line is a regex
47     + if ($line =~ /[\{\}\[\]\(\)\^\$\|\*\+\?\\\!]/ && $host =~ /$line/) {
48     + return 1;
49     + }
50     + if ($host eq lc $line) {
51     + return 1;
52     + }
53     + }
54     + return;
55     +}
56     +
57     sub _convert_to_ssl {
58     my ($self) = @_;
59    

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed