PERDITION(8)
π PERDITION(8) π
okay bestie, welcome to the PERDITION(8) page from the System Manager's Manual β grab a snack, this one's a whole journey πβ¨
π¦ NAME π¦
perdition β a POP3 and IMAP4 proxy server π
π SYNOPSIS π
perdition [options]
perdition.pop3 [options]
perdition.pop3s [options]
perdition.imap4 [options]
perdition.imap4s [options]
perdition.imaps [options]
perdition.managesieve [options]
β¨ DESCRIPTION β¨
so like, perdition lets users connect to a content-free POP3, IMAP4 or ManageSieve server that will redirect them to their real POP3, IMAP4 or ManageSieve server respectively. the way that works is it lets mail retrieval and sieve management for a domain be split across multiple real mail servers on a per user basis π
it can also be used as a POP3, IMAP4 and ManageSieve proxy β especially in firewall applications β and as a method of migrating users to new servers π§
when a connection is made to perdition in POP3 mode, it reads the user's authentication credentials and then refers to its popmap to find the real-server that the user's connection should be forwarded to. a connection is made to the real-server and perdition then passes on the authentication credentials. if authentication is successful then perdition pipes data between the end-user and the real-server. if authentication fails then the real-server connection is closed and the client connection is reset to the state it was in on initial connection. that is, new authentication credentials are expected. no cap π
N.B: No IMAP authentication schemes, other than the LOGIN command are accepted.
when invoked as perdition.pop3, perdition.pop3s, perdition.imap4, perdition.imap4s or perdition.managesieve then perdition will run in POP3, POP3S, IMAP4, IMAP4S or MANAGESIEVE mode respectively, unless overridden on the command line or in the configuration file. π«
perdition.imaps also runs perdition in IMAP4S mode and is provided to get around the truncation of process names in the /proc filesystem on Linux which can cause init scripts to fail to stop perdition correctly. iykyk π
π OPTIONS π
-A|--add_domain STATE[,STATE...][,STRIP_DEPTH]β appends a domain to theUSERbased on the IP address connected to in given state(s). the domain name to append will be the reverse-lookup of the IP address connected to. if there is no reverse lookup for this IP address, then a domain will not be appended. probably the easiest way to enforce this mapping is to add entries to/etc/hosts. β¨
the valid states are servername_lookup, local_authentication, remote_login and all
servername_lookup: append the domain to the username for lookup of username in Popmap. will not take effect ifclient_server_specificationis in effect.local_authentication: append the domain to the username for use in local authentication. only has effect ifauthenticate_inis in effect.remote_login: send the username with the domain appended to the real-server for authentication.all: short-hand for all of above states.
the domain may also have leading levels striped, essentially to convert a hostname to a domain name. the depth of the strip defaults to 1, which would mean that www.au.vergenet.net would become au.vergenet.net. a depth of 2 would cause it to become vergenet.net and so forth. a depth of 0 leaves the name unchanged. the depth and may be specified by appending ,STRIP_DEPTH to the state. for compatibility reasons the default depth is 1.
e.g. all,2
(the default value for add_domain is "")
--authenticate_timeoutβ idle timeout in seconds used while the user is unauthenticated. zero for infinite timeout. β³-a,--authenticate_inβ user is authenticated byperditionbefore connection to back-end server is made. only available ifperditionis compiled with pam support.-B,--no_bind_bannerβ use the hostname derived fromusnamein the banner. ininetdmode this is always the case. in non-inetd mode if this option is not in effect then the IP address used to accept a connection will be used and if-n|--no_loookupis not in effect it will be resolved.-b,--bind_address SERVER[,SERVER...]β bind to these addresses and ports. interfaces with this address. format is as per the--outgoing_serveroption. if the port is omitted, then thelisten_portwill be used.
in non-inetd mode, connections will only be accepted to the listed servers. if un-set connections will be accepted on all addresses on the listen_port.
(default "")
-C|--connection_loggingβ log interaction between clients,perditionand servers during the authentication phase.
Note: -d|--debug must be specified for this option to take effect.
--connect_relog SECONDSβ how often to relog the connection. for use in conjunction with POP and IMAP before SMTP. if zero then the connection will not be reloged.
(default 300)
-c,--client_server_specificationβ allowUSERof the formuser<delimiter>server[:port]to specify the server and port for a user. π-D,--domain_delimiter STRINGβ delimiter between username and domain.
(default "@")
-d,--debugβ turn on verbose debugging. π-e,--explicit_domain STRINGβ with-A, useSTRINGas the default domain rather than deriving from the IP address connected to.
(default NULL)
-F,--log_facility FACILITYβ facility to log to. if the facility has a leading/then it will be treated as a file. if it is"-"or"+"then log to stdout or stderr respectively. otherwise it is assumed to be the name of a syslog facility. seesyslog.conf(5)for valid syslog facility names.
(default "mail")
Notes: if an error occurs before options are read it may be logged to stderr. if stdout or stderr is specified as the facility, then the process will not fork and detach from the terminal.
-f,--config_file FILENAMEβ name of config file to read. command line options override options set in config file.
the default is derived as follows:
- the sysconfig dir (
"/etc/perdition"for example) is checked for<basename>.conf. if this is found then it is used. so ifperditionis invoked as/usr/sbin/perdition.pop3, and/etc/perdition/perdition.pop3.confexists then it will be used. - next the sysconfig dir is checked for
peridtion.<protocol>.conf, where protocol is the ASCII representation of the protocol being used, one of"imap4","imap4s","pop3","pop3s"or"managesieve". so ifperditionis being run in imap4 mode, and/etc/perdition/perdition.imap4.confexists, then it is used. note that the protocol name is lowercase. - next the sysconfig dir is checked for
perdition.conf, if it is found then it is used.
if none of these files are found then no configuration file is used.
-g,--group GROUPβ group to run as.
(default "nobody")
-h,--helpβ display this message π«Ά-I,--capability STRINGβ deprecated in favour of--pop_capabilityand--imap_capability--imap_capability STRINGβ capabilities for IMAP3 and IMAP4S
this string is taken as a string literal that will be returned when a client issues the CAPABILITY command. as such the capabilities should be space delimited. the default is "IMAP4 IMAP4REV1". however, perdition does support RFC 2088 non-synchronising string literals, if the real servers also support this then the capability may be set to "IMAP4 IMAP4REV1 LITERAL+".
if perdition is running with ssl_mode includes to ssl_listen then the capability STARTTLS will be appended to the list of capabilities if it is not already present. similarly this capability will be removed from the list of capabilities if present and perdition is not running with an ssl_mode that includes to ssl_listen.
perdition may also manipulate the capability in IMAP mode to add and remove the LOGINDISABLED capability if the no_login capability is in effect or if the ssl_mode includes tls_listen_force or tls_outgoing_force. π
-i,--inetd_modeβ run in inetd mode-L,--connection_limit LIMITβ maximum number of connections to accept simultaneously. a value of zero sets no limit on the number of simultaneous connections.
(default 0)
-l,--listen_port PORT_NUMBER|PORT_NAMEβ port to listen on.
the default is 110, 995, 143, 993 and 4190 for POP3, POP3S, IMAP4, IMAP4S and MANAGESIEVE mode respectively.
--login_disabledβ do not allow users to log in. also addsLOGINDISABLEDto capability list in IMAP4 and IMAP4S mode. π βοΈ--log_passwd STATEβ log the users password.
(default "never")
fail: log the password on failed connection attempts.ok: log the password on successful connection attempts.never: never log the passwordalways: always log the password
Note: -d|--debug must be specified for this option to take effect.
--lower_case state[,state...]β convert usernames to lower case according the the locale in given state(s). seeA|add_domainfor a description of the states.
(default "(null)")
--managesieve_capability STRINGβ capabilities for ManageSieve
this string is taken as a string literal that will be returned when a client connects or issues the CAPABILITY command. as such the capabilities should be quoted, using escape char \, and double space delimited.
if perdition is running with ssl_mode includes to ssl_listen then the capability STARTTLS will be appended to the list of capabilities if it is not already present. similary this capability will be removed from the list of capabilities if present and perdition is not running with an ssl_mode that includes to ssl_listen.
Examples
two options, each with a value
"\"OPTION1\" \"VALUE\" \"OPTION2\" \"VALUE\""
two options, but only one with a value
"\"OPTION1\" \"OPTION2\" \"VALUE\""
β¦and the default for that one is genuinely unhinged, so here it is in full, no edits:
(default ""IMPLEMENTATION" "perdition" "SIEVE" "comparator-i;
octet comparator-i;ascii-casemap fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date" "SASL" "PLAIN" "NOTIFY" "mailto"
"VERSION" "1.19-rc2"")
-M,--map_libraryFILENAME β the library perdition opens to get the β¨functionsβ¨ that look up which server a user belongs to. If you hand it an empty string (""), then no library gets opened at all, which means no lookup happens, periodt. (default/usr/lib/libperditiondb_gdbm.so.0)-m,--map_library_optSTRING β a string you yeet into the database access function that the library frommap_libraryprovides. What happens to this string is entirely up to the library, so don't come for perdition about it. Peepperditiondb(5)for how each individualmap_libraryhandles it. (default"")--no_daemonβ do NOT detach from the terminal, bestie. You stay right here, in this window, with me. Also: this makes zero sense ifinetd_modeis in effect. π«Ά-n,--no_lookupβ turns off host and port lookup, and it impliesno_bind_banner. Big heads up tho: if you enable this, perdition will not resolve the host or port names that popmap lookups hand back, so your popmap must return actual IP addresses and port numbers. No hostnames, no vibes-based guessing. π-O,--ok_lineβ use STRING as the OK line that gets sent to the client. This gets overridden byserver_resp_line. The literalOKwill be prepended to STRING, and in IMAP mode a tag also gets prepended to the string. (defaultYou are so inβ iconic behaviour honestly π)--server_ok_lineβ deprecated, and it might get removed in a future release. Useserver_resp_lineinstead, fr fr. What it does: if authentication with the real-server succeeds, then send the server's+OKline to the client instead of generating one.-o,--server_resp_lineβ if authentication with the real-server succeeds, send the server's response line to the client instead of generating one. That's the whole thing. Clean. β¨-P,--protocolPROTOCOL β which protocol we're speaking. (defaultPOP3) Available protocols:POP3, POP3S, IMAP4, IMAP4S-p,--outgoing_portPORT β the default real-server port. Scroll up tolisten_portfor the defaults, bestie.-s,--outgoing_serverSERVER[,SERVER...] β defines a server to use when a user isn't in the popmap. Format isservername|ip_address[:portname|portnumber]. You can stack multiple servers by separating them with a,. And if you do list multiple servers, they get used in a round robin fashion. (default"")--pid_fileFILENAME β path for the pidfile. It must be a full path starting with a/. Now listen: so that perdition can remove the pid file after the owner of the perdition process has been changed to a non-root user, you're advised to specify a pid file in a subdirectory of the system var state directory (usually/var/run). That subdirectory should be unique to this perdition invocation, and it will be created, with its owner and permissions set so perdition can subsequently remove the pid file. Empty means no pid file. Not used in inetd mode. (default<var_state_dir>/<basename>/<basename>.pid)--pop_capabilitySTRING β capabilities for POP3 and POP3S. π
The capabilities should be delimited by a . spaces. Up until perdition 1.18 the delimiter was two spaces, " ". That's deprecated now, and it is not valid to mix delimiters. Pick one and commit, okay?
The default capability is UIDL.USER.
If perdition is running with an ssl_mode that includes ssl_listen, then the capability STLS will be appended to the list of capabilities if it is not already present. Similarly, this capability will be removed from the list of capabilities if it is present and perdition is not running with an ssl_mode that includes ssl_listen. Symmetry, we love to see it. π¦
-S,--strip_domainSTATE[,STATE] β allowsUSERof the formuser<delimiter>domain, where<delimiter>domaingets stripped off in the given state(s). Seeadd_domainfor a description of the states. βοΈ-t,--timeoutSECONDS β idle timeout for the post-authentication phase. Zero means infinite timeout. (default1800)--tcp_keepaliveβ turns on TCP Keep-Alive (see RFC 1122). This switches on TCP Keep-Alive for both incoming connections from clients and the connections made out to the real POP3, IMAP4 or managesieve server. (default is disabled)-u,--usernameUSERNAME β the user to run as. (defaultnobody)-U,--username_from_databaseβ if the servername in the popmap is specified in the formuser<delimiter>domain, then use the username given by the servername. And heads up: if a servername is given in this form, then the domain will be used as the server to connect to, regardless of this option. Like, it just does that. π«-q,--quietβ only log errors. Gets overridden bydebug.--query_keyFORMAT[,FORMAT...] β instead of using the username as supplied by the end user (possibly modified bystrip_domain), use the formats you specify here. The formats get used in order to query the popmap, and the result from the first successful lookup is the one that wins. The format is a string of characters, delimited by,. These escape codes are valid:\U: Long Username, the entire string supplied by the end user, less any effects of--strip_domain.\u: Short Username, the portion Long Username before the domain delimiter.\D: Domain Delimiter, as specified by--domain_delimiter\d: Domain the portion Long Username after the domain delimiter.\i: Source IP address of the connection\I: Destination IP address of the connection\p: Source port of the connection\P: Destination port of the connection\\: Literal \
Because , is the delimiter between formats, it cannot appear within a format. Every other character that isn't one of the escape codes above and isn't , is treated as a literal.
π Examples π
Use the supplied username, the default behaviour
\U
Use the user portion of the supplied username, and if this doesn't work, try the domain portion of the supplied username preceded by the domain delimiter
\u,\D\d
Use the destination IP address
\I
Escape codes interspersed with literals
\u\da_domain,\da_domain
The options below relate to SSL/TLS support. They are not available if perdition is compiled without SSL support. Just so you know before you get attached. π₯²
--ssl_modeMODE β use SSL and/or TLS for the listening and/or outgoing connections. It's a comma delimited list of:none,ssl_listen,ssl_outgoing,ssl_all,tls_listen,tls_outgoing,tls_all,tls_listen_force,tls_outgoing_force,tls_all_force. TLS is defined in RFC 2595. (default(null))none: do not use SSL or TLS for any connections. This is the same as providing no option at all β it's the default, bestie.ssl_listen: when listening for incoming connections, they will be treated as SSL connections.ssl_outgoing: use SSL to connect to real pop/imap servers.ssl_all: short-hand forssl_listen,ssl_outgoing.tls_listen: when listening for incoming connections, they will be treated as TLS connections.tls_outgoing: use TLS to connect to real pop/imap servers.tls_all: short-hand fortls_listen,tls_outgoing.tls_listen_force: do not accept plain text authentication. In IMAP4 and IMAP4S mode, theLOGINDISABLEDcapability until TLS has been initialised by the client issuing aSTARTTLS. In all modes, mode plain-text authentication is ignored. Also setstls_listen. πtls_outgoing_force: do not send authentication information if TLS cannot be negotiated. Also setstls_outgoing. πtls_all_force: short-hand fortls_listen_force,tls_outgoing_force.
--ssl_ca_chain_fileβ sets the optional all-in-one file where you can assemble the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate. This starts with the issuing CA certificate of the"ssl_cert_file"certificate and can range up to the root CA certificate. Such a file is simply the concatenation of the various PEM-encoded CA Certificate files, usually in certificate chain order. Overridesssl_ca_fileandssl_ca_path. (default NULL, no CA certificate will be used)--ssl_ca_fileFILENAME β Certificate Authorities to use when verifying certificates of real servers. Used for SSL or TLS outgoing connections. When building the Certificate Authorities chain,ssl_ca_fileis used first, if set, and thenssl_ca_path, if set. SeeSSL_CTX_load_verify_locations(3)for format details. (default/etc/perdition/perdition.ca.pem)--ssl_ca_pathPATHNAME β Certificate Authorities to use when verifying certificates of real servers. Used for SSL or TLS outgoing connections. You should run"openssh c_rehash"in this directory when new certificates are added. When building the Certificate Authorities chain,ssl_ca_fileis used first, if set, and thenssl_ca_path, if set. SeeSSL_CTX_load_verify_locations(3)for details. (default/etc/perdition/perdition.ca/)--ssl_ca_accept_self_signedβ accept self-signed certificate authorities. π--ssl_cert_fileFILENAME β certificate to use when listening for SSL or TLS connections. Should be in PEM format. (default/etc/perdition/perdition.crt.pem)--ssl_dh_params_fileFILENAME β Diffie-Hellman parameters to use when offering EDH ciphersuites to clients. Should be in PEM format. (default: look for DH parameters inssl_cert_file)--ssl_cert_accept_self_signedβ accept self-signed certificates. Used for SSL or TLS outgoing connections.--ssl_cert_accept_expiredβ accept expired certificates. This includes server certificates and certificate authority certificates. Used for SSL or TLS outgoing connections. π«£--ssl_cert_accept_not_yet_validβ bestie, this one lets you accept certificates that are not yet valid β like, they exist, they're just not in their era yet. Covers server certs and certificate authority certs. For SSL or TLS outgoing connections only. π¦--ssl_cert_verify_depthDEPTH β how deep down the chain we recurse when verifying certs. Chain Depth, fr fr. For SSL or TLS outgoing connections.- default:
9
- default:
--ssl_key_fileFILENAME β the public key we use when we're the one listening for SSL or TLS connections. Should be PEM format, no exceptions. π- default:
"/etc/perdition/perdition.key.pem"
- default:
--ssl_listen_ciphersSTRING β cipher list for when you're listening for SSL or TLS connections, as perciphers(1). If it's empty ("") then openssl's default gets used instead. iykyk.- default:
""
- default:
--ssl_outgoing_ciphersSTRING β same deal but for when you're making outgoing SSL or TLS connections, as perciphers(1). Empty ("") means openssl's default steps in.- default:
""
- default:
--ssl_no_cert_verifyβ do NOT cryptographically verify the certificates. For SSL or TLS outgoing connections. π--ssl_no_client_cert_verifyβ do NOT cryptographically verify the end-user's certificate. For SSL or TLS outgoing connections.--ssl_no_cn_verifyβ do NOT verify the real-server's common name against the name used to connect to the server. For SSL or TLS outgoing connections.--ssl_passphrase_fdN β the file descriptor we read the certificate passphrase from. Only the first line gets read, periodt. You may only specify one ofssl_passphrase_fdandssl_passphrase_fileβ pick a lane.- default:
0
- default:
--ssl_passphrase_fileFILENAME β a file to read the certificate passphrase from. Again, only the first line gets read. And again, only one ofssl_passphrase_fdandssl_passphrase_filemay be specified.- default:
NULL, no file
- default:
--ssl_listen_ciphersSTRING β cipher list when listening for SSL or TLS connections, as perciphers(1). Empty ("") β openssl's default. (Yes bestie, this one showed up twice in the original and we are NOT skipping it. Every detail stays. π )- default:
""
- default:
--ssl_outgoing_ciphersSTRING β cipher list when making outgoing SSL or TLS connections, as perciphers(1). Empty ("") β openssl's default.- default:
""
- default:
--ssl_no_cert_verifyβ don't cryptographically verify the certificates. SSL or TLS outgoing connections.--ssl_no_client_cert_verifyβ don't cryptographically verify the end-user's certificate. SSL or TLS outgoing connections.--ssl_no_cn_verifyβ don't verify the real-server's common name against the name used to connect to the server. SSL or TLS outgoing connections.--ssl_passphrase_fdN β file descriptor to read the certificate passphrase from. First line only. Only one ofssl_passphrase_fdandssl_passphrase_filemay be specified.- default:
0
- default:
--ssl_listen_min_proto_versionPROTOCOL_VERSIONS β the minimum SSL/TLS protocol version permitted when accepting incoming connections. May not be empty (""). π«- valid protocol versions are:
sslv3,tlsv1,tlsv1.1andtlsv1.2 - default:
"tlsv1"
- valid protocol versions are:
--ssl_outgoing_min_proto_versionPROTOCOL_VERSIONS β the minimum SSL/TLS protocol version permitted when making outgoing connections. May not be empty ("").- valid protocol versions are:
sslv3,tlsv1,tlsv1.1andtlsv1.2 - default:
"tlsv1"
- valid protocol versions are:
--ssl_listen_max_proto_versionPROTOCOL_VERSIONS β the maximum SSL/TLS protocol version permitted when accepting incoming connections. If it's empty ("") then openssl's default gets used.- valid protocol versions are:
sslv3,tlsv1,tlsv1.1andtlsv1.2 - default:
""
- valid protocol versions are:
--ssl_outgoing_max_proto_versionPROTOCOL_VERSIONS β the maximum SSL/TLS protocol version permitted when making outgoing connections. Empty ("") β openssl's default.- valid protocol versions are:
sslv3,tlsv1,tlsv1.1andtlsv1.2 - default:
""
- valid protocol versions are:
--ssl_listen_compressionβ allow SSL/TLS compression when accepting incoming connections.--ssl_outgoing_compressionβ allow SSL/TLS compression when making outgoing connections.--ssl_no_cipher_server_preferenceβ disable SSL/TLS cipher server preference when accepting incoming connections.
Notes, bestie, read these:
- Default value for binary flags is off.
- If a string argument is empty (
"") then the option will not be used, unless noted otherwise. - The defaults given refer to the values if perdition is compiled with
--sysconfdir=/etc, as it would be for many binary distributions. For the actual defaults of a given perdition binary, runperdition --help. π
ποΈ USER DATABASE (POPMAP) ποΈ
For the tea on how users get resolved to a host and port, plus everything about the -M|--map_library and -m|--map_library_opt flags, go read perditiondb(5). It's giving required reading. π
Note that by specifying a map library, no map lookups will occur and all connections will use the -s|--outgoing_server. Which means perdition can be configured as a "pure proxy". slay.
π STAND-ALONE MODE π
Normally perdition binds to a port and listens for connections. The default port is 110 in POP3 mode and 143 in IMAP4 mode, and you can pick a different one with the -l|--listen_port command line option. In this mode perdition forks to manage clients. Fork fork fork. π΄
π Stand-Alone Mode: Debian and RPM Installation π
In the Debian and RPM distributions, perdition can be started and stopped in stand-alone mode using:
/etc/init.d/perdition start
/etc/init.d/perdition stop
Editing /etc/sysconfig/perdition (RPM) or /etc/default/perdition (Debian) lets you control whether perdition will be started in POP3 mode, IMAP4 mode, both, or neither. Main character energy is choosing.
The syntax for this file is:
RUN_PERDITION=[yes|no]
FLAGS="flags"
POP3=[yes|no]
POP3_FLAGS="flags"
POP3S=[yes|no]
POP3S_FLAGS="flags"
IMAP4=[yes|no]
IMAP4_FLAGS="flags"
IMAP4S=[yes|no]
IMAP4S_FLAGS="flags"
The file is sourced into the init script, so normal bash syntax applies. Blank lines are ignored, and so is anything after a # on a line. π§
e.g.
RUN_PERDITION=yes
POP3=on
POP3_FLAGS="--ssl_mode tls_listen"
POP3S=on
IMAP4_FLAGS="--ssl_mode tls_listen"
IMAP4=on
POP3S_FLAGS="--ssl_mode ssl_listen -p 110"
IMAP4S=on
IMAP4S_FLAGS="--ssl_mode ssl_listen -p 143"
π INETD MODE π
Perdition can be used in conjunction with inetd. This lets perdition benefit from tcpd, where access can be controlled to some extent using /etc/hosts.allow and /etc/hosts.deny. Sample /etc/inetd.conf entries follow:
pop3 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/perdition.pop3 -i
pop3s stream tcp nowait root /usr/sbin/tcpd /usr/sbin/perdition.pop3s -i
imap2 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/perdition.imap4 -i
imaps stream tcp nowait root /usr/sbin/tcpd /usr/sbin/perdition.imap4s
-i
inetd should then be restarted. Don't forget the restart, bestie, it will simply not work and you will be sad. π
π LOCAL AUTHENTICATION π
If perdition has been compiled against libpam, it may be set up to authenticate the user locally once the USER and PASS commands are entered, by specifying the -a|--authenticate_in option on the command line. This authentication happens before the connection to the foreign server is made, and it must succeed for a connection to the foreign server to be made. No pass, no proxy. π«Ά
This authentication uses PAM, and a sample pam configuration file for perdition can be found in etc/pam.d/perdition in the source tree. That one should be dropped into /etc/pam.d. π
βοΈ DOMAIN DELIMITER βοΈ
A multi character domain delimiter can be set using the -d|--domain delimiter option. This sets the delimiter used in conjunction with the -S|--strip_domain and -c|--client_server_specification options. Teamwork, honestly.
πΈ USER PORT SPECIFICATION πΈ
If perdition is invoked with the -c|--client_server_specification flag, then the user may optionally specify the server and port that perdition should connect to for the client, using the syntax user<delimiter>host[:port]. The user gets to choose their own destiny. iconic.
Example:
IMAP4
0 login henry@that.host:143
POP3
user james@other.host
β³ IDLE TIMEOUTS β³
Perdition allows two idle timeouts to be configured. --authentication_timeout is used before the user has been successfully authenticated with the back-end server. And after that, --timeout is used. Two eras, two timeouts. β¨
The default value for both timeouts is 1800. A timeout value of 0 means the timeouts are disabled, and clients and back-end servers can idle indefinitely β though in practice a TCP timeout will be in effect. π΄
π΅οΈ LOOP DETECTION π΅οΈ
The greeting that perdition displays when accepting an incoming connection is "+OK POP3 Ready <hostname>" or "* OK IMAP4 Ready <hostname>" in POP3 and IMAP4 modes respectively. If, when perdition connects to the back-end server, the greeting string matches the greeting string of the perdition process making the connection, then it is assumed that perdition is connecting to itself, and a "Re-Authentication Failure" is returned to the client. Not the self-love we were rooting for. π
π CONFIGURATION FILE π
The format of a line of the configuration file is:
<key> <value>
Key is either a short or long option as per perdition -h|--help, without the leading - or --. Blank lines are ignored, as is anything including and after a # (hash) on a line. If a \ precedes a new line then the lines will be concatenated. If a \ precedes any other character, including a # (hash), it will be treated as a literal. Anything inside single quotes (') will be treated as a literal. Anything other than a (') inside double quotes (") will be treated as a literal. Whitespace in keys must be escaped or quoted. Whitespace in values need not be escaped or quoted. π
Options that do not make sense in the configuration file, such as h|help and f|config_file, are ignored. Options specified on the command line override the options in this file. Command line wins, always. π
Example configuration File.
# perdition.conf
l 110 #Short option used as key
group mail #Long option used as key
a #Option with no argument
π¦ POP BEFORE SMTP π¦
Okay bestie, so Perdition supports POP before SMTP in both POP3 and IMAP4 mode by logging the following messages:
When a user connects:
Connect: <from_to> [inetd_pid=<pid>]
When a user is authenticated:
Auth: <from_to> client-secure=SECURE_STATUS
authorisation_id="<authorisation_id>"
authentication_id="<authentication_id>" password="<password>"
server="<servername>:<port>" protocol=<protocol> server-
secure=SECURE_STATUS status=failed...|ok
When a user disconnects:
Close: <from_to> authorisation_id="<authorisation_id>"
authentication_id="<authentication_id>" received=<bytes> sent=<bytes>
Where:
from_tois<src_ip_address>:<src_port>-><dest_ip_address>:<dest_port>SECURE_STATUSis one of:ssl: Uses SSL/TLS from the beginning of the connection. That is, IMAPS or POP3S.starttls: A STARTTLS or STLS command has been issued and SSL/TLS was subsequently negotiated.
Note that if the message is logged before SSL/TLS negotiation completed then the status will beplaintext. Even if the connection would have usedstarttlsif successful. For example, if connecting to the real-server fails.
plaintext: SSL/TLS is not in use.
β¨ LOGGING β¨
By default, logs are logged via syslog using the facility mail. You should inspect /etc/syslog.conf to find where these logs are written. Under Debian these logs will be written to /var/log/mail.log, under Red Hat 7.x these logs will be written to /var/log/maillog, under Solaris 8 these logs will be written to /var/log/syslog. Normally each session will have two perdition log entries. Logs are prepended, depending on syslog with the date, host, and perdition[<pid>]:.
Fatal errors are also logged with a priority of err. In stand-alone mode the startup parameters are logged on initialisation. If the -d|--debug command line option or configuration file directive is used then startup parameters are logged regardless of other configuration directives and in both stand-alone and identd mode additional debugging messages are logged with a priority of debug. As the flag implies, this is useful for debugging but is probably too verbose for production systems. If the -q|--quiet command line option or configuration file directive is used, only errors will be logged. This is overridden by -d|--debug.
π SSL/TLS Support π
Perdition supports using SSLv2 and SSLv3 to encrypt sessions between end users and perdition and sessions between perdition and real servers. SSL may be used for either, both or none of these classes of connections.
The public key and certificate files should be in PEM format. As a quick guide, the files may be generated using openssl with the following command:
openssl req -new -x509 -nodes \
-out perdition.crt.pem -keyout perdition.key.pem -days 365
π Mixed-mode configurations π
Perdition can be used in a mixed-mode where the end-users connect to perdition using SSL and then perdition connects to the real-servers using palin-text. Or vice versa. This is achieved using --ssl_mode and at least one of -l|--listen_port and -p|--outgoing_port. When running this kind of configuration -P|--protocol values of IMAP and IMAPS are equivalent and likewise POP3 and POP3S are equivalent.
For example, to accept connections from end-users using POP3S on port 995 (the default POP3S port) and communicate with the real-servers using POP3 on port 110 (the default POP3 port) the following are equivalent.
--ssl_mode=ssl_listen --protocol=POP3S --outgoing_port=110
and
--ssl_mode=ssl_listen --protocol=POP3 --incoming_port=995
Perdition is not able to listen for connections from end-users using POP3/POP3S and communicate with real-servers using IMAP4/IMAP4S or vice-versa.
π FILES π
/etc/perdition/perdition.conf
π₯ SEE ALSO π₯
π AUTHORS π
Lead
- Horms
<horms@verge.net.au>
Perditiondb Library Authors
- Frederic Delchambre
<dedel@freegates.be>(MySQL) - Chris Stratford:
<chriss@uk.uu.net>(LDAP and Berkeley DB) - Nathan Neulinger
<nneul@umr.edu>(NIS)
Contributing Authors
- Daniel Roesen
<droesen@entire-systems.com> - Clinton Work
<work@scripty.com> - Youri
<ya@linkline.be> - Jeremy Nelson
<jnelson@optusnet.com.au> - Wim Bonis
<bonis@solution-service.de> - Arvid Requate
<arvid@Team.OWL-Online.DE> - Mikolaj J. Habryn
<dichro@rcpt.to> - Ronny Cook
<ronny@asiaonline.net> - Geoff Mitchell
<g.mitchell@videonetworks.com> - Willi Langenberger
<wlang@wu-wien.ac.at> - Matt Prigge
<mprigge@pobox.com> - Wolfgang Breyha
<wolfgang.breyha@uta.at>
And that's the whole page, bestie! This was perdition(8), dated 12th June 2003. Go forth and proxy securely π
β¨π«Ά
π¦ where this page comes from
- alpine 3.22: perdition-doc 2.2-r6 Β· GPL-2.0-or-later
- alpine 3.23: perdition-doc 2.2-r6 Β· GPL-2.0-or-later
- alpine 3.24: perdition-doc 2.2-r6 Β· GPL-2.0-or-later
- debian bookworm: perdition 2.2-3.2+b1
- debian trixie: perdition 2.2-3.4+b1
- ubuntu jammy: perdition 2.2-3.1build3
- ubuntu noble: perdition 2.2-3.3ubuntu3
- ubuntu questing: perdition 2.2-3.4
- ubuntu resolute: perdition 2.2-4
- ubuntu stonking: perdition 2.2-5ubuntu2
- Copyright (C) 1999-2005 Horms <horms@verge.net.au>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms