/[smeserver]/rpms/e-smith-email/sme9/e-smith-email-5.4.0-AuthOrder.patch
ViewVC logotype

Annotation of /rpms/e-smith-email/sme9/e-smith-email-5.4.0-AuthOrder.patch

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


Revision 1.1 - (hide annotations) (download)
Sat Dec 14 20:41:17 2013 UTC (10 years, 10 months ago) by wellsi
Branch: MAIN
CVS Tags: e-smith-email-5_4_0-11_el6_sme, e-smith-email-5_4_0-10_el6_sme, e-smith-email-5_4_0-12_el6_sme, e-smith-email-5_4_0-7_el6_sme, e-smith-email-5_4_0-9_el6_sme, e-smith-email-5_4_0-6_el6_sme, e-smith-email-5_4_0-8_el6_sme, HEAD
* Sat Dec 14 2013 Ian Wells <esmith@wellsi.com> 5.4.0-6.sme
- Only present one auth method at a time, in order, to NET::SMTP,
  by Charlie Brady [SME: 8060]
  Second hunk in patch converts tabs to spaces, no code change.

1 wellsi 1.1 diff -ruN e-smith-email-5.4.0.old/root/usr/local/sbin/smtp-auth-proxy.pl e-smith-email-5.4.0/root/usr/local/sbin/smtp-auth-proxy.pl
2     --- e-smith-email-5.4.0.old/root/usr/local/sbin/smtp-auth-proxy.pl 2013-02-06 13:56:01.000000000 -0800
3     +++ e-smith-email-5.4.0/root/usr/local/sbin/smtp-auth-proxy.pl 2013-12-14 12:27:33.000000000 -0800
4     @@ -114,13 +114,29 @@
5    
6     if ($smtp->supports("AUTH"))
7     {
8     - foreach (split (/ /, $self->get_property('Blacklist')))
9     - {${*$smtp}{'net_smtp_esmtp'}->{"AUTH"} =~ s/$_//;}
10     -
11     - unless ($smtp->auth($name, $pass))
12     + my $authenticated = 0;
13     + my $blacklist = $self->get_property('Blacklist') || "";;
14     + foreach my $method (split (/ /, ${*$smtp}{'net_smtp_esmtp'}->{"AUTH"}))
15     + {
16     + # Skip $method if in the blacklist
17     + next unless ($blacklist !~ /$method/);
18     + # Only present one auth method at a time to NET::SMTP
19     + {${*$smtp}{'net_smtp_esmtp'}->{"AUTH"} = $method;}
20     +
21     + if ($smtp->auth($name, $pass))
22     + {
23     + $authenticated++;
24     + last;
25     + }
26     + else
27     + {
28     + warn "SMTP authentication (with $method) with ISP server failed\n";
29     + }
30     + }
31     + unless ($authenticated)
32     {
33     print "451 Could not auth to mail server\n";
34     - warn "SMTP authentication with ISP server failed\n";
35     + warn "all SMTP authentication methods failed\n";
36     $smtp->quit;
37     exit;
38     }
39     @@ -133,19 +149,19 @@
40    
41     my $discard = <STDIN>; # Swallow EHLO
42     while (my $msg = shift @ehlo) {
43     - my $sep = (@ehlo ? "-" : " ");
44     - print "250$sep$msg";
45     + my $sep = (@ehlo ? "-" : " ");
46     + print "250$sep$msg";
47     }
48    
49     die "can't fork: $!" unless defined ($kidpid = fork());
50     if ($kidpid)
51     {
52     - print $smtp $_ while <STDIN>;
53     + print $smtp $_ while <STDIN>;
54     kill ("TERM" => $kidpid);
55     }
56     else
57     {
58     - print while <$smtp>;
59     + print while <$smtp>;
60     kill ("TERM" => getppid());
61     }
62     }

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