From: Alexey Tourbin <at@altlinux.ru>
To: community@lists.altlinux.org
Subject: Re: [Comm] script for procmail log
Date: Thu, 22 Feb 2007 15:17:30 +0300
Message-ID: <20070222121730.GD3073@localhost.localdomain> (raw)
In-Reply-To: <20060819205113.GC8500@localhost.localdomain>
[-- Attachment #1.1: Type: text/plain, Size: 488 bytes --]
On Sun, Aug 20, 2006 at 12:51:13AM +0400, Alexey Tourbin wrote:
> Может кому надо.
>
> ~/.procmailrc:
> LOGFILE=$MAILDIR/.maillog
> LOGABSTRACT=all
>
> ~/bin/maillog:
> #!/bin/sh
> log=$1 && shift || log=~/Mail/.maillog
> tail -n 30 -f "$log" |perl -MEncode -Mopen=OUT,:locale -ln /dev/fd/3 3<<'__EOF__'
> /^\s*Subject:\s*/ and $subj = Encode::decode("MIME-Header", $') || $';
> /^\s*Folder:\s*(\S+)/ and printf "%-8s\t%s\n", $1, $subj;
> __EOF__
Вот версия получше.
[-- Attachment #1.2: maillog --]
[-- Type: text/plain, Size: 309 bytes --]
#!/bin/sh
log=$1 && shift || log=~/Mail/.maillog
tail -n 99 -f "$log" |perl -MEncode -Mopen=OUT,:locale -ln /dev/fd/3 3<<'__EOF__' 2>/dev/null
s/^\s*Subject:\s*// and s/=\?\w\S*[^=]$/$&?=/,
$subj = Encode::decode("MIME-Header", $_) || $_;
/^\s*Folder:\s*(\S+)/ and printf "%-8s\t%s\n", $1, $subj;
__EOF__
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-02-22 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-19 20:51 Alexey Tourbin
2007-02-22 12:17 ` Alexey Tourbin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070222121730.GD3073@localhost.localdomain \
--to=at@altlinux.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git