ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] script for procmail log
@ 2006-08-19 20:51 Alexey Tourbin
  2007-02-22 12:17 ` Alexey Tourbin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Tourbin @ 2006-08-19 20:51 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Может кому надо.

~/.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 #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Comm] script for procmail log
  2006-08-19 20:51 [Comm] script for procmail log Alexey Tourbin
@ 2007-02-22 12:17 ` Alexey Tourbin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Tourbin @ 2007-02-22 12:17 UTC (permalink / raw)
  To: community


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-22 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-19 20:51 [Comm] script for procmail log Alexey Tourbin
2007-02-22 12:17 ` Alexey Tourbin

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