server Module

Contains the Server class which is effectively the ‘Application’ object.

pymail.server.DEFAULT_CONFIG_FILE = '/etc/pymail/config'

Default config file path

pymail.server.DEFAULT_INTERFACE = '0.0.0.0'

Default interface address

pymail.server.DEFAULT_PIDFILE = '/var/run/pymail.run'

Default path to PID file

pymail.server.DEFAULT_PORT = 25

Default port

pymail.server.GREENPOOL_SIZE = 1000

GreenPool size

exception pymail.server.InitError

Bases: exceptions.RuntimeError

Initialization error

class pymail.server.Server(args)

Bases: object

The Server class is the application singleton

Synopsis:

import server
import sys
srv = server.Server(sys.argv)
srv.start()
__init__(args)

Create a Server object

Parameters:arguments (list) – command line arguments without command (arg 0)
argParser = None

Arguments (argparse.ArgumentParser)

configFile = None

Path to configuration file from command line argument –config <path-to-configfile>

group = None

Groupname to change to

log = None

Logger

pidFile = None

Pid file for detecting double runs

spooler = None

Spooler object

start(forever=True)

Start all services

Parameters:forever (boolean) – wait for servers to stop

For every subsection in the server section a greenlet is spawned which creates an smtp.Smtp object and perpetually calls its start() method in order to accept connections.

user = None

Username to change to