added Postfix and Dovecot configuration-templates for FreeBSD
This commit is contained in:
@@ -102,10 +102,10 @@ return Array(
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_periodic.conf' => '/etc/periodic.conf',
|
||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
|
||||
'usr_local_etc_postfix_main.cf' => '/usr/local/etc/postfix/main.cf',
|
||||
'usr_local_etc_postfix_mysql-virtual_alias_maps.cf' => '/usr/local/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'usr_local_etc_postfix_mysql-virtual_mailbox_domains.cf' => '/usr/local/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'usr_local_etc_postfix_mysql-virtual_mailbox_maps.cf' => '/usr/local/etc/postfix/mysql-virtual_mailbox_maps.cf'
|
||||
),
|
||||
'restart' => Array(
|
||||
'sh /usr/local/etc/rc.d/postfix restart'
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
driver = mysql
|
||||
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
|
||||
default_pass_scheme = CRYPT
|
||||
password_query = SELECT username AS user, password_enc AS password FROM mail_users WHERE username = '%u'
|
||||
user_query = SELECT CONCAT(homedir,maildir) AS home, concat('maildir:',homedir,maildir) AS mail, uid, gid FROM mail_users where username = '%u'
|
||||
@@ -0,0 +1,109 @@
|
||||
## Dovecot configuration file
|
||||
#
|
||||
syslog_facility = local1
|
||||
#log_timestamp = .%Y-%m-%d %H:%M:%S
|
||||
#login_log_format_elements = user=<%u>method=%m rip=%r lip=%l %c
|
||||
#login_log_format = %$: %s
|
||||
#log_path = /var/log/dovecot.log
|
||||
#info_log_path = /var/log/dovecot-info.log
|
||||
#mail_debug = yes
|
||||
#auth_debug_passwords= yes
|
||||
#auth_verbose= yes
|
||||
#
|
||||
#ssl=yes
|
||||
#ssl_ca_file = /etc/ssl/<SERVERNAME>.crt
|
||||
#ssl_cert_file = /etc/ssl/<SERVERNAME>.crt
|
||||
#ssl_key_file = /etc/ssl/<SERVERNAME>.key
|
||||
#ssl_key_password =
|
||||
#
|
||||
# imap imaps pop3 pop3s (use imaps and pop3s if configured for SSL)
|
||||
|
||||
protocols = imap pop3 <SSLPROTOCOLS>
|
||||
|
||||
#
|
||||
# Uncomment the ssl_listen statements and comment out listen if using SSL
|
||||
#
|
||||
protocol imap {
|
||||
listen = *:143
|
||||
# ssl_listen = *:993
|
||||
}
|
||||
|
||||
protocol pop3 {
|
||||
listen = *:110
|
||||
# ssl_listen = *:995
|
||||
}
|
||||
#
|
||||
shutdown_clients = yes
|
||||
|
||||
login_chroot = yes
|
||||
disable_plaintext_auth = no
|
||||
login_process_per_connection = yes
|
||||
login_processes_count = 2
|
||||
login_max_processes_count = 128
|
||||
login_max_connections = 256
|
||||
login_greeting = Welcome to <SERVERNAME> Mail Server.
|
||||
verbose_proctitle = no
|
||||
maildir_copy_with_hardlinks = yes
|
||||
|
||||
protocol imap {
|
||||
login_executable = /usr/local/libexec/dovecot/imap-login
|
||||
mail_executable = /usr/local/libexec/dovecot/imap
|
||||
imap_max_line_length = 65536
|
||||
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
|
||||
}
|
||||
|
||||
protocol pop3 {
|
||||
login_executable = /usr/local/libexec/dovecot/pop3-login
|
||||
mail_executable = /usr/local/libexec/dovecot/pop3
|
||||
pop3_uidl_format = %08Xu%08Xv
|
||||
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
|
||||
}
|
||||
|
||||
protocol lda {
|
||||
postmaster_address = postmaster@<SERVERNAME>
|
||||
sendmail_path = /usr/sbin/sendmail
|
||||
# mail_plugins = sieve
|
||||
# log_path = /var/log/dovecot-deliver.log
|
||||
# info_log_path = /var/log/dovecot-deliver.log
|
||||
}
|
||||
|
||||
protocol managesieve {
|
||||
# Specify an alternative address:port the daemon must listen on
|
||||
# (default: *:2000)
|
||||
# listen = localhost:2000
|
||||
# managesieve_logout_format = bytes ( in=%i : out=%o )
|
||||
}
|
||||
|
||||
|
||||
plugin {
|
||||
# quota = maildir
|
||||
# Used by both the Sieve plugin and the ManageSieve protocol
|
||||
# sieve=~/.dovecot.sieve
|
||||
# sieve_dir=~/sieve
|
||||
}
|
||||
|
||||
auth default {
|
||||
mechanisms = plain login
|
||||
passdb sql {
|
||||
args = /usr/local/etc/dovecot-sql.conf
|
||||
}
|
||||
userdb sql {
|
||||
args = /usr/local/etc/dovecot-sql.conf
|
||||
}
|
||||
user = root
|
||||
count = 1
|
||||
socket listen {
|
||||
master {
|
||||
path = /var/run/dovecot/auth-master
|
||||
mode = 0660
|
||||
user = vmail
|
||||
group = vmail
|
||||
}
|
||||
client {
|
||||
path = /var/spool/postfix/private/auth
|
||||
mode = 0660
|
||||
user = postfix
|
||||
group = postfix
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
smtpd_sender_restrictions =
|
||||
permit_sasl_authenticated,
|
||||
permit_mynetworks,
|
||||
reject_unknown_hostname,
|
||||
reject_unknown_recipient_domain,
|
||||
reject_unknown_sender_domain,
|
||||
|
||||
smtpd_recipient_restrictions =
|
||||
permit_mynetworks,
|
||||
permit_sasl_authenticated,
|
||||
reject_sender_login_mismatch,
|
||||
reject_non_fqdn_hostname,
|
||||
reject_non_fqdn_sender,
|
||||
reject_non_fqdn_recipient,
|
||||
reject_unauth_destination,
|
||||
reject_unauth_pipelining,
|
||||
reject_invalid_hostname,
|
||||
reject_rbl_client sbl-xbl.spamhaus.org,
|
||||
# sqlgrey enable
|
||||
# check_policy_service inet:127.0.0.1:2501,
|
||||
|
||||
smtpd_client_restrictions =
|
||||
permit_mynetworks,
|
||||
permit_sasl_authenticated,
|
||||
reject_unknown_client,
|
||||
|
||||
smtpd_sasl_auth_enable = yes
|
||||
smtpd_sasl_authenticated_header = yes
|
||||
smtpd_sasl_local_domain = $myhostname
|
||||
smtpd_sasl_security_options = noanonymous
|
||||
broken_sasl_auth_clients = yes
|
||||
smtpd_sasl_type = dovecot
|
||||
smtpd_sasl_path = private/auth
|
||||
|
||||
soft_bounce = yes
|
||||
|
||||
# Maximum size of Message in bytes (50MB)
|
||||
message_size_limit = 52428800
|
||||
|
||||
smtp_use_tls = yes
|
||||
smtpd_use_tls = yes
|
||||
smtpd_tls_security_level = may
|
||||
smtpd_tls_auth_only = no
|
||||
smtp_tls_note_starttls_offer = yes
|
||||
smtpd_tls_key_file = /etc/ssl/<SERVERNAME>.key.unencrypted
|
||||
smtpd_tls_cert_file = /etc/ssl/<SERVERNAME>.crt
|
||||
smtpd_tls_CAfile = /etc/ssl/cacert.class3.crt # Just an example for CACert.org
|
||||
smtpd_tls_loglevel = 0
|
||||
smtpd_tls_received_header = yes
|
||||
smtpd_tls_session_cache_timeout = 3600s
|
||||
tls_random_source = dev:/dev/urandom
|
||||
|
||||
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql-virtual_alias_maps.cf
|
||||
virtual_mailbox_base = <VIRTUAL_MAILBOX_BASE>
|
||||
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql-virtual_mailbox_domains.cf
|
||||
virtual_mailbox_limit = 0
|
||||
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql-virtual_mailbox_maps.cf
|
||||
virtual_uid_maps = static:<VIRTUAL_UID_MAPS>
|
||||
virtual_gid_maps = static:<VIRTUAL_GID_MAPS>
|
||||
virtual_create_maildirsize = yes
|
||||
virtual_mailbox_extended = yes
|
||||
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
|
||||
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
|
||||
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
|
||||
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
|
||||
virtual_mailbox_limit_override = yes
|
||||
virtual_maildir_limit_message = Sorry, this user has overdrawn their diskspace quota. Please try again later.
|
||||
virtual_overquota_bounce = yes
|
||||
virtual_transport = virtual
|
||||
## Dovecot Settings for deliver, SASL Auth and virtual transport
|
||||
# uncomment those line to use Dovecot
|
||||
#mailbox_command = /usr/local/libexec/dovecot/deliver
|
||||
#virtual_transport = dovecot
|
||||
#dovecot_destination_recipient_limit = 1
|
||||
#alias_maps = $alias_database
|
||||
|
||||
queue_directory = /var/spool/postfix
|
||||
command_directory = /usr/local/sbin
|
||||
daemon_directory = /usr/local/libexec/postfix
|
||||
data_directory = /var/db/postfix
|
||||
mail_owner = postfix
|
||||
myhostname = <SERVERNAME>
|
||||
mydomain = <SERVERNAME>
|
||||
myorigin = $mydomain
|
||||
inet_interfaces = all
|
||||
unknown_local_recipient_reject_code = 550
|
||||
mynetworks_style = host
|
||||
debug_peer_level = 2
|
||||
debugger_command =
|
||||
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
|
||||
ddd $daemon_directory/$process_name $process_id & sleep 5
|
||||
sendmail_path = /usr/local/sbin/sendmail
|
||||
newaliases_path = /usr/local/bin/newaliases
|
||||
mailq_path = /usr/local/bin/mailq
|
||||
setgid_group = maildrop
|
||||
html_directory = /usr/local/share/doc/postfix
|
||||
manpage_directory = /usr/local/man
|
||||
sample_directory = /usr/local/etc/postfix
|
||||
readme_directory = /usr/local/share/doc/postfix
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
user = <SQL_UNPRIVILEGED_USER>
|
||||
password = <SQL_UNPRIVILEGED_PASSWORD>
|
||||
dbname = <SQL_DB>
|
||||
table = mail_virtual
|
||||
select_field = destination
|
||||
where_field = email
|
||||
additional_conditions = and TRIM(destination) <> ''
|
||||
hosts = <SQL_HOST>
|
||||
@@ -0,0 +1,8 @@
|
||||
user = <SQL_UNPRIVILEGED_USER>
|
||||
password = <SQL_UNPRIVILEGED_PASSWORD>
|
||||
dbname = <SQL_DB>
|
||||
table = panel_domains
|
||||
select_field = domain
|
||||
where_field = domain
|
||||
additional_conditions = and isemaildomain = '1'
|
||||
hosts = <SQL_HOST>
|
||||
@@ -0,0 +1,7 @@
|
||||
user = <SQL_UNPRIVILEGED_USER>
|
||||
password = <SQL_UNPRIVILEGED_PASSWORD>
|
||||
dbname = <SQL_DB>
|
||||
table = mail_users
|
||||
select_field = maildir
|
||||
where_field = email
|
||||
hosts = <SQL_HOST>
|
||||
Reference in New Issue
Block a user