| Line 100: |
Line 100: |
| | /etc/apache2/sites-available/webmail.conf | | /etc/apache2/sites-available/webmail.conf |
| | <nowiki><VirtualHost *:80> | | <nowiki><VirtualHost *:80> |
| − | ServerAdmin rafael@herrerosolis.com
| + | ServerAdmin rafael@herrerosolis.com |
| − | Redirect permanent / https://webmail.herrerosolis.com/
| + | Redirect permanent / https://webmail.herrerosolis.com/ |
| − | # DocumentRoot /var/www/rafael
| + | # DocumentRoot /var/www/rafael |
| − | ServerName webmail.herrerosolis.com
| + | ServerName webmail.herrerosolis.com |
| − | ServerAlias webmail.herrerosolis.com
| + | ServerAlias webmail.herrerosolis.com |
| − | ErrorLog /var/log/apache2/webmail/error.log
| + | ErrorLog /var/log/apache2/webmail/error.log |
| − |
| + | |
| − | # Posible values include: debug, info, notice, warn, error, crit.
| + | # Posible values include: debug, info, notice, warn, error, crit. |
| − | # alert, emerg.
| + | # alert, emerg. |
| − |
| + | |
| − | CustomLog /var/log/apache2/webmail/access.log combined
| + | CustomLog /var/log/apache2/webmail/access.log combined |
| − | </virtualHost>
| + | </virtualHost> |
| − |
| + | |
| − | <VirtualHost *:443>
| + | <VirtualHost *:443> |
| − | ServerAdmin rafael@herrerosolis.com
| + | ServerAdmin rafael@herrerosolis.com |
| − | DocumentRoot /var/lib/roundcube
| + | DocumentRoot /var/lib/roundcube |
| − | ServerName webmail.herrerosolis.com
| + | ServerName webmail.herrerosolis.com |
| − | ServerAlias webmail.herrerosolis.com
| + | ServerAlias webmail.herrerosolis.com |
| − |
| + | |
| − | ErrorLog /var/log/apache2/webmail/error.log
| + | ErrorLog /var/log/apache2/webmail/error.log |
| − |
| + | |
| − | # Posible values include: debug, info, notice, warn, error, crit.
| + | # Posible values include: debug, info, notice, warn, error, crit. |
| − | # alert, emerg.
| + | # alert, emerg. |
| − | CustomLog /var/log/apache2/webmail/access.log combined
| + | CustomLog /var/log/apache2/webmail/access.log combined |
| − | SSLEngine on
| + | SSLEngine on |
| − | SSLCertificateFile /etc/ssl/certs/herrerosolis.crt
| + | SSLCertificateFile /etc/ssl/certs/herrerosolis.crt |
| − | SSLCertificateKeyFile /etc/ssl/private/herrerosolis.key
| + | SSLCertificateKeyFile /etc/ssl/private/herrerosolis.key |
| − | </virtualHost>
| + | </virtualHost> |
| − | </nowiki>
| + | </nowiki> |
| | | | |
| | ===OPTIONAL: Remove TinyMCE=== | | ===OPTIONAL: Remove TinyMCE=== |
| Line 136: |
Line 136: |
| | | | |
| | <nowiki>Comment out these lines: | | <nowiki>Comment out these lines: |
| − | #<Directory "/usr/share/tinymce/www/">
| + | #<Directory "/usr/share/tinymce/www/"> |
| − | # Options Indexes MultiViews FollowSymLinks
| + | # Options Indexes MultiViews FollowSymLinks |
| − | # AllowOverride None
| + | # AllowOverride None |
| − | # Order allow,deny
| + | # Order allow,deny |
| − | # allow from all
| + | # allow from all |
| − | #</Directory>
| + | #</Directory> |
| − | </nowiki>
| + | </nowiki> |
| | | | |
| | ===Create Databases=== | | ===Create Databases=== |
| Line 152: |
Line 152: |
| | | | |
| | <nowiki>CREATE TABLE mailboxes ( | | <nowiki>CREATE TABLE mailboxes ( |
| − | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
| + | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| − | domain_id INT(10) NOT NULL,
| + | domain_id INT(10) NOT NULL, |
| − | local_part VARCHAR(250) NOT NULL,
| + | local_part VARCHAR(250) NOT NULL, |
| − | password VARCHAR(100) NULL,
| + | password VARCHAR(100) NULL, |
| − | description VARCHAR(250) NULL,
| + | description VARCHAR(250) NULL, |
| − | active TINYINT(1) NOT NULL DEFAULT 0,
| + | active TINYINT(1) NOT NULL DEFAULT 0, |
| − | created TIMESTAMP NOT NULL DEFAULT NOW(),
| + | created TIMESTAMP NOT NULL DEFAULT NOW(), |
| − | modified TIMESTAMP NULL
| + | modified TIMESTAMP NULL |
| − | );
| + | ); |
| − | CREATE TABLE aliases (
| + | CREATE TABLE aliases ( |
| − | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
| + | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| − | domain_id INT(10) NOT NULL,
| + | domain_id INT(10) NOT NULL, |
| − | local_part VARCHAR(250) NOT NULL,
| + | local_part VARCHAR(250) NOT NULL, |
| − | goto VARCHAR(250) NOT NULL,
| + | goto VARCHAR(250) NOT NULL, |
| − | description VARCHAR(250) NULL,
| + | description VARCHAR(250) NULL, |
| − | active TINYINT(1) NOT NULL DEFAULT 0,
| + | active TINYINT(1) NOT NULL DEFAULT 0, |
| − | created TIMESTAMP NOT NULL DEFAULT NOW(),
| + | created TIMESTAMP NOT NULL DEFAULT NOW(), |
| − | modified TIMESTAMP NULL
| + | modified TIMESTAMP NULL |
| − | );
| + | ); |
| − | CREATE TABLE vacations (
| + | CREATE TABLE vacations ( |
| − | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
| + | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| − | mailbox_id INT(10) NOT NULL,
| + | mailbox_id INT(10) NOT NULL, |
| − | subject VARCHAR(250) NOT NULL,
| + | subject VARCHAR(250) NOT NULL, |
| − | body TEXT NOT NULL,
| + | body TEXT NOT NULL, |
| − | description VARCHAR(250) NULL,
| + | description VARCHAR(250) NULL, |
| − | active TINYINT(1) NOT NULL DEFAULT 0,
| + | active TINYINT(1) NOT NULL DEFAULT 0, |
| − | created TIMESTAMP NOT NULL DEFAULT NOW(),
| + | created TIMESTAMP NOT NULL DEFAULT NOW(), |
| − | modified TIMESTAMP NULL
| + | modified TIMESTAMP NULL |
| − | );
| + | ); |
| − |
| + | |
| − | CREATE TABLE domains (
| + | CREATE TABLE domains ( |
| − | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
| + | id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| − | fqdn VARCHAR(250) NOT NULL,
| + | fqdn VARCHAR(250) NOT NULL, |
| − | type ENUM('local','relay') NOT NULL DEFAULT 'local',
| + | type ENUM('local','relay') NOT NULL DEFAULT 'local', |
| − | description VARCHAR(250) NULL,
| + | description VARCHAR(250) NULL, |
| − | active TINYINT(1) NOT NULL DEFAULT 0,
| + | active TINYINT(1) NOT NULL DEFAULT 0, |
| − | created TIMESTAMP NOT NULL DEFAULT NOW(),
| + | created TIMESTAMP NOT NULL DEFAULT NOW(), |
| − | modified TIMESTAMP NULL
| + | modified TIMESTAMP NULL |
| − | );
| + | ); |
| − | </nowiki>
| + | </nowiki> |
| | | | |
| | ===Create your first email account and domain=== | | ===Create your first email account and domain=== |
| Line 205: |
Line 205: |
| | ===Create a database-account to access the database=== | | ===Create a database-account to access the database=== |
| | <nowiki>grant ALL on email_accounts.* to 'email'@'localhost' identified by 'password'; | | <nowiki>grant ALL on email_accounts.* to 'email'@'localhost' identified by 'password'; |
| − | flush privileges;
| + | flush privileges; |
| − | </nowiki>
| + | </nowiki> |
| | http://bradthemad.org/tech/notes/exim_cheatsheet.php | | http://bradthemad.org/tech/notes/exim_cheatsheet.php |
| | | | |
| Line 421: |
Line 421: |
| | ADD to the file /etc/dovecot/dovecot.conf | | ADD to the file /etc/dovecot/dovecot.conf |
| | <nowiki>protocols = imap | | <nowiki>protocols = imap |
| − | listen = *, ::</nowiki>
| + | listen = *, ::</nowiki> |
| | | | |
| | Add to the file /etc/dovecot/conf.d/10-mail.conf | | Add to the file /etc/dovecot/conf.d/10-mail.conf |
| Line 445: |
Line 445: |
| | - Get certificates ej: Lets Encrypt | | - Get certificates ej: Lets Encrypt |
| | Edit: /etc/dovecot/conf.d/10-ssl.conf | | Edit: /etc/dovecot/conf.d/10-ssl.conf |
| − | <nowiki>ssl = required | + | ssl = required |
| − | # Preferred permissions: root:root 0444
| + | |
| − | ssl_cert = </etc/ssl/certs/dovecot.pem
| + | ssl_key = </etc/letsencrypt/live/webmail.herrerosolis.com/privkey.pem |
| − | # Preferred permissions: root:root 0400
| + | ssl_cert = </etc/letsencrypt/live/webmail.herrerosolis.com/fullchain.pem |
| − | ssl_key = </etc/ssl/private/dovecot.pem</nowiki>
| |
| | | | |
| | ====Ports==== | | ====Ports==== |
| Line 468: |
Line 467: |
| | Add to /etc/roundcube/config.inc.php | | Add to /etc/roundcube/config.inc.php |
| | <nowiki>$config['imap_conn_options'] = array( | | <nowiki>$config['imap_conn_options'] = array( |
| − | 'ssl' => array(
| + | 'ssl' => array( |
| − | 'verify_peer' => false,
| + | 'verify_peer' => false, |
| − | 'verify_peer_name' => false,
| + | 'verify_peer_name' => false, |
| − | 'allow_self_signed' => true,
| + | 'allow_self_signed' => true, |
| − | ),
| + | ), |
| − | );
| + | ); |
| − | </nowiki>
| + | </nowiki> |
| | | | |
| | ====Enable Password Plugin==== | | ====Enable Password Plugin==== |
| Line 504: |
Line 503: |
| | Then edit your local composer.json file and add the "vendor/plugin" names to the "require" section of the JSON structure. Don't forget to specify the version constraint: | | Then edit your local composer.json file and add the "vendor/plugin" names to the "require" section of the JSON structure. Don't forget to specify the version constraint: |
| | <nowiki>"require" : { | | <nowiki>"require" : { |
| − | ...,
| + | ..., |
| − | "roundcube/rcsample": ">=0.2.0"
| + | "roundcube/rcsample": ">=0.2.0" |
| − | }</nowiki>
| + | }</nowiki> |
| | | | |
| | After every change to composer.json run | | After every change to composer.json run |
| Line 513: |
Line 512: |
| | ==Restart Everithing== | | ==Restart Everithing== |
| | <nowiki>/etc/init.d/apache2 restart | | <nowiki>/etc/init.d/apache2 restart |
| − | /etc/init.d/exim4 restart
| + | /etc/init.d/exim4 restart |
| − | /etc/init.d/dovecot restart</nowiki>
| + | /etc/init.d/dovecot restart</nowiki> |
| | | | |
| | Exim may output a “paniclog”. If so, read it, fix it – and then manually delete the paniclog file, or else you’ll keep getting fake warnings every time you restart exim. | | Exim may output a “paniclog”. If so, read it, fix it – and then manually delete the paniclog file, or else you’ll keep getting fake warnings every time you restart exim. |