]> Pileus Git - ~andy/fetchmail/blob - contrib/gotmail.html.awk
Update German translation.
[~andy/fetchmail] / contrib / gotmail.html.awk
1 #-----------------------------------------------------------------------------
2 #
3 #                           Gotmail - gotmail.awk
4 #
5 #             1999 by Thomas Nesges <ThomasNesges@TNT-Computer.de>
6 #
7 #-----------------------------------------------------------------------------
8
9 #-----------------------------------------------------------------------------
10 # This script is part of GotMail.  It emits html to a specified File
11 # The AWK-Library htmllib has to be properly installed.
12 #-----------------------------------------------------------------------------
13
14 #-----------------------------------------------------------------------------
15 function init_environ()
16 {
17         TextColor = ENVIRON["GOTM_TXCOL"]
18         BackColor = ENVIRON["GOTM_BGCOL"] 
19         MsgColor  = ENVIRON["GOTM_MSGCOL"]
20         ErrColor  = ENVIRON["GOTM_ERRCOL"]
21         TimColor  = ENVIRON["GOTM_TIMCOL"]
22         OutFile   = ENVIRON["GOTM_HTMLFILE"]
23         PrintMsg  = toupper(ENVIRON["GOTM_MSG"])
24         PrintErr  = toupper(ENVIRON["GOTM_ERR"])
25         PrintTim  = toupper(ENVIRON["GOTM_TIM"])
26         PrintHed  = toupper(ENVIRON["GOTM_HED"])
27         
28 }
29 #-----------------------------------------------------------------------------
30
31 #-----------------------------------------------------------------------------
32 {
33   init_environ()
34   if($2!="reading")
35   {
36         if($3=="messages")
37         {
38                 Mails = Mails TableRow("start", MsgColor)       
39                 Mails = Mails TableItem($5) TableItem($7)
40                 Mails = Mails TableItem(Align($2,0)) 
41                 Mails = Mails TableRow("stop")
42         }
43         else if($3=="fetchmail")
44         {
45                 Times = Times TableRow("start", TimColor)
46                 Times = Times TableItem($0)
47                 Times = Times TableRow("stop")
48         }
49         else
50         {
51                 Errors = Errors TableRow("start", ErrColor)     
52                 Errors = Errors TableItem($0)
53                 Errors = Errors TableRow("stop")        
54         }
55   }
56 }
57 #-----------------------------------------------------------------------------
58 END     {
59         Stats = StartPage(Title("Gotmail Stats") Body(BackColor, TextColor))
60         if(PrintHed == "YES")
61         {
62                 Stats = Stats Align(Headline("Gotmail Stats",1),0) 
63                 Stats = Stats Divider Newline
64         }
65         if(PrintMsg == "YES")
66         {
67                 Stats = Stats TableStart(1)
68                 Stats = Stats TableRow("start", MsgColor)
69                 Stats = Stats TableItem(Bold("Account"))
70                 Stats = Stats TableItem(Bold("Server"))
71                 Stats = Stats TableItem(Bold("Mails fetched"))
72                 Stats = Stats TableRow("stop")
73                 Stats = Stats Mails TableEnd Newline Divider Newline
74         }
75
76         if(PrintErr == "YES")
77         {
78                 Stats = Stats TableStart(1) 
79                 Stats = Stats TableRow("start", ErrColor)
80                 Stats = Stats TableItem(Bold("Error Messages"))
81                 Stats = Stats TableRow("stop")
82                 Stats = Stats Errors TableEnd Newline Divider 
83         }
84
85         if(PrintTim == "YES")
86         {
87                 Stats = Stats TableStart(1)
88                 Stats = Stats TableRow("start", TimColor)
89                 Stats = Stats TableItem(Bold("Start/Stop Times"))
90                 Stats = Stats TableRow("stop")
91                 Stats = Stats Times TableEnd Newline Divider
92         }
93
94         Stats = Stats Center("start") "GotMail - 1999 by Thomas Nesges " 
95         Stats = Stats "<ThomasNesges@TNT-Computer.de>" Center("stop") EndPage
96
97         print Stats > OutFile
98         }
99 #-----------------------------------------------------------------------------