~ubuntu-branches/ubuntu/trusty/libsendmail-pmilter-perl/trusty

« back to all changes in this revision

Viewing changes to PMilter/modules/helo_unqualified

  • Committer: Bazaar Package Importer
  • Author(s): Hilko Bengen
  • Date: 2004-08-14 20:08:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040814200840-2jhotk2vxgqiz8sa
Tags: 0.95-1
* New upstream version
  - fixes installation problems already fixed in the 0.94-1 package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $DUH: helo_unqualified,v 1.7 2002/12/16 05:14:33 tv Exp $
2
 
#
3
 
# Copyright (c) 2002 Todd Vierling <tv@pobox.com> <tv@duh.org>.
4
 
# All rights reserved.
5
 
# Please see the COPYRIGHT file, part of the PMilter distribution,
6
 
# for full copyright and license terms.
7
 
 
8
 
##### helo_unqualified #####
9
 
#
10
 
# Rejects HELO commands of an unqualified, non-IP-literal name.
11
 
# In short, rejects any domain name without a dot (.).
12
 
 
13
 
my $errmsg = shift_errmsg(@_, 'Domain "%1" is not fully qualified');
14
 
 
15
 
+{
16
 
        helo => sub {
17
 
                my $ctx = shift;
18
 
                my $helo = shift;
19
 
 
20
 
                if (($helo !~ /\./) && ($helo !~ /^\[.*\]$/)) {
21
 
                        my $err = $errmsg;
22
 
                        $err =~ s/%1/$helo/g; # interpolate HELO arg
23
 
 
24
 
                        return $ctx->reject("554 HELO/EHLO command rejected: $err");
25
 
                }
26
 
 
27
 
                return SMFIS_ACCEPT;
28
 
        }
29
 
};