LogMailer Class Reference

List of all members.


Detailed Description

This class offers the possibility to send log files by email.

Therefore an existing smtp server is needed. The to address, the from address, the subject and the message text have to be set by setter methods. There are no default values defined.

Author:
Enrico Hartung <enrico@iptel.org>
License:
GPL

Definition at line 43 of file LogMailer.py.


Public Member Functions

def __init__
def setToAddress
 Set email address for TO header (receiver address).
def setFromAddress
 Set email address for FROM header (sender address).
def setSubject
 Set email subject.
def setMessage
 Set email message body text.
def sendLogFiles
 Compress log files to a tarball and send this tarball as attachment of a multi part email.

Private Member Functions

def __compressFiles
 Uncompress and extract files from a xen package.

Private Attributes

 __smtpServer
 __smtpPort
 __toAddress
 __fromAddress
 __subject
 __message

Static Private Attributes

string __smtpServer = ""
int __smtpPort = 0
string __toAddress = ""
string __fromAddress = ""
string __subject = ""
string __message = ""

Member Function Documentation

def __init__ (   self,
  smtpServer,
  smtpPort = 25,
  toAddress = "",
  fromAddress = "",
  subject = "",
  message = "" 
)

Parameters:
smtpServer ip address of smtp server (string)
smtpPort port of smtp server (int)
toAddress destination address for this mail (string)
fromAddress source address for this mail (string)
subject subject for this mail (string)
message the message body (string)

Definition at line 73 of file LogMailer.py.

def setToAddress (   self,
  toAddress 
)

Set email address for TO header (receiver address).

Parameters:
toAddress receiver address (string)

Definition at line 89 of file LogMailer.py.

def setFromAddress (   self,
  fromAddress 
)

Set email address for FROM header (sender address).

Parameters:
fromAddress sender address (string)

Definition at line 100 of file LogMailer.py.

def setSubject (   self,
  subject 
)

Set email subject.

Parameters:
subject email subject (string)

Definition at line 111 of file LogMailer.py.

def setMessage (   self,
  message 
)

Set email message body text.

Parameters:
message email message text (string)

Definition at line 122 of file LogMailer.py.

def __compressFiles (   self,
  files 
) [private]

Uncompress and extract files from a xen package.

The files are stored in the directory set with setInstanceDir() in a sub directory.

Parameters:
files files to be compressed (list)

Definition at line 133 of file LogMailer.py.

def sendLogFiles (   self,
  logFiles 
)

Compress log files to a tarball and send this tarball as attachment of a multi part email.

Parameters:
logFiles list of log files (path + filename) or a directories (path) (list)

Definition at line 171 of file LogMailer.py.


Member Data Documentation

string __smtpServer = "" [static, private]

Definition at line 46 of file LogMailer.py.

int __smtpPort = 0 [static, private]

Definition at line 49 of file LogMailer.py.

string __toAddress = "" [static, private]

Definition at line 52 of file LogMailer.py.

string __fromAddress = "" [static, private]

Definition at line 55 of file LogMailer.py.

string __subject = "" [static, private]

Definition at line 58 of file LogMailer.py.

string __message = "" [static, private]

Definition at line 61 of file LogMailer.py.

__smtpServer [private]

Definition at line 75 of file LogMailer.py.

__smtpPort [private]

Definition at line 76 of file LogMailer.py.

__toAddress [private]

Definition at line 77 of file LogMailer.py.

__fromAddress [private]

Definition at line 78 of file LogMailer.py.

__subject [private]

Definition at line 79 of file LogMailer.py.

__message [private]

Definition at line 80 of file LogMailer.py.


The documentation for this class was generated from the following file:

Generated on Mon Aug 11 17:28:32 2008 for TestEnv by  doxygen 1.5.5