File: gotmail.awk

package info (click to toggle)
fetchmail-ssl 5.9.11-6.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,952 kB
  • ctags: 2,498
  • sloc: ansic: 20,487; sh: 3,574; python: 1,705; yacc: 761; makefile: 682; perl: 640; lex: 258; awk: 124; sed: 93; lisp: 84
file content (62 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#-----------------------------------------------------------------------------
#
#                           Gotmail - gotmail.awk
#
#             1999 by Thomas Nesges <ThomasNesges@TNT-Computer.de>
#
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# This script is part of GotMail. It gives back normal text to the console
#-----------------------------------------------------------------------------

{
  if($2!="reading")
  {
	if(($3=="message") || ($3=="messages"))
	{	
		Mails = Mails sprintf(" %- 40s ",substr($5,1,40))
		Mails = Mails sprintf(" %- 5s ",substr($2,1,5))
		Mails = Mails sprintf(" %- 30s\n",substr($7,1,30))
	}
	else if($3=="fetchmail")
	{
		Started = Started " " $0 "\n"
	}
	else
	{
		Errors = Errors $0 "\n"
	}
  }
}

END	{
		Separator = "-------------------------------------------------------------------------------"
		if(ENVIRON["GOTM_HED"]=="yes")
		{
			print "\n\t\t---------------------------------------"
			print "\t\t| ** GotMail - Stats for fetchmail ** |"
			print "\t\t---------------------------------------"
		}
		if(ENVIRON["GOTM_MSG"]=="yes")
		{
			print Separator 
			print "|    Fetched Mails:"
			print Separator 
			print Mails
		}
		if(ENVIRON["GOTM_ERR"]=="yes")
		{
			print Separator 
			print "|    Error Messages:"
			print Separator 
			print Errors
		}
		if(ENVIRON["GOTM_TIM"]=="yes")
		{
			print Separator
			print "|    Fetchmail started/stoped:"
			print Separator
			print Started
		}
	}