Difference between revisions of "Linux Mail Server: Exim4"

From RHS Wiki
Jump to navigation Jump to search
Line 31: Line 31:
 
You should know about this already: you need an “MX” record on your DNS server, and it needs to point to your main server where you’ll run your email, web, etc.
 
You should know about this already: you need an “MX” record on your DNS server, and it needs to point to your main server where you’ll run your email, web, etc.
  
 +
=== Apache ===
 +
/etc/apache2/sites-available/webmail.conf
 +
<nowiki><VirtualHost *:80>
 +
    ServerAdmin rafael@herrerosolis.com
 +
    Redirect permanent / https://webmail.herrerosolis.com/
 +
#    DocumentRoot /var/www/rafael
 +
    ServerName webmail.herrerosolis.com
 +
    ServerAlias webmail.herrerosolis.com
 +
    ErrorLog /var/log/apache2/webmail/error.log
 +
 +
    # Posible values include: debug, info, notice, warn, error, crit.
 +
    # alert, emerg.
 +
 +
    CustomLog /var/log/apache2/webmail/access.log combined
 +
</virtualHost>
 +
 +
<VirtualHost *:443>
 +
    ServerAdmin rafael@herrerosolis.com
 +
    DocumentRoot /var/lib/roundcube
 +
    ServerName webmail.herrerosolis.com
 +
    ServerAlias webmail.herrerosolis.com
 +
 +
    ErrorLog /var/log/apache2/webmail/error.log
 +
 +
    # Posible values include: debug, info, notice, warn, error, crit.
 +
    # alert, emerg.
 +
    CustomLog /var/log/apache2/webmail/access.log combined
 +
    SSLEngine on
 +
    SSLCertificateFile /etc/ssl/certs/herrerosolis.crt
 +
    SSLCertificateKeyFile /etc/ssl/private/herrerosolis.key
 +
</virtualHost>
 +
</nowiki>
  
 
http://bradthemad.org/tech/notes/exim_cheatsheet.php
 
http://bradthemad.org/tech/notes/exim_cheatsheet.php

Revision as of 20:06, 31 March 2017

Whispers Mail Server

Stack

  • Web server (Apache)
  • Database server (MySQL)
  • Email server (MTA) (Exim4)
  • IMAP server (Dovecot)
  • Webmail server (Roundcube)

Install

  • apt-get install apache2-mpm-prefork
    • (Some of these email servers require PHP; PHP is crappy and requires mpm-prefork (the ‘slow’ version of Apache))
  • apt-get install mysql-client
    • (should auto-install something like: mysql-common + mysql-client-5.5)
  • apt-get install mysql-server
    • (should auto-install something like: mysql-server-5.5 + mysql-server-core-5.5)
  • apt-get install exim4
  • apt-get install exim4-base
  • apt-get install exim4-config
  • apt-get install exim4-daemon-heavy
    • (there’s an “exim4-mysql” that might be sufficient to replace this, but I gave up: there are way too many exim4 packages, and no help for installing the “correct” set, so … just pick this and get the lot!)
  • apt-get install dovecot-core
  • apt-get install dovecot-imapd
  • apt-get install dovecot-mysql
  • apt-get install roundcube
  • apt-get install roundcube-core
  • apt-get install roundcube-mysql

Setup

DNS

You should know about this already: you need an “MX” record on your DNS server, and it needs to point to your main server where you’ll run your email, web, etc.

Apache

/etc/apache2/sites-available/webmail.conf

<VirtualHost *:80>
    ServerAdmin rafael@herrerosolis.com
    Redirect permanent / https://webmail.herrerosolis.com/
#    DocumentRoot /var/www/rafael
    ServerName webmail.herrerosolis.com
    ServerAlias webmail.herrerosolis.com
    ErrorLog /var/log/apache2/webmail/error.log

    # Posible values include: debug, info, notice, warn, error, crit.
    # alert, emerg.

    CustomLog /var/log/apache2/webmail/access.log combined
</virtualHost>

<VirtualHost *:443>
    ServerAdmin rafael@herrerosolis.com
    DocumentRoot /var/lib/roundcube
    ServerName webmail.herrerosolis.com
    ServerAlias webmail.herrerosolis.com

    ErrorLog /var/log/apache2/webmail/error.log

    # Posible values include: debug, info, notice, warn, error, crit.
    # alert, emerg.
    CustomLog /var/log/apache2/webmail/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/herrerosolis.crt
    SSLCertificateKeyFile /etc/ssl/private/herrerosolis.key
</virtualHost>

http://bradthemad.org/tech/notes/exim_cheatsheet.php

STARTTLS

https://wiki.debian.org/Exim

Troubleshooting

exim4 -bP | grep tls_

test with:

sudo apt-get install swaks
swaks -a -tls -q HELO -s gollum.redactate.com -au test -ap '<>'
  1. Choose internet site
  2. Choose domain

configuration (mp4)