Current File : //sbin/exiqgrep
#!/usr/local/cpanel/3rdparty/perl/536/bin/perl

# Utility for searching and displaying queue information.
# Written by Matt Hubbard 15 August 2002
#
# Copyright (c) The Exim Maintainers 2021 - 2023
# SPDX-License-Identifier: GPL-2.0-or-later
# See the file NOTICE for conditions of use and distribution.

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

# This file has been so processed.


# Routine for extracting the UTC timestamp from message ID
# lifted from eximstat utility

# Version 1.3

use strict;
BEGIN { pop @INC if $INC[-1] eq '.' };

use Getopt::Std;
use File::Basename;

# Have this variable point to your exim binary.
my $exim = '/usr/sbin/exim';
my $eargs = '-bpu';
my %id;
my %opt;
my $count = 0;
my $mcount = 0;
my @tab62 =
  (0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0,     # 0-9
   0,10,11,12,13,14,15,16,17,18,19,20,  # A-K
  21,22,23,24,25,26,27,28,29,30,31,32,  # L-W
  33,34,35, 0, 0, 0, 0, 0,              # X-Z
   0,36,37,38,39,40,41,42,43,44,45,46,  # a-k
  47,48,49,50,51,52,53,54,55,56,57,58,  # l-w
  59,60,61);                            # x-z

my $base;
if ($^O eq 'darwin') { # aka MacOS X
  $base = 36;
 } else {
  $base = 62;
};

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 (!getopts('hf:r:y:o:s:C:zxlibRcaG:E:',\%opt)) { &help; exit; }
if ($opt{h}) { &help; exit; }
if ($ARGV[0] || !($opt{f} || $opt{r} || $opt{s} || $opt{y} || $opt{o} || $opt{z} || $opt{x} || $opt{c}))
   { &help; exit(1); }
if ($opt{a}) { $eargs = '-bp'; }
if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; }
if ($opt{G}) { $eargs .= ' -qG'.$opt{G}; }
if ($opt{E}) { $exim = $opt{E}; }

# Read message queue output into hash
&collect();
# Identify which messages match selection criteria
&selection();
# Print matching data according to display option.
&display();
exit;


sub help() {
	print <<'EOF'
Exim message queue display utility.

	-h		This help message.
	-C		Specify which exim.conf to use.
	-E		Specify exim binary to use.

Selection criteria:
	-f <regexp>	Match sender address sender (field is "< >" wrapped)
	-r <regexp>	Match recipient address
	-s <regexp>	Match against the size field from long output
	-y <seconds>	Message younger than
	-o <seconds>	Message older than
	-z		Frozen messages only (exclude non-frozen)
	-x		Non-frozen messages only (exclude frozen)
	-G <queuename>	Match in given queue only

[ NB: for regexps, provided string sits in /<string>/ ]

Display options:
	-c		Display match count
	-l		Long Format [Default]
	-i		Message IDs only
	-b		Brief Format
	-R		Reverse order
	-a		All recipients (including delivered)
EOF
}

sub collect() {
	open(QUEUE,"$exim $eargs |") or die("Error opening pipe: $!\n");
	while(<QUEUE>) {
		chomp();
		my $line = $_;
		#Should be 1st line of record, if not error.
		if ($line =~ /^\s*(?<age>\w+)
			      \s+(?<size>(?:\d+(?:\.\d+)?[A-Z]?)?)
			      \s*(?<msgid>(?:\w{6}-\w{6}-\w{2}|\w{6}-\w{11}-\w{4}))	# old, 2023 msgid formats
			      \s+(?<from><.*?>)/x) {
			my $msg = $+{msgid};
			$id{$msg}{age} = $+{age};
			$id{$msg}{size} = $+{size};
			$id{$msg}{from} = $+{from};
			$id{$msg}{birth} = &msg_utc($msg);
			$id{$msg}{ages} = time - $id{$msg}{birth};
			$id{$msg}{frozen} = ($line =~ /\*\*\* frozen \*\*\*$/) ? 1 : 0;
			while(<QUEUE> =~ /\s+(.*?\@.*)$/) {
				push(@{$id{$msg}{rcpt}},$1);
			}
			# Increment message counter.
			$count++;
		} else {
			print STDERR "Line mismatch: $line\n"; exit 1;
		}
	}
	close(QUEUE) or die("Error closing pipe: $!\n");
}

sub selection() {
	foreach my $msg (keys(%id)) {
		if ($opt{f}) {
			# Match sender address
			next unless ($id{$msg}{from} =~ /$opt{f}/i);
		}
		if ($opt{r}) {
			# Match any recipient address
			my $match = 0;
			foreach my $rcpt (@{$id{$msg}{rcpt}}) {
				$match++ if ($rcpt =~ /$opt{r}/i);
			}
			next unless ($match);
		}
		if ($opt{s}) {
			# Match against the size string.
			next unless ($id{$msg}{size} =~ /$opt{s}/);
		}
		if ($opt{y}) {
			# Match younger than
			next unless ($id{$msg}{ages} < $opt{y});
		}
		if ($opt{o}) {
			# Match older than
			next unless ($id{$msg}{ages} > $opt{o});
		}
		if ($opt{z}) {
			# Exclude non frozen
			next unless ($id{$msg}{frozen});
		}
		if ($opt{x}) {
			# Exclude frozen
			next if ($id{$msg}{frozen});
		}
		# Here's what we do to select the record.
		# Should only get this far if the message passed all of
		# the active tests.
		$id{$msg}{d} = 1;
		# Increment match counter.
		$mcount++;
	}
}

sub display() {
	if ($opt{c}) {
		printf("%d matches out of %d messages\n",$mcount,$count);
		exit;
	}
	foreach my $msg (sort { $opt{R} ? $id{$b}{birth} <=> $id{$a}{birth} : $id{$a}{birth} <=> $id{$b}{birth} } keys(%id) ) {
		if (exists($id{$msg}{d})) {
			if ($opt{i}) {
				# Just the msg ID
				print $msg, "\n";
			} elsif ($opt{b}) {
				# Brief format
				printf("%s From: %s To: %s\n",$msg,$id{$msg}{from},join(';',@{$id{$msg}{rcpt}}))
			} else {
				# Otherwise Long format attempted duplication of original format.
				printf("%3s %5s %s %s%s\n",$id{$msg}{age},$id{$msg}{size},$msg,$id{$msg}{from},$id{$msg}{frozen} ? " *** frozen ***" : "");
				foreach my $rcpt (@{$id{$msg}{rcpt}}) {
					printf("	  %s\n",$rcpt);
				}
				print "\n";
			}
		}
	}
}

sub report() {
	foreach my $msg (keys(%id)) {
		print "$id{$msg}{birth} $msg\tAge: $id{$msg}{age}\tSize: $id{$msg}{size}\tFrom: $id{$msg}{from}\tTo: " . join(" ",@{$id{$msg}{rcpt}}). "\n";
	}
}

sub msg_utc() {
	my $id = substr((pop @_), 0, 6);
	my $s = 0;
	my @c = split(//, $id);
	while($#c >= 0) { $s = $s * $base + $tab62[ord(shift @c) - ord('0')] }
	return $s;
}
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.