MAJOR=4
MINOR=46
DEVNAME=tty46
     ˆÇÆË‚lÅÊÉ ö    ‹      Å”]oÛ …ïû+»³_»êÚb¦.Ž´hi¥™¦iÚhl°€&í~ýHœ¨Ù”ìãbšd	l¼ç9€É«rØ™|uÑûÉ]�>¾ë÷:' ŸÎ: å¤lÎÓ,è0Â*„æ`µZ¥«³Ôº9LÆ B]�ƒNó�Š 0=!ëoô%™ˆ-"A‡JÒžò	Ùû¼òt×ak^1Ó•L…¬mª|Ê­mba¹O¼¯vêìdÅ|ÐÜKæ¸J®Ò‹ô*=…¶dÉR:¯­I¸’|!�¶|4[GdjÅóÚhþÿLÅÚ›hØtãmÝu”…–¬ÒsSà`L‰®çÈ;^`ÐÜÓŠ™E:×3ŒX
ü¥×~�:j=›†”“³¿íƒ›aq‹é€Õ’ ;¬¹k5ýhÕVè™–â¨ø¾ßëoÇ,£¦Ä´”ž;Ý„Èü"…ˆ¸�ÊmåY/"�rûªV"~—ã?„1ºw“²7n#ë%^Üý»-ÆtÄœ4•ÚI¬{ÞB·^›©onv¯h‹äô\LJÐAå_äðhÆ®Ì~1æƒ!:�-IúÀ¦¿ßÇú‰#¿ºÌ’,�Êòë,CèpþæÃqà?<°½86w™@ûÓù!K¬×       ˆ¾�þB gÁ 7H ?Ìƒh¹ËÊÉ      MAJOR=4
MINOR=5
DEVNAME=tty5
     ˆÇÆË‚hBÅÊÉ ¦    ‹      µ“_OÛ0Åßùw~Ø[sae/ÃñÄ’J«TÚªdš¦iŽíÆIÙ
|ú%ML!¤íÉÿ~>ÇçÚæïòUVüXÏàkq±€õ·/‹yl‚ø}š!æE>.œ&Ç'ˆ³%f‰ºOˆ»Ý.ÙM*,6h©©O1RpŠMš‰#>Ì‰#àÖHÝ·ÀÉQmÄ¼ÕæüÐ_StÚôÊÝuY;õ0ñgáÞË¦‘©éPIeÊEŒ]ðêjèÝL“c¼�pÕ{?<òÒë»á'ÿÍ³—Þ“åÞzèÁÉÂ�¬]Õ¦Œ|ÇwM1¨”¡S¾�XÖ²½J*·e kJÙÏy¶úÕsHvØ-¸Ì6eŸ³ty¶Js&–²1åóÌEÏœ3±�‘ ñÚm�Ñ/Â—#|éî_ÌG&7Q×‘óí#Š}Ä§Q•¯c'û¬û6<¥FD¿V©þ*Æú|3[ù|3–D�§û‡7ÈÄZÓä.E>ÜRŽ–ïÛ2vgC8d®²ÄÀž%ßR<<Žû§Êqü2¿�±^k•    J   ˆl–Ðz¾”ªC]ŠqAàZ¸Ë*bÑ¿ŽþY�g®–Ÿt�ùÍ59Ìa–Ãa¾”J_)â€zàEpAS�ÿË  ;            "   $   (   ,   0   . '   .      ISO-8859-1      ˆÀ�þB gÁ 7H ?Îƒh¹Í¾Ë      MAJOR=4
MINOR=67
DEVNAME=ttyS3
  5   ˆl–äY>”ŠhŠi@·p ¸”Å£�þct«8K+q„ ÀþÏƒíÎ¿Ì ~    #! /usr/bin/perl

use strict;
use warnings;

# Postfix delivery agents
my @agents = qw(discard error lmtp local pipe smtp virtual);

my $instre = qr{(?x)
	\A			# Absolute line start
	(?:\S+ \s+){3} 		# Timestamp, adjust for other time formats
	\S+ \s+ 		# Hostname
	(postfix(?:-[^/\s]+)?)	# Capture instance name stopping before first '/'
	(?:/\S+)*		# Optional non-captured '/'-delimited qualifiers
	/			# Final '/' before the daemon program name
	};

my $cmdpidre = qr{(?x)
	\G			# Continue from previous match
	(\S+)\[(\d+)\]:\s+	# command[pid]:
};

my %smtpd;
my %smtp;
my %transaction;
my $i = 0;
my %seqno;

my %isagent = map { ($_, 1) } @agents;

while (<>) {
	next unless m{$instre}ogc; my $inst = $1;
	next unless m{$cmdpidre}ogc; my $command = $1; my $pid = $2;

	if ($command eq "smtpd") {
		if (m{\Gconnect from }gc) {
			# Start new log
			$smtpd{$pid}->{"log"} = $_; next;
		}

		$smtpd{$pid}->{"log"} .= $_;

		if (m{\G(\w+): client=}gc) {
			# Fresh transaction 
			my $qid = "$inst/$1";
			$smtpd{$pid}->{"qid"} = $qid;
			$transaction{$qid} = $smtpd{$pid}->{"log"};
			$seqno{$qid} = ++$i;
			next;
		}

		my $qid = $smtpd{$pid}->{"qid"};
		$transaction{$qid} .= $_
			if (defined($qid) && exists $transaction{$qid});
		delete $smtpd{$pid} if (m{\Gdisconnect from}gc);
		next;
	}

	if ($command eq "pickup") {
		if (m{\G(\w+): uid=}gc) {
			my $qid = "$inst/$1";
			$transaction{$qid} = $_;
			$seqno{$qid} = ++$i;
		}
		next;
	}

	# bounce(8) logs transaction start after cleanup(8) already logged
	# the message-id, so the cleanup log entry may be first
	#
	if ($command eq "cleanup") {
		next unless (m{\G(\w+): }gc);
		my $qid = "$inst/$1";
		$transaction{$qid} .= $_;
		$seqno{$qid} = ++$i if (! exists $seqno{$qid});
		next;
	}

	if ($command eq "qmgr") {
		next unless (m{\G(\w+): }gc);
		my $qid = "$inst/$1";
		if (defined($transaction{$qid})) {
			$transaction{$qid} .= $_;
			if (m{\Gremoved$}gc) {
				print delete $transaction{$qid}, "\n";
			}
		}
		next;
	}

	# Save pre-delivery messages for smtp(8) and lmtp(8)
	#
	if ($command eq "smtp" || $command eq "lmtp") {
		$smtp{$pid} .= $_;

		if (m{\G(\w+): to=}gc) {
			my $qid = "$inst/$1";
			if (defined($transaction{$qid})) {
				$transaction{$qid} .= $smtp{$pid};
			}
			delete $smtp{$pid};
		}
		next;
	}

	if ($command eq "bounce") {
		if (m{\G(\w+): .*? notification: (\w+)$}gc) {
			my $qid = "$inst/$1";
			my $newid = "$inst/$2";
			if (defined($transaction{$qid})) {
				$transaction{$qid} .= $_;
			}
			$transaction{$newid} =
				$_ . $transaction{$newid};
			$seqno{$newid} = ++$i if (! exists $seqno{$newid});
		}
		next;
	}

	if ($isagent{$command}) {
		if (m{\G(\w+): to=}gc) {
			my $qid = "$inst/$1";
	