0% found this document useful (0 votes)
1K views12 pages

Postfix, Dovecot, ViMbAdmin, RoundCube en Ubuntu para Correosvirtuales (Nginx) PDF

This document provides instructions for setting up a full-featured mail server on Ubuntu using Postfix, Dovecot, ViMbAdmin, and RoundCube. It includes steps for installing and configuring the software, creating MySQL databases, setting Postfix and Dovecot to use the databases for virtual users and domains, enabling TLS/SSL, and configuring Nginx for the webmail interfaces. The goal is to have a working mail server with virtual users/domains, IMAP, POP3, webmail access, and an admin interface for managing mail accounts and domains.

Uploaded by

Maquibo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views12 pages

Postfix, Dovecot, ViMbAdmin, RoundCube en Ubuntu para Correosvirtuales (Nginx) PDF

This document provides instructions for setting up a full-featured mail server on Ubuntu using Postfix, Dovecot, ViMbAdmin, and RoundCube. It includes steps for installing and configuring the software, creating MySQL databases, setting Postfix and Dovecot to use the databases for virtual users and domains, enabling TLS/SSL, and configuring Nginx for the webmail interfaces. The goal is to have a working mail server with virtual users/domains, IMAP, POP3, webmail access, and an admin interface for managing mail accounts and domains.

Uploaded by

Maquibo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dov

postconf mail_version main.cf master.cf

1 de 12

master.cf

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

master.cf

vim /etc/postfix/master.cf

submission inet n smtps inet n

smtpd smtpd

main.cf

vim /etc/postfix/main.cf

# Change postfix TLS parameter to use dovecot #smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache #smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem smtpd_tls_key_file=/etc/ssl/private/dovecot.pem smtpd_use_tls=yes #smtpd_tls_auth_only = yes #Handle SMTP authentication using Dovecot smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination # other destination domains should be handled using virtual domains
2 de 12

mydestination = localhost

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

# other destination domains should be handled using virtual domains mydestination = localhost # using Dovecot's LMTP for mail delivery and giving it path to store mail virtual_transport = lmtp:unix:private/dovecot-lmtp # virtual mailbox setups virtual_uid_maps = static:5000 virtual_gid_maps = static:5000 virtual_alias_maps = mysql:/etc/postfix/mysql/virtual_alias_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf

mkdir /etc/postfix/mysql

vim /etc/postfix/mysql/virtual_alias_maps.cf

user = vimbadmin password = password hosts = 127.0.0.1 dbname = vimbadmin query = SELECT goto FROM alias WHERE address = '%s' AND active = '1'

vim /etc/postfix/mysql/virtual_domains_maps.cf

3 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

user = vimbadmin password = password hosts = 127.0.0.1 dbname = vimbadmin

query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND activ

vim /etc/postfix/mysql/virtual_mailbox_maps.cf

user = vimbadmin password = password hosts = 127.0.0.1 dbname = vimbadmin query = SELECT maildir FROM mailbox WHERE username = '%s' AND active = '1'

dovecot --version

groupadd -g 5000 vmail useradd -g vmail -u 5000 vmail -d /var/vmail -m

4 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

service postfix restart

vim /etc/dovecot/dovecot.conf

# Enable installed protocols !include_try /usr/share/dovecot/protocols.d/*.protocol protocols = imap pop3 lmtp sieve

vim /etc/dovecot/conf.d/10-mail.conf

mail_location = maildir:/var/vmail/%d/%n

vim /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no auth_mechanisms = plain login

#!include auth-system.conf.ext

5 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf.ext } userdb { driver = static args = uid=5000 gid=5000 home=/var/vmail/%d/%n allow_all_users=yes }

vim /etc/dovecot/dovecot-sql.conf.ext

driver = mysql connect = host=127.0.0.1 dbname=vimbadmin user=vimbadmin password=password password_query = \ SELECT username AS user, password, \ homedir AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \ FROM mailbox WHERE username = '%u' iterate_query = SELECT username AS user FROM mailbox

vim /etc/dovecot/conf.d/10-master.conf

service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { mode = 0600


6 de 12

user = postfix

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

mode = 0600 user = postfix group = postfix } } service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } unix_listener auth-userdb { mode = 0600 user = vmail } user = dovecot } service auth-worker { user = vmail }

vim /etc/dovecot/conf.d/10-logging.conf

log_path = /var/log/dovecot.log

7 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

#debuggign authentication requests auth_debug = yes #debugging other mail related stuff mail_debug = yes

doveconf -n doveconf -n doveconf -a

service dovecot restart

cd /usr/local git clone git://github.com/opensolutions/ViMbAdmin.git vimbadmin apt-get install subversion cd /usr/local/vimbadmin ./bin/library-init.sh
8 de 12 09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

CREATE DATABASE `vimbadmin`; GRANT ALL ON `vimbadmin`.* TO `vimbadmin`@`127.0.0.1` IDENTIFIED BY 'password'; FLUSH PRIVILEGES;

cp application/configs/application.ini.dist application/configs/application.ini vim application/configs/application.ini

securitysalt = "superadmin-password" defaults.mailbox.uid = 5000 defaults.mailbox.gid = 5000 defaults.mailbox.homedir = "/var/vmail/"

resources.doctrine.connection_string = "mysql://vimbadmin:[email protected]/vimba

;resources.session.save_path = APPLICATION_PATH "/../var/session"

bin/doctrine-cli.php create-tables

9 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

chown -R www-data:www-data /usr/local/vimbadmin

server { server_name vma.example.com; access_log error_log /var/log/nginx/vma.example.com.access.log; /var/log/nginx/vma.example.com.error.log;

root /usr/local/vimbadmin/public; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } }

10 de 12

09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

apt-get install roundcube roundcube-plugins roundcube-plugins-extra

/usr/share/roundcube /etc/roundcube vim /etc/roundcube/main.inc.php

$rcmail_config['default_host'] = 'localhost'; $rcmail_config['imap_cache'] = memcache; $rcmail_config['messages_cache'] = db

server { server_name mail.example.com; access_log error_log /var/log/nginx/mail.example.com.access.log; /var/log/nginx/mail.example.com.error.log;

root /usr/share/roundcube; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params;
11 de 12 09/01/2014 9:00

Postfix, Dovecot, ViMbAdmin, RoundCube on Ubuntu for Virtual Mail...

https://rtcamp.com/tutorials/mail/server/postfix-dovecot-ubuntu/

include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } }

12 de 12

09/01/2014 9:00

You might also like