SOGo : installation sur CentOS-MariaDB-Postfix-Dovecot-PostfixAdmin
De wikiGite
Système
installer une Centos6.x minimale, puis :
yum update
yum install screen wget bash-completion man
Désactiver iptables et selinux
service iptables stop
service ip6tables stop
chkconfig --del iptables
chkconfig --del ip6tables
setenforce 0
et dans /etc/sysconfig/selinux modifier :
SELINUX=disabled
Installer MariaDB Remplacer_MySQL_par_MariaDB_sur_CentOS6
Déclarer les dépôts complémentaires Dépôts_complémentaires
Installer les paquets nécessaires:
yum install --enablerepo=remi httpd php php-mysql php-mbstring php-imap
yum install postfix dovecot dovecot-mysql dovecot-pigeonhole cyrus-sasl-devel cyrus-sasl-sql
Postfix - PostfixAdmin
Vérifier la dernière version de PostfixAdmin sur http://sourceforge.net/projects/postfixadmin/files/
wget http://sourceforge.net/projects/postfixadmin/files/latest/download -O postfixadmin-2.92.tar.gz
tar -xvf postfixadmin-2.92.tar.gz
mv postfixadmin-2.92 /usr/share/postfixadmin
chown -R apache.apache /usr/share/postfixadmin/
# Pour vacation.pl :
yum install --enablerepo=epel perl-MailTools perl-MIME-EncWords perl-Email-Valid perl-MIME-Charset perl-Test-Pod perl-TimeDate perl-Mail-Sender perl-Log-Log4perl perl-Log-Dispatch perl-DBD-MySQL
Configurer le mail store (répertoire des boîtes mail)
mkdir /home/vmail
chmod 770 /home/vmail
useradd -r -u 101 -g mail -d /home/vmail -s /sbin/nologin -c "Virtual mailbox" vmail
chown vmail:mail /home/vmail
Paramétrer Apache
vi /etc/httalias /mailadmin /usr/share/postfixadmin
<Directory "/usr/share/postfixadmin">
AllowOverride AuthConfig
</Directory>pd/conf.d/postfixadmin.conf
service httpd restart
Créer la base de données
mysql -u root -p # par défaut root n'a pas de mot de passe MariaDB> CREATE DATABASE postfix; MariaDB> CREATE USER postfix@localhost IDENTIFIED BY 'mysql_postfix_password'; MariaDB> GRANT ALL PRIVILEGES ON postfix.* TO postfix@localhost;
Configuration des services
Configuration de PostfixAdmin
cd /usr/share/postfixadmin
vi config.inc.php
modifier ou ajouter :
$CONF['configured'] = true; $CONF['setup_password'] = 'changeme'; //sera modifié ensuite $CONF['default_language'] = 'fr'; $CONF['postfix_admin_url'] = '/mailadmin'; $CONF['database_type'] = 'mysql'; $CONF['database_host'] = 'localhost'; $CONF['database_user'] = 'postfix'; $CONF['database_password'] = 'mysql_postfix_password'; $CONF['database_name'] = 'postfix'; $CONF['admin_email'] = 'postmaster@domain.fr'; // ou vide // si besoin $CONF['aliases'] = '50'; $CONF['mailboxes'] = '50'; $CONF['maxquota'] = '100'; $CONF['domain_quota'] = 'YES'; $CONF['quota_multiplier'] = '1024000'; $CONF['transport'] = 'YES'; $CONF['transport_options'] = array ( 'virtual', // for virtual accounts 'local', // for system accounts 'relay' // for backup mx ); $CONF['transport_default'] = 'virtual'; $CONF['vacation'] = 'YES'; $CONF['sendmail'] = 'NO'; $CONF['create_mailbox_subdirs']=array('Drafts','Spam','Sent','Trash'); $CONF['create_mailbox_subdirs_host']='localhost'; $CONF['create_mailbox_subdirs_prefix']=; $CONF['create_mailbox_subdirs_hostport']=143; // $CONF['create_mailbox_subdirs_hostoptions']=array('notls'); $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
// // END OF CONFIG FILE //
Tout le reste est laissé par défaut dans le fichier. Naviguer sur http://<URL du serveur>/mailadmin/setup.php
Si tous les pré-requis sont remplis, entrer un mot de passe dans "setup password" et valider. Il donne un hash à entrer dans config.inc.php.
Puis revenir sur setup.php, entrer à nouveau le mot de passe dans setup password, et créer un admin (postmaster@domain.fr) + mot de passe.
On peut alors naviguer sur http://<URL du serveur>/mailadmin avec ce login
Configuration de Postfix
vi /etc/postfix/main.cf
par rapport au défaut, modifier :
inet_interfaces = all myhostname = sogo.domain.fr mydomain = domain.fr mynetworks = $config_directory/mynetworks relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf recipient_delimiter = +
AJOUTER à la fin :
transport_maps = hash:/etc/postfix/transport # virtual setup virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql-virtual_alias_alias_maps.cf, regexp:/etc/postfix/virtual_regexp virtual_mailbox_base = /home/vmail virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains_maps.cf virtual_alias_domains = proxy:mysql:/etc/postfix/mysql-virtual_alias_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/mysql-virtual_mailbox_alias_maps.cf virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf virtual_minimum_uid = 101 virtual_uid_maps = static:101 virtual_gid_maps = static:12 virtual_transport = dovecot dovecot_destination_recipient_limit = 1 mailbox_size_limit = 5120000000 smtp_host_lookup = dns, native # authentication - "smtpd_sasl_auth_enable = no" to avoid open relay !!! smtpd_sasl_auth_enable = no smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname broken_sasl_auth_clients = yes smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth # tls config smtp_use_tls = yes smtpd_use_tls = yes smtpd_tls_security_level = may smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache # Change mail.example.com.* to your host name smtpd_tls_key_file = /etc/pki/tls/private/mail.example.com.key smtpd_tls_cert_file = /etc/pki/tls/certs/mail.example.com.crt # smtpd_tls_CAfile = /etc/pki/tls/root.crt # rules restrictions smtpd_client_restrictions = smtpd_helo_restrictions = smtpd_sender_restrictions = smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain # uncomment for realtime black list checks # ,reject_rbl_client zen.spamhaus.org # ,reject_rbl_client bl.spamcop.net # ,reject_rbl_client dnsbl.sorbs.net smtpd_helo_required = yes disable_vrfy_command = yes smtpd_data_restrictions = reject_unauth_pipelining # Other options # email size limit ~20Meg message_size_limit = 204800000
Générer les clé TLS
- Auto-signées :
openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509
mv smtpd.cert /etc/pki/tls/certs/mail.example.com.crt
mv smtpd.key /etc/pki/tls/private/mail.example.com.key
- OU si certificat officiel : fusionner le certificat serveur signé (crt) avec le certificat intermédiaire de l'autorité (au format pem)
cat mail.example.com.officiel.crt /etc/pki/tls/GandiStandardSSLCA.pem > mail.example.com.pem
Editer les fichiers de configuration de Postfix
vi /etc/postfix/master.cf
par rapport au défaut, modifier :
submission inet n - n - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING -o syslog_name=postfix/submission pickup fifo n - n 60 1 pickup -o content_filter= -o receive_override_options=no_header_body_checks maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
AJOUTER à la fin
127.0.0.1:10025 inet n - y - - smtpd -o content_filter= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o receive_override_options=no_header_body_checks -o smtpd_bind_address=127.0.0.1 -o smtpd_helo_required=no -o smtpd_client_restrictions= -o smtpd_restriction_classes= -o disable_vrfy_command=no -o strict_rfc821_envelopes=yes # # Dovecot LDA (with management of recipient_delimiter) dovecot unix - n n - - pipe flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -f {sender} -a ${recipient} -d ${user}@${nexthop} # # Vacation mail vacation unix - n n - - pipe flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
Eventuellement, si amavis est installé :
smtp-amavis unix - - y - 2 smtp -o smtp_data_done_timeout=1200 -o disable_dns_lookups=yes -o smtp_send_xforward_command=yes
vi /etc/postfix/mynetworks
# This specifies the list of subnets that Postfix considers as # "trusted" SMTP clients that have more privileges than "strangers". # # In particular, "trusted" SMTP clients are allowed to relay mail # through Postfix. # # Be sure to add your public ip address block if needed. # 192.168.0.0/16 10.0.0.0/8 127.0.0.0/8
vi /etc/postfix/mysql-virtual_alias_maps.cf
<syntaxhighlight lang=bash>
hosts = localhost
user = postfix
password = mysql_postfix_password
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
<syntaxhighlight lang=bash enclose="div">
vi /etc/postfix/mysql-virtual_domains_maps.cf
hosts = localhost user = postfix password = mysql_postfix_password dbname = postfix query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
vi /etc/postfix/mysql-virtual_alias_alias_maps.cf
user = postfix password = mysql_postfix_passwordmysql_postfix_password hosts = 127.0.0.1 dbname = postfix query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' AND alias.address = concat('%u', '@', alias_domain.target_domain) AND alias.active = 1
vi /etc/postfix/mysql-virtual_alias_domains.cf
user = postfix password = mysql_postfix_password hosts = 127.0.0.1 dbname = postfix query = SELECT alias_domain FROM alias_domain where alias_domain='%s'
vi /etc/postfix/mysql-relay_domains_maps.cf
hosts = localhost user = postfix password = postfix dbname = postfix query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'
vi /etc/postfix/mysql-virtual_mailbox_maps.cf
hosts = localhost user = postfix password = postfix dbname = postfix query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'
vi /etc/postfix/mysql-virtual_mailbox_alias_maps.cf
user = postfix password = mysql_postfix_password dbname = postfix query = SELECT maildir FROM mailbox, alias_domain WHERE alias_domain.alias_domain = '%d' AND mailbox.username = concat('%u', '@', alias_domain.target_domain ) AND mailbox.active = 1
vi /etc/postfix/mysql-virtual_mailbox_limit_maps.cf
hosts = localhost user = postfix password = mysql_postfix_password dbname = postfix query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'
touch /etc/postfix/virtual_regexp
Vacation Email
useradd -r -d /var/spool/vacation -s /sbin/nologin -c "Virtual vacation" vacation
mkdir /var/spool/vacation
chmod 770 /var/spool/vacation
cp /usr/share/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/
chmod 755 /var/spool/vacation/vacation.pl
echo "autoreply.domain.fr vacation:" > /etc/postfix/transport
postmap /etc/postfix/transport
chown -R vacation:vacation /var/spool/vacation
echo "127.0.0.1 autoreply.domain.fr" >> /etc/hosts
mkdir /etc/postfixadmin # ou: mkdir -p /etc/mail/postfixadmin, vacation.pl accepte les 2 chemins
vi /etc/postfixadmin/vacation.conf
# ========== begin configuration ========== $db_type = 'mysql'; $db_username = 'postfix'; $db_password = 'mysql_postfix_password'; $db_name = 'postfix'; $vacation_domain = 'autoreply.domain.fr'; $custom_noreply_pattern = 1;
Custom vacation.pl : exclusion d'adresses
07/2015 : Ajout d'une fonction d'exlusion et des variables de configuration correspondantes (ne peut pas être traité par la fonction existante custom_noreply car celle-ci vérifie aussi le destinataire : donc nous-même !).
# diff /usr/share/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/vacation.pl 202a203,204 > our $custom_exclude_pattern = 0; > our $exclude_pattern = 'some_address|some_domain'; 642a645,655 > > sub exclude_from_address { > my ($address) = @_; > my $logger = get_logger(); > > if( ($custom_exclude_pattern == 1 && $address =~ /^.*($exclude_pattern).*/i) ) { > $logger->debug("sender $address contains excluded pattern $1 - will not send vacation message"); > exit(0); > } > } > 692a706 > $from = exclude_from_address($from);
Et dans /etc/postfixadmin/vacation.conf ajouter:
$custom_exclude_pattern = 1; $exclude_pattern = 'exclude_domain.org|exclude_address@domain.org|exclude_sender';
Configurer Dovecot
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.save
vi /etc/dovecot/dovecot.conf
modifier :
protocols = imap pop3 lmtp
dans le répertoire /etc/dovecot/conf.d, modifier :
- 10-auth.conf
auth_mechanisms = plain login #!include auth-system.conf.ext !include auth-sql.conf.ext
- 10-mail.conf
mail_plugins = quota imap_quota trash mail_location = maildir:/home/vmail/%d/%n first_valid_uid = 101 first_valid_gid = 12 mailbox_idle_check_interval = 30 secs maildir_copy_with_hardlinks = yes
ajouter :
plugin { trash = /etc/dovecot/trash.conf }
et pour activer le partage de dossiers :
namespace { type = private separator = / prefix = #location defaults to mail_location. inbox = yes } namespace { type = shared separator = / prefix = Shared/%%n/ #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u location = maildir:/home/vmail/%%d/%%u:INDEX=/home/vmail/%d/%u/shared/%%u subscriptions = no list = children }
NOTE: le partage de boîte mail à boîte mail (représenté par le namespace "type = shared") ne fonctionne pas pour le moment. Soit ce n'est pas la bonne configuration de namespace, soit on a un problème avec la version 2.0.9-8 de dovecot sur CentOS6. On continue à chercher...
En attendant, on peut activer les dossiers publics, qui remplacent avantageusement les partages d'utilisateur à utilisateur :
ajouter en plus des 2 namespaces ci-dessus :
namespace { type = public separator = / prefix = Public/ location = maildir:/home/vmail/public subscriptions = no }
Créer le répertoire /home/vmail/public, et dedans un fichier dovecot-acl avec :
anyone itlr
Dans ce répertoire "public" créer des sous-répertoires (on ne peut pas déposer de mails directement dans "public"). Changer le propriétaire de tous ces répertoires et ce fichier en "vmail:mail". Relancer dovecot. Un dossier virtuel "Dossiers partagés" (ou simplement "Shared" en anglais) doit apparaitre dans les clients mails (penser à vérifier si ce client a besoin de s'abonner au dossiers pour les visualiser).
- 10-master.conf # décommenter :
service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } service pop3-login { inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } service imap { vsz_limit = 256M } service pop3 { } service auth { unix_listener auth-userdb { mode = 0666 user = vmail group = mail } unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } } service auth-worker { } service dict { unix_listener dict { mode = 0666 user = vmail group = mail } }
- 10-ssl.conf
ssl = yes ssl_verify_client_cert = no
- 15-lda.conf
lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes protocol lda { mail_plugins = sieve acl postmaster_address = postmaster@your-domain.tld }
- 20-imap.conf
protocol imap { mail_plugins = $mail_plugins acl imap_acl imap_client_workarounds = delay-newmail }
- 20-lmtp.conf
lmtp_save_to_detail_mailbox = yes protocol lmtp { mail_plugins = $mail_plugins }
- 20-managesieve.conf # décommenter :
service managesieve-login { inet_listener sieve { port = 4190 } service_count = 1 process_min_avail = 0 vsz_limit = 64M } service managesieve { } protocol sieve { managesieve_max_line_length = 65536 managesieve_implementation_string = Dovecot Pigeonhole managesieve_max_compile_errors = 5 }
- 20-pop3.conf
protocol pop3 { mail_plugins = $mail_plugins pop3_client_workarounds = outlook-no-nuls oe-ns-eoh }
- 90-acl.conf
plugin { acl = vfile }
- 90-quota.conf (on gère les quotas à l'utilisateur, avec les champs "messages" et "bytes" de la base)
dict { quotadict = mysql:/etc/dovecot/dovecot-dict-quota.conf } plugin { quota = dict:user::proxy::quotadict }
- 90-sieve.conf (gestion des fitres mails)
plugin { sieve = ~/.dovecot.sieve sieve_global_path = /var/lib/dovecot/sieve/default.sieve sieve_dir = ~/sieve sieve_global_dir = /var/lib/dovecot/sieve/ sieve_max_script_size = 1M }
Créer les fichiers :
vi /etc/dovecot/dovecot-sql.conf.ext
driver = mysql connect = host=localhost dbname=postfix user=postfix password=mysql_postfix_password default_pass_scheme = MD5-CRYPT password_query = SELECT username as user, password, concat('/home/vmail/', maildir) as userdb_home, concat('maildir:/home/vmail/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1' user_query = SELECT concat('/home/vmail/', maildir) as home, concat('maildir:/home/vmail/', maildir) as mail, 101 AS uid, 12 AS gid, CONCAT('*:bytes=', quota) as quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
vi /etc/dovecot/trash.conf
1 Spam # Uncomment if you want trash as well # 2 Trash
vi /etc/dovecot/dovecot-dict-quota.conf
connect = host=localhost dbname=postfix user=postfix password=mysql_postfix_password map { pattern = priv/quota/storage table = quota2 username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota2 username_field = username value_field = messages }
NOTE : AVEC CETTE CONFIGURATION, LE PARTAGE DE BOITES MAIL NE FONCTIONNE PAS ! A DEBUGGUER.
Configuration Sieve
mkdir -p /var/lib/dovecot/sieve/
vi /var/lib/dovecot/sieve/globalfilter.sieve
require "fileinto"; if exists "X-Spam-Flag" { if header :contains "X-Spam-Flag" "NO" { } else { fileinto "Spam"; stop; } } if header :contains "subject" ["***SPAM***"] { fileinto "Spam"; stop; }
touch /var/lib/dovecot/sieve/default.sieve
chmod 754 /var/lib/dovecot/sieve/default.sieve
chown -R vmail:mail /var/lib/dovecot
chkconfig dovecot on
service postfix restart
service dovecot restart
Les autres filtres sont sauvegardés dans un fichier dans ~/sieve/xxxxx et un lien ~/.dovecot.sieve pointe vers le fichier de ce répertoire pour l'activer. (il peut donc y avoir plusieurs fichiers de filtres dans le répertoire ~/sieve, activés selon le besoin).
Les filtres sont modifiables à la main, ou par Thunderbird en chargeant le module "Sieve" : https://github.com/thsmi/sieve/tree/master/nightly (en bas de page, enregistrer la cible du lien... sur sieve-0.2.3f.xpi, et installer dans les modules TH) Dans filtres de messages > paramètres Sieve, indiquer :
sogo.domain.fr port 4190 compte IMAP connexion sécurisée TRUE
Puis dans Filtres de messages > Filtres Sieve Créer un script (un seul actif à la fois) avec les règles.
Fin de configuration
Mettre l'IP et le nom de host dans /etc/hosts
Dans Postfixadmin, créer un domaine, et des comptes.
SOGo
Installation
vi /etc/yum.repos.d/sogo.repo
[SOGo] name=Inverse SOGo Repository baseurl=http://inverse.ca/downloads/SOGo/RHEL6/$basearch gpgcheck=0
yum install --enablerepo=epel sogo sogo-ealarms-notify sogo-tool sudo memcached sope49-gdl1-mysql mod_ssl
service memcached start
chkconfig memcached on
Configuration
Créer une vue MariaDB sur les tables Postfix pour SOGo
mysql -u root -p postfix
MariaDB> CREATE VIEW `sogo_users` AS SELECT local_part AS c_uid, username AS c_name, PASSWORD AS c_password, name AS c_cn, username AS mail, domain FROM `mailbox`;
Le reste des tables sera créé par SOGo.
Sogo
A l'intérieur de la première accolade "{", décommenter et modifier/ajouter :
SOGoTimeZone = "Europe/Paris"; SOGoLanguage = French; //SOGoMailMessageCheck = every_10_minutes; //SOGoFirstDayOfWeek = 1; //SOGoMailComposeMessageType = html; # Obligatoitre, sinon les partages user à user ne fonctionnent pas : SOGoCalendarDefaultRoles = ( PublicDAndTViewer // ConfidentialDAndTViewer ); SOGoSieveServer = sieve://127.0.0.1:4190; //Envoyer des mail lors de différents événements (ex: changement de droit ou création) : SOGoAppointmentSendEMailNotifications = YES; SOGoFoldersSendEMailNotifications = YES; SOGoACLsSendEMailNotifications = YES; //Authoriser les utilisateur à changer leur mot de passe : SOGoPasswordChangeEnabled = YES; //Envoi de mail pour rappel d'une tache ou d'un événement : //SOGoEnableEMailAlarms = YES; // Web Interface // SOGoForwardEnabled = YES; SOGoMemcachedHost = 127.0.0.1; // Ces lignes sont importantes : ce sont elles qui obligent Sogo à créer les tables correspondantes SOGoProfileURL = "mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_user_profile"; OCSFolderInfoURL = "mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_folder_info"; OCSSessionsFolderURL = "mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_sessions_folder"; //Authoriser les connection en user@domain.tld : SOGoEnableDomainBasedUID = YES; //Authentification des utilisateurs - sur base Postfix - mysql domains = { "domain.fr" = { SOGoMailDomain = "domain.com"; SOGoDraftsFolderName = Drafts; SOGoUserSources = ( {canAuthenticate = YES; displayName = "Utilisateurs domain.com"; id = users1; isAddressBook = YES; type = sql; userPasswordAlgorithm = md5; LoginFieldNames = ( "c_name" ); viewURL ="mysql://sogo:secret@127.0.0.1:3306/sogo/sogo_users"; IMAPLoginFieldName = "mail"; DomainFieldName = "domain"; }); }; };
Créer un user "admin", admin Sogo (SOGoSuperUsernames), qui partagera des dossiers mails, agenda et carnet d'adresses globaux.
Apache
Le RPM sogo a créé un fichier /etc/httpd/conf.d/SOGo.conf (fichier d'exemple où tout est commenté). Modifier "yourhostname" par le nom de vhost souhaité.
Ce fichier intercepte une URL du type "https://monserveur.domain.com/SOGo".
Problème, avec cette configuration, si on accède à "https://monserveur.domain.com", on tombe sur la page par défaut d'Apache.
Pour rediriger vers SOGo, sur CentOS modifier etc/httpd/conf.d/welcome.conf :
<LocationMatch "^/+$"> Options -Indexes # ErrorDocument 403 /error/noindex.html Redirect / https://sogo.systea.fr/SOGo </LocationMatch>
Puis :
service httpd restart
service sogod restart
[TEMP] Ajouter des alias expéditeurs à un compte
Solution temporaire en attendant que Sogo le gère lui-même. Modifier la table "mailbox" :
mysql -u root -p postfix
MariaDB> alter table mailbox add mail_alias1 varchar(255) after username; MariaDB> alter table mailbox add mail_alias2 varchar(255) after mail_alias1; MariaDB> alter table mailbox add mail_alias3 varchar(255) after mail_alias2; MariaDB> alter table mailbox add mail_alias4 varchar(255) after mail_alias3;
Modifier la vue :
MariaDB> DROP VIEW `sogo_users`; MariaDB> CREATE VIEW `sogo_users` AS SELECT local_part AS c_uid, username AS c_name, PASSWORD AS c_password, name AS c_cn, username AS mail, mail1 AS mail_alias1, mail2 AS mail_alias2, mail3 AS mail_alias3, mail4 AS mail_alias4, domain FROM `mailbox`;
Dans /etc/sogo/sogo.conf, ajouter la ligne :
MailFieldNames = ("mail1", "mail2", "mail3", "mail4");
entre "LoginFieldNames" et "viewURL" du bloc "domain" (voir configuration Sogo ci-dessus).
Ensuite, ajouter manuellement les alias :
MariaDB> update sogo_users set mail1 = 'premier_alias@domain.com' where c_uid='nom_de_l_utilisateur';
et relancer Postfix pour qu'il relise ses tables.