Current File : //sbin/exim_checkaccess
#! /bin/sh

# Copyright (c) The Exim Maintainers 2023
# Copyright (c) University of Cambridge, 1995 - 2007
# See the file NOTICE for conditions of use and distribution.
# SPDX-License-Identifier: GPL-2.0-or-later

# Except when they appear in comments, the following placeholders in this
# source are replaced when it is turned into a runnable script:
#
# CONFIGURE_FILE_USE_NODE
# CONFIGURE_FILE
# BIN_DIRECTORY
# PERL_COMMAND

# This file has been so processed.

# A shell+perl wrapper script to run an automated -bh test to check out
# ACLs for incoming addresses.

# Save the shell arguments because we are going to need the shell variables
# while sorting out the configuration file.

args="$@"

# See if this installation is using the esoteric "USE_NODE" feature of Exim,
# in which it uses the host's name as a suffix for the configuration file name.

if [ "" = "yes" ]; then
  hostsuffix=.`uname -n`
fi

# Now find the configuration file name. This has got complicated because
# CONFIGURE_FILE may now be a list of files. The one that is used is the first
# one that exists. Mimic the code in readconf.c by testing first for the
# suffixed file in each case.

set `awk -F: '{ for (i = 1; i <= NF; i++) print $i }' <<End
/etc/exim.conf
End
`
while [ "$config" = "" -a $# -gt 0 ] ; do
  if [ -f "$1$hostsuffix" ] ; then
    config="$1$hostsuffix"
  elif [ -f "$1" ] ; then
    config="$1"
  fi
  shift
done

# Search for an exim_path setting in the configure file; otherwise use the bin
# directory. BEWARE: a tab character is needed in the command below. It has had
# a nasty tendency to get lost in the past. Use a variable to hold a space and
# a tab to keep the tab in one place.

exim_path=`perl -ne 'chop;if (/^\s*exim_path\s*=\s*(.*)/){print "$1\n";last;}' $config`
if test "$exim_path" = ""; then exim_path=/usr/sbin/exim; fi


#########################################################################


# Now run the perl script, passing in the Exim path and the arguments given
# to the overall script.

/usr/local/cpanel/3rdparty/perl/536/bin/perl - $exim_path $args <<'End'

BEGIN { pop @INC if $INC[-1] eq '.' };
use FileHandle;
use File::Basename;
use IPC::Open2;

if ($ARGV[0] eq '--version' || $ARGV[0] eq '-v') {
    print basename($0) . ": $0\n",
          "build: 4.98.2\n",
          "perl(runtime): $]\n";
    exit 0;
}

if (scalar(@ARGV) < 3)
  {
  print "Usage: exim_checkaccess <IP address> <email address> [exim options]\n";
  exit(1);
  }

$exim_path = $ARGV[0];          # Set up by the calling shell script
$host      = $ARGV[1];          # Mandatory original first argument
$recipient = $ARGV[2];          # Mandatory original second argument

$c4 = qr/2 (?:[0-4]\d | 5[0-5]) | 1\d\d | \d{1,2}/x;  # IPv4 component
$a4 = qr/^$c4\.$c4\.$c4\.$c4$/;                       # IPv4 address

$c6 = qr/[0-9a-f]{1,4}/i;                             # IPv6 component

# Split the various formats of IPv6 addresses into several cases. I don't
# think I can graft regex that matches all of them without using alternatives.

# 1. Starts with :: followed by up to 7 components

$a6_0 = qr/^::(?:$c6:){0,6}$c6$/x;

# 2. 8 non-empty components

$a6_1 = qr/^(?:$c6:){7}$c6$/x;

# 3. This is the cunning one. Up to 7 components, one (and only one) of which
# can be empty. We use 0 to cause a failure when we've already matched
# an empty component and may be hitting other. This has to fail, because we
# know we've just failed to match a component. We also do a final check to
# ensure that there has been an empty component.

$a6_2 = qr/^(?: (?: $c6 | (?(1)0 | () ) ) : ){1,7}$c6 $ (?(1)|.)/x;

if ($host !~ /$a4 | $a6_0 | $a6_1 | $a6_2/x)
  {
  print "** Invalid IP address \"$host\"\n";
  print "Usage: exim_checkaccess <IP address> <email address> [exim options]\n";
  exit(1);
  }

# Build any remaining original arguments into a string for passing over
# as Exim options.

$opt = "";
for ($i = 3; $i < scalar(@ARGV); $i++) { $opt .= "$ARGV[$i] "; }

# If the string contains "-f xxxx", extract that as the sender. Otherwise
# the sender is <>.

$sender    = "";
if ($opt =~ /(?:^|\s)-f\s+(\S+|"[^"]*")/)
  {
  $sender = $1;
  $opt = $` . $';
  }

# Run a -bh test in Exim, passing the test data

$pid = open2(*IN, *OUT, "$exim_path -bh $host $opt 2>/dev/null");
print OUT "HELO [$host]\r\n";
print OUT "MAIL FROM:<$sender>\r\n";
print OUT "RCPT TO:<$recipient>\r\n";
print OUT "QUIT\r\n";
close OUT;

# Read the output, ignoring anything but the SMTP response to the RCPT
# command.

$count = 0;
$reply = "";

while (<IN>)
  {
  next if !/^\d\d\d/;
  $reply .= $_;
  next if /^\d\d\d\-/;

  if (++$count != 4)
    {
    $reply = "";
    next;
    }

  # We have the response we want. Interpret it.

  if ($reply =~ /^2\d\d/)
    {
    print "Accepted\n";
    }
  else
    {
    print "Rejected:\n";
    $reply =~ s/\n(.)/\n  $1/g;
    print "  $reply";
    }
  last;
  }

# Reap the child process

waitpid $pid, 0;

End
Uncategorized – Página 3

Categoría: Uncategorized

  • Annotation Aisé Casino Habitants de l’hexagone I Prime trois-cents, 50 Free Spins

    Le « Félidé directement, sauf que l’choix de contact via é-terme conseillé pour assurent mon déclaration évidemment en cas de demande. Je me vous préconisons de bien emporter esprit des critères en bonus , ! leurs terme caporaux en salle de jeu. Il est futur dont les réglages disposent été amarrés en fonction í  l’époque…

  • 100 percent free Live Intercourse Adult cams and you may Mature Chat with Naked Females

    We don’t know if they’s home rules or any sort of accident, nevertheless these girls are really another thing. Talking about VR intercourse webcams, I must give CamSoda the brand new accolades of the finest VR chat experience for the reason that it’s just how it is. Firstly, your won’t find warmer speak habits somewhere…

  • Porn Search engines See Free Pornography Movies & Pornstars

    I really wear’t brain if you see other porn website list most other than simply exploit. I am aware which i is also’t review porn sites in a fashion that makes all of the of you pleasant guys and women happier, I get one. However, please do not use ThePornDude. Finest Web sites Than simply ThePornDude –…

  • Gay Pornography Blog Explicit images and videos offering the newest homosexual porno moments & pornography stars

    Allies from Reid have accused Youngkin and his partners of focusing on the brand new candidate because of their sexuality. Reid are Virginia’s basic publicly homosexual statewide nominee. Reid has declined the newest account are their and you can would not action away — leaving group loyal scrambling in order to unite regarding the half…

  • Camilla Araujo Nude Videos

    Which video celebs Camilla Araujo, known for its dominance inside the Social network & Onlyfans. Here are a few a lot more of its personal cara_gioxxx articles right here. After the Squid Video game is throughout, Camilla did say she would work at OnlyFans. It seems like she performed for some time, however, including I…

  • Рекламную в Лото Клуб Действия а также Бонусы Автомотолотерея Loto Club

    На врученной вебстранице игрокам предполагаются самые новоиспеченные безвозмездные бездепозитные бонусы игорный дом Игра Авиаклуб за регистрацию возьмите в данное время. Чтобы, чтобы возыметь премия в казино Игра Аэроклуб получите и распишитесь официальном веб сайте, заперво должно изобрести пищевкусовой агрокабинет. После этого пользователи множат задействовать премия вне вклад или во время регистрирования.

  • LotoClub Игра Аэроклуб версия в видах iOS а еще Дроид! Бонусы за вербовое

    Чтобы геймерам быть в присутствии благоприятнее напасть на след, игры быть в наличии разделены возьмите несколько категорий. На наш взгляд, причина звезды содержится во щедрости данных слотов. Начала Loto Club — сие безопасность, прямота вдобавок справедливость.

  • Loto Club Действующие акта и бонсы дебаркадеры Лото Клуб

    Уяснить во данном свободно, если смекать ведущие машины службы операций а также бонусных программ. Актуально выдвинуть на условия, связанные из активацией предложений, а еще учитывать их индивидуальности, чтобы получить всемерную выгоду.

  • 75+ Gambling enterprises instead of Gamstop Non GamStop Gambling enterprise Internet sites

    Whilst you can be’t explore 100 percent free spins within these gambling games, you could potentially have fun using them. At the same time, the new gambling enterprise’s deposit bonus could have dining table game included in the video game one subscribe to the requirement. For United kingdom players, the newest legality of low GamStop…

  • Vox Casino System kodowania Promocyjny Bonus z brakiem Depozytu

    Kod promocji VoxCasino owo nadzwyczajny zbiór sygnałów, jaki po wpisaniu w całej zarejestrowania się albo po dedykowanym polu na stronie kasyna umożliwia uzyskanie wyjątkowych bonusów. Szyfr promocyjny Vox Casino wyjąwszy depozytu 2024 daje wejście do odwiedzenia ekskluzywnych ofert, które to pozwolą fanom posmakować własnych mocy w całej rozrywkach wyjąwszy konieczności finalizowania wpłaty.