File: //etc/fail2ban/action.d/smtp.pyo
�
��_c @ s� d d l Z d d l Z d d l m Z d d l m Z m Z d d l m Z m Z i Z
d e
d <d e
d <i e
d <d
e
d d <d e
d d
<d e
d d <d e
d d <d e
d d <d e f d � � YZ e Z d S( i����N( t MIMEText( t
formatdatet
formataddr( t
ActionBaset
CallingMapsL Hi,
The jail %(jailname)s has been started successfully.
Regards,
Fail2Bant starts? Hi,
The jail %(jailname)s has been stopped.
Regards,
Fail2Bant stopt bans~ Hi,
The IP %(ip)s has just been banned for %(bantime)i seconds
by Fail2Ban after %(failures)i attempts against %(jailname)s.
t heads
Regards,
Fail2Bant tails#
Matches for this ban:
%(matches)s
t matchess#
Matches for %(ip)s:
%(ipmatches)s
t ipmatchess=
Matches for %(ip)s for jail %(jailname)s:
%(ipjailmatches)s
t
ipjailmatchest
SMTPActionc B sP e Z d Z d d
d
d d d d
d � Z d � Z d � Z d � Z d � Z RS( sT Fail2Ban action which sends emails to inform on jail starting,
stopping and bans.
t localhostt Fail2Bant fail2bant rootc
s� t t � � j | | � | � _ | � _ | � _ | � _ | � _ | � _ | � _ t
d � j j d t
j d � f d � � � _ d � _ d S( s� 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).
t jailnamet hostnamet bantimec s � j j j � S( N( t _jailt actionst
getBanTime( ( t self( s /etc/fail2ban/action.d/smtp.pyt <lambda>~ s i N( t superR
t __init__t hostt usert passwordt fromnamet fromaddrt toaddrR
R R t namet sockett gethostnamet message_valuest
norestored(
R t jailR"