'Initialise action.
Parameters
jail : Jail
The jail which the action belongs to.
name : str
Named assigned to the action.
host : str, optional
SMTP host, of host:port format. Default host "localhost" and
port "25"
user : str, optional
Username used for authentication with SMTP server.
password : str, optional
Password used for authentication with SMTP server.
sendername : str, optional
Name to use for from address in email. Default "Fail2Ban".
sender : str, optional
Email address to use for from address in email.
Default "fail2ban".
dest : str, optional
Email addresses of intended recipient(s) in comma space ", "
delimited format. Default "root".
matches : str, optional
Type of matches to be included from ban in email. Can be one
of "matches", "ipmatches" or "ipjailmatches". Default None
(see man jail.conf.5).'

def __init__(self, jail, name, host='localhost', user=None, password=None, sendername='Fail2Ban', sender='fail2ban', dest='root', matches=None):

    super(SMTPAction, self).__init__(jail, name)
    self.host = host
    self.user = user
    self.password = password
    self.fromname = sendername
    self.fromaddr = sender
    self.toaddr = dest
    self.matches = matches
    self.message_values = CallingMap(jailname=self._jail.name, hostname=socket.gethostname, bantime=(lambda : self._jail.actions.getBanTime()))
    self.norestored = 1
