Perdition ist ein POP3/IMAP Proxy (SSL fähig) der zu mehreren Backend Servern (POP3 und IMAP) sich Verbinden kann. Die Entscheidung zu welchem Server er weiterverbinden soll erfolgt durch eine Tabelle. Perdition unterstützt mehrere Tabellenformate. Ich verwende MySQL.
Installation
apt-get install perdition perdition-mysql
Konfiguration
/etc/default/perdition:
###################################################################### # /etc/sysconfig/perdition (RPM based systems) # /etc/default/perdition (Debian) # # Run time configuration parameters for perdition ###################################################################### # Run perdition # Set to "yes" to run perdition # Set to any other value to not run perdition RUN_PERDITION=yes # Command line parameters to pass to perdition when run in any mode. # This is in addition to any mode specific flags. # That is, it is in addtion to any command line options supplied # by POP3_FLAGS, POP3S_FLAGS, IMAP4_FLAGS or IMAP4S_FLAGS FLAGS= # Run an instance of perdition in POP3 mode # Set to "yes" to run this instance of perdition # Set to any other valye to not run this instance of perdition POP3=yes #Command line parameters to pass to perdition when run in POP3 mode POP3_FLAGS="--ssl_mode tls_listen" # Run an instance of perdition in POP3S mode # Set to "yes" to run this instance of perdition # Set to any other valye to not run this instance of perdition POP3S=yes #Command line parameters to pass to perdition when run in POP3S mode POP3S_FLAGS="--ssl_mode ssl_listen -p 110" # Run an instance of perdition in IMAP4 mode # Set to "yes" to run this instance of perdition # Set to any other valye to not run this instance of perdition IMAP4=yes #Command line parameters to pass to perdition when run in IMAP4 mode IMAP4_FLAGS="--ssl_mode tls_listen" # Run an instance of perdition in IMAP4S mode # Set to "yes" to run this instance of perdition # Set to any other valye to not run this instance of perdition IMAP4S=yes #Command line parameters to pass to perdition when run in IMAP4S mode IMAP4S_FLAGS="--ssl_mode ssl_listen -p 143"
/etc/perdition/perdition.conf:
connection_logging connection_limit 1000 map_library /usr/lib/libperditiondb_mysql.so.0 map_library_opt "localhost:3306:db:table:user:password" username_from_database # Interner IMAP an den weitergeleitet werden soll wenn keine Weiterleitung in der DB ist outgoing_server 127.0.0.1
# Hier das SSL Cert wenn gewünscht. ssl_cert_file /etc/perdition/ssl_perdition.cert ssl_key_file /etc/perdition/ssl_perdition.key
# Perdition an ein Interface binden da er sonst 0.0.0.0 versucht und auf 127.0.0.1 lauscht ja schon unser lokaler bind_address 10.4.4.1
Datenbank
CREATE TABLE `pop3_imap_proxy` ( `user` varchar(128) NOT NULL, `servername` varchar(255) NOT NULL, `port` varchar(8) default NULL, PRIMARY KEY (`user`), KEY `idxtblPerdition_user` (`user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Noch ein restart …
/etc/init.d/perdition restart
Perdition log
tail -f /var/log/syslog | grep perdition