Proxy IMAP/POP/SMTP securisé avec Perdition, Postfix et SASL



Similar documents
Configure a Mail Server

Linux Administrator (Advance)

Repris de : Version Debian (de base)

Mail Server Administration

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

Setup Local Mail Server Using Postfix, Dovecot And Squirrelmail On CentOS 6.5/6.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";! SET time_zone = "+00:00";!

Postfix. by Rod Roark

Brest. Backup : copy flash:ppe_brest1 running-config

Outlook Start Outlook, and click on mserver.wlu.ca. 2. From the Tools menu, choose Options

Math SMTP Server Configuration

Update Instructions

Surviving Cyrus SASL

How to configure your client

Client configuration and migration Guide Setting up Thunderbird 3.1

Open Thunderbird. To set up an account in Thunderbird, from the Tools menu select Account Settings; choose account; then click Next.

NeoMail Guide. Neotel (Pty) Ltd

secure for mobile devices

Exchange Outlook Profile/POP/IMAP/SMTP Setup Guide

Warwick The Switch Over to

Client Configuration Secure Socket Layer. Information Technology Services 2010

Outlook Express. Make Changes in Red: Open up Outlook Express. From the Menu Bar. Tools to Accounts - Click on. User Information

ULTEO OPEN VIRTUAL DESKTOP V4.0

Update Instructions

Memo bconsole. Memo bconsole

Outlook Express. Make Changes in Red: Open up Outlook Express. From the Menu Bar. Tools to Accounts - Click on Mail Tab.

Implementing a SPAM and virus scanning mail server using RedHat Linux 8.0

Technical Service Bulletin

Toll Free: International:

AX Series with Microsoft Exchange Server 2010

CipherMail Gateway Installation Guide

Preparing your Domain to transfer from Go Daddy

Postfix Configuration and Administration

Implementing a SPAM and virus scanning mail server using RedHat Linux 8.0

OS9 UNIX help man chd cd del rm copy cp makdir mkdir OS9 is case sensitive!! attr chmod deldir rmdir pd pwd list more

AX Series with Microsoft Exchange Server 2010

1. Open the preferences screen by opening the Mail menu and selecting Preferences...

debops.postfix documentation

Sending an Message from a Process

Issue 2EN. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Appendix. Web Command Error Codes. Web Command Error Codes

How to configure your Windows PC post migrating to Microsoft Office 365

Configuration Manual for Lime Domains

EventTracker Windows syslog User Guide

Instructions. Outlook (Windows) Mail (Mac) Webmail Windows Live Mail iphone 4, 4S, 5, 5c, 5s Samsung Galaxy S4 BlackBerry

IOS 8: Configure IMAP/POP/SMTP

Installation. Installation centreon + nagios mai LISTE DES PRE-REQUIS. Nagios/centreon Paquets divers. 1.1.

Migration Manual (For Outlook 2010)

Outlook Express. Make Changes in Red: Open up Outlook Express. From the Menu Bar. Tools to Accounts - Click on Mail Tab.

Standard Mailbox Software Setup Guide

Installing Dspace 1.8 on Ubuntu 12.04

CHARTER BUSINESS custom hosting faqs 2010 INTERNET. Q. How do I access my ? Q. How do I change or reset a password for an account?

How to setup your iphone client

Mozilla Thunderbird: Setup & Configuration Learning Guide

StarterPlus Mailbox Software Setup Guide

How To Configure Using Different Clients

Update Instructions

Aucune validation n a été faite sur l exemple.

Migration Manual (For Outlook Express 6)

IRMACS Setup. Your IRMACS is available internally by the IMAP protocol. The server settings used are:

Setup Guide. network support pc repairs web design graphic design Internet services spam filtering hosting sales programming

Protect your CollabNet TeamForge site

Databases and SQL. Homework. Matthias Danner. June 11, Matthias Danner Databases and SQL June 11, / 16

How to Setup your Account -Apple Mail for Mac OS X 1- Open Mail

MPP Manager Users Guide

Update Instructions

How To Send Mail From A Macbook Access To A Pc Or Ipad With A Password Protected Address (Monroe Access) On A Pc (For Macbook) Or Ipa (For Ipa) On Pc Or Macbook (For

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Exchange (UCMAIL) Configuration Procedures

Set up Outlook for your new student e mail with IMAP/POP3 settings

White Paper. Installation and Configuration of Fabasoft Folio IMAP Service. Fabasoft Folio 2015 Update Rollup 3

SETUP INSTRUCTIONS

TP : Système de messagerie - Fichiers properties - PrepareStatement

Logging into the control panel

Android: Configure IMAP/POP/SMTP

Webmail. Setting up your account

Configuring Outlook to send mail via your Exchange mailbox using an alternative address

SCOoffice Mail Connector For Microsoft Outlook. Installation Guide Outlook 2002

Before starting to use the new system you will need to know the password to your e-wire account.

How to configure your Desktop Computer and Mobile Devices post migrating to Microsoft Office 365

Installation troubleshooting guide

Set Up Setup with Microsoft Outlook 2007 using POP3

SIOS Protection Suite for Linux v Postfix Recovery Kit Administration Guide

Configuring MailArchiva with Insight Server

How to Pop to Outlook

Introduction Les failles les plus courantes Les injections SQL. Failles Web. Maxime Arthaud. net7. Jeudi 03 avril 2014.

OpenSMTPD: we deliver

Installation Guide for AmiRNA and WMD3 Release 3.1

Configuration Guide. SafeNet Authentication Service. SAS Agent for AD FS

FreeRADIUS server. Defining clients Access Points and RADIUS servers

Surviving Cyrus SASL

JAVAMAIL API - SMTP SERVERS

3. On the Accounts wizard window, select Add a new account, and then click Next.

Mondopad v1.6. Quick Start

Configuring an Client to Connect to CASS Mail Servers

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Quick Start Guide. Your New Account

Updated: 7/10/2013 Author: Tim Unten

Configuring Single Sign-On. Installing the SonicWALL SSO Agent

Transcription:

Proxy IMAP/POP/SMTP securisé avec Perdition, Postfix et SASL Installation de perdition : apt-get install perdition openssl Généré 1 clé privé et 1 certificat auto-signé : cd /etc/perdition openssl genrsa -out cleprivemailauth.key 2048 openssl req -new -key cleprivemailauth.key -out certificatmailauth.csr openssl x509 -req -days 365 -in certificatmailauth.csr -signkey cleprivemailauth.key -out certificatmailpublic.crt Configuration IMAPS : nano /etc/perdition/perdition.imap4s.conf outgoing_server adresseipserveurmail bind_address adresseipserveurproxy outgoing_port 143 listen_port 993 log_facility local5 no_lookup #On ne fait pas de lookup sur le serveur timeout 60 imap_capability "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA ACL ACL2=UNION STARTTLS" ssl_mode ssl_listen ssl_cert_file /etc/perdition/certificatmailpublic.crt ssl_key_file /etc/perdition/cleprivemailauth.key ssl_no_cert_verify #On ne vérifie pas la cryptographie inclus dans le certificat du backend ssl_no_client_cert_verify #On ne vérifie pas la cryptographie inclus dans le certificat du client ssl_no_cn_verify #On ne vérifie pas le nom inclus dans le CN du certificat du backend ssl_ca_accept_self_signed#pour accepter les certificat auto-signé ssl_cert_accept_self_signed #Pour accepter les certificat auto-signé ok_line Connecter! #Mesage de connexion Configuration POPS : nano /etc/perdition/perdition.pop3s.conf outgoing_server adresseipserveurmail bind_address adresseipserveurproxy outgoing_port 110 listen_port 995 log_facility local5 no_lookup //On ne fait pas de lookup sur le serveur timeout 60 ssl_mode ssl_listen ssl_cert_file /etc/perdition/certificatmailpublic.crt

ssl_key_file /etc/perdition/cleprivemailauth.key ssl_no_cert_verify #On ne vérifie pas la cryptographie inclus dans le certificat du backend ssl_no_client_cert_verify #On ne vérifie pas la cryptographie inclus dans le certificat du client ssl_no_cn_verify #On ne vérifie pas le nom inclus dans le CN du certificat du backend ssl_ca_accept_self_signed#pour accepter les certificat auto-signé ssl_cert_accept_self_signed #Pour accepter les certificat auto-signé ok_line Connecter! #Mesage de connexion Configuration IMAP : nano /etc/perdition/perdition.imap4.conf outgoing_server adresseipserveurmail bind_address adresseipserveurproxy outgoing_port 143 listen_port 143 log_facility local5 no_lookup timeout 60 imap_capability "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA ACL ACL2=UNION STARTTLS" ok_line Connecter! #Mesage de connexion Activer/Désactiver les services : nano /etc/default/perdition POP3=no/yes POP3S=no/yes IMAP4=no/yes IMAP4S=no/yes MANAGESIEVE=no/yes /etc/init.d/perdition restart Vérifiez les port d'écoute : lsof -i -n -P grep perdition //ex : perdition 4364 nobody 4u IPv4 10395 TCP 192.168.0.12:143 (LISTEN) Test du port IMAPS : openssl s_client -connect ipserveurproxymail:993 //Résultat : * OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR COMPRESS=DEFLATE] perdition ready on imap.domain.tld 0002eec5 A login login@domain.tld password A OK [CAPABILITY IMAP4rev1 ACL BINARY CATENATE CHILDREN CONDSTORE ENABLE ESEARCH ESORT I18NLEVEL=1 ID IDLE LIST-EXTENDED LIST-STATUS LITERAL+ LOGIN- REFERRALS MULTIAPPEND NAMESPACE QRESYNC QUOTA RIGHTS=ektx SASL-IR SEARCHRES SORT THREAD=ORDEREDSUBJECT UIDPLUS UNSELECT WITHIN XLIST] LOGIN completed

Mode Debug : log_passwd always connection_logging debug Bug de connexion IMAP SSL sous Thunderbird : //Sous Thunderbird "Ajouter un compte de messagerie" il faut commencer par connecter le compte IMAP sans SSL puis changer après dans "paramètre des compte" le port 143 non sécurisé en 993 sécurisé Installation Postfix : apt-get install postfix //Choisir le mode "pas de configuration" cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf nano /etc/postfix/main.cf mydomain = mondomaine.ext myhostname = mailproxyhostname.mondomaine.ext mydestination = "" relayhost = adresseipserveurmailsmtp mynetworks = 127.0.0.0/8 adresseipreseau/nboctetnet mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all local_recipient_maps = Installation SASL : apt-get install libsasl2-2 libsasl2-modules sasl2-bin nano /etc/postfix/master.cf smtp inet n - y - - smtpd nano /etc/default/saslauthd START=yes MECHANISMS="sasldb" //remplacer la ligne OPTIONS="-c -m /var/run/saslauthd" par: OPTIONS="-r -c -m /var/spool/postfix/var/run/saslauthd" mkdir /var/spool/postfix/var mkdir /var/spool/postfix/var/run mkdir /var/spool/postfix/var/run/saslauthd chown -R root:sasl /var/spool/postfix/var/run/saslauthd rm -fr /var/run/saslauthd //ajout de SASL au groupe POSTFIX adduser postfix sasl /etc/init.d/saslauthd restart

nano /etc/postfix/main.cf broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_r ecipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtp_sasl_security_options= smtp_sasl_mechanism_filter = plain,login Authentification SMTP SASL et PAM stocké sur BDD MySQL entre client mail et serveur proxy : apt-get install mysql-server ibsasl2-modules-sql libpam-mysql CREATE DATABASE postfix CHARACTER SET utf8 CREATE TABLE `mailbox` ( `username` varchar(255) NOT NULL default '', `password` varchar(255) NOT NULL default '', `name` varchar(255) NOT NULL default '', `maildir` varchar(255) NOT NULL default '', `quota` int(10) NOT NULL default '0', `domain` varchar(255) NOT NULL default '', `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `modified` datetime NOT NULL default '0000-00-00 00:00:00', `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`username`) ) INSERT mailbox(username,password) VALUES('loginSMTP@nomdeDomaine.ext','motDePasse'); nano /etc/pam.d/smtp auth required pam_mysql.so user=root passwd=mbpbddmysql host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1 account sufficient pam_mysql.so user=root passwd= mbpbddmysql host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1 nano /etc/postfix/sasl/smtpd.conf pwcheck_method: saslauthd auxprop mech_list: plain login auxprop_plugin: sql sql_engine: mysql sql_hostnames: 127.0.0.1 sql_user: root

sql_database: postfix sql_passwd: mbpbddmysql sql_select: select password from mailbox where username = '%u@%r' /etc/init.d/saslauthd restart Authentification SMTP SASL stocké sur BDD MySQL entre serveur proxy et serveur de mail : apt-get install postfix-mysql relayhost=mysql:/etc/postfix/sasl-relay smtp_sasl_password_maps=mysql:/etc/postfix/sasl-passwords-mysql nano /etc/postfix/sasl-relay user = root password = mbpbddmysql hosts = 127.0.0.1 dbname = postfix query = SELECT extsmtp FROM sasl-pass chmod 640 /etc/postfix/sasl-relay chgrp postfix /etc/postfix/sasl-relay nano /etc/postfix/sasl-passwords-mysql user = root password = mbpbddmysql hosts = 127.0.0.1 dbname = postfix query = SELECT CONCAT( [',extsmtp,'] ),name,pass FROM sasl_pass WHERE extsmtp='%s' chmod 640 /etc/postfix/sasl-passwords-mysql chgrp postfix /etc/postfix/sasl-passwords-mysql CREATE TABLE sasl_pass ( extsmtp varchar(80) NOT NULL, name TEXT NOT NULL, pass varchar(20) NOT NULL, PRIMARY KEY (extsmtp) ); INSERT sasl_pass (extsmtp,name,pass) VALUES('adresseIpServeurMailSMTP','nomServeurMailSMTP','motDePasseServeurMailSMT P');

Authentification SMTP SASL stocké sur fichier.db entre serveur proxy et serveur de mail : nano /etc/postfix/main.cf smtp_sasl_password_maps=hash:/etc/postfix/sasl-passwords nano /etc/postfix/sasl-passwords adresseipserveurmailsmtp loginsrvmailsmtp:mdpsrvmailsntp postmap /etc/postfix/sasl-passwords Configuration Postfix avec TLS : nano /etc/postfix/main.cf smtpd_tls_cert_file=/etc/perdition/certificatmailpublic.crt smtpd_tls_key_file=/etc/perdition/cleprivemailauth.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache smtpd_tls_received_header = yes smtpd_tls_loglevel = 1 nano /etc/postfix/master.cf #smtp inet n - - - - smtpd smtps inet n - - - - smtpd -o smtpd_tls_wrappermode=yes Logs Postfix et perdition : tail -f -n 50 /var/log/mail.err tail -f -n 50 /var/log/mail.log tail -f -n 50 /var/log/syslog Lister le buffer mail : postqueue -p Vider le buffer mail : postsuper -d ALL