smartmachine 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smart_machine/commands/grid.rb +8 -0
- data/lib/smart_machine/commands/grid_commands/emailer.rb +107 -0
- data/lib/smart_machine/commands/grid_commands/roundcube.rb +65 -0
- data/lib/smart_machine/configuration.rb +35 -2
- data/lib/smart_machine/credentials.rb +10 -0
- data/lib/smart_machine/engine.rb +6 -0
- data/lib/smart_machine/grids/adminer.rb +1 -0
- data/lib/smart_machine/grids/certbot.rb +1 -0
- data/lib/smart_machine/grids/emailer/.keep +0 -0
- data/lib/smart_machine/grids/emailer.rb +188 -0
- data/lib/smart_machine/grids/haproxy.rb +1 -0
- data/lib/smart_machine/grids/mariadb.rb +1 -0
- data/lib/smart_machine/grids/postgresql.rb +1 -0
- data/lib/smart_machine/grids/roundcube.rb +114 -0
- data/lib/smart_machine/machine.rb +7 -0
- data/lib/smart_machine/syncer.rb +10 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/command.rb +50 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/entrypoint.rb +196 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/docker/logtailer.rb +75 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-auth.conf +132 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-mail.conf +427 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-master.conf +153 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/10-ssl.conf +87 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/15-mailboxes.conf +94 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-imap.conf +102 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-lmtp.conf +43 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-quota.conf +114 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-sieve.conf +229 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/dovecot-sql.conf.ext +163 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-ham.sh +2 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-ham.sieve +5 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-spam.sh +2 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve/learn-spam.sieve +2 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/sieve-after/spam-to-folder.sieve +6 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/haproxy/haproxy.cfg +58 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/monit/conf.d/services.cfg +70 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/monit/monitrc +344 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/opendkim.conf +71 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/main.cf +123 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/master.cf +149 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-sender-login-maps.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-domains.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-domains.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-masters.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-users.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-alias-maps-userstothemselves.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-mailbox-domains.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix/mysql-virtual-mailbox-maps.cf +7 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/postfix-policyd-spf-python/policyd-spf.conf +12 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/spamassassin/local.cf +124 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer/usr/local/bin/quota-warning.sh +22 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/emailer.yml +37 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/engine.yml +2 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/etc/apache2/sites-available/000-default.conf +35 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/usr/local/etc/php/conf.d/zzz_roundcube-custom.ini +4 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/roundcube/var/roundcube/config/config.custom.inc.php +25 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/roundcube.yml +41 -0
- data/lib/smart_machine/templates/dotsmartmachine/config/users.yml +1 -1
- data/lib/smart_machine/version.rb +2 -2
- data/lib/smart_machine.rb +2 -0
- metadata +55 -4
data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/15-mailboxes.conf
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
##
|
2
|
+
## Mailbox definitions
|
3
|
+
##
|
4
|
+
|
5
|
+
# Each mailbox is specified in a separate mailbox section. The section name
|
6
|
+
# specifies the mailbox name. If it has spaces, you can put the name
|
7
|
+
# "in quotes". These sections can contain the following mailbox settings:
|
8
|
+
#
|
9
|
+
# auto:
|
10
|
+
# Indicates whether the mailbox with this name is automatically created
|
11
|
+
# implicitly when it is first accessed. The user can also be automatically
|
12
|
+
# subscribed to the mailbox after creation. The following values are
|
13
|
+
# defined for this setting:
|
14
|
+
#
|
15
|
+
# no - Never created automatically.
|
16
|
+
# create - Automatically created, but no automatic subscription.
|
17
|
+
# subscribe - Automatically created and subscribed.
|
18
|
+
#
|
19
|
+
# special_use:
|
20
|
+
# A space-separated list of SPECIAL-USE flags (RFC 6154) to use for the
|
21
|
+
# mailbox. There are no validity checks, so you could specify anything
|
22
|
+
# you want in here, but it's not a good idea to use flags other than the
|
23
|
+
# standard ones specified in the RFC:
|
24
|
+
#
|
25
|
+
# \All - This (virtual) mailbox presents all messages in the
|
26
|
+
# user's message store.
|
27
|
+
# \Archive - This mailbox is used to archive messages.
|
28
|
+
# \Drafts - This mailbox is used to hold draft messages.
|
29
|
+
# \Flagged - This (virtual) mailbox presents all messages in the
|
30
|
+
# user's message store marked with the IMAP \Flagged flag.
|
31
|
+
# \Important - This (virtual) mailbox presents all messages in the
|
32
|
+
# user's message store deemed important to user.
|
33
|
+
# \Junk - This mailbox is where messages deemed to be junk mail
|
34
|
+
# are held.
|
35
|
+
# \Sent - This mailbox is used to hold copies of messages that
|
36
|
+
# have been sent.
|
37
|
+
# \Trash - This mailbox is used to hold messages that have been
|
38
|
+
# deleted.
|
39
|
+
#
|
40
|
+
# comment:
|
41
|
+
# Defines a default comment or note associated with the mailbox. This
|
42
|
+
# value is accessible through the IMAP METADATA mailbox entries
|
43
|
+
# "/shared/comment" and "/private/comment". Users with sufficient
|
44
|
+
# privileges can override the default value for entries with a custom
|
45
|
+
# value.
|
46
|
+
|
47
|
+
# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
|
48
|
+
namespace inbox {
|
49
|
+
# These mailboxes are widely used and could perhaps be created automatically:
|
50
|
+
mailbox Drafts {
|
51
|
+
special_use = \Drafts
|
52
|
+
}
|
53
|
+
mailbox Junk {
|
54
|
+
special_use = \Junk
|
55
|
+
##### SmartMachine Begin.
|
56
|
+
auto = subscribe
|
57
|
+
autoexpunge = 30d
|
58
|
+
##### SmartMachine Close.
|
59
|
+
}
|
60
|
+
mailbox Trash {
|
61
|
+
special_use = \Trash
|
62
|
+
##### SmartMachine Begin.
|
63
|
+
auto = subscribe
|
64
|
+
autoexpunge = 30d
|
65
|
+
##### SmartMachine Close.
|
66
|
+
}
|
67
|
+
|
68
|
+
# For \Sent mailboxes there are two widely used names. We'll mark both of
|
69
|
+
# them as \Sent. User typically deletes one of them if duplicates are created.
|
70
|
+
mailbox Sent {
|
71
|
+
special_use = \Sent
|
72
|
+
}
|
73
|
+
mailbox "Sent Messages" {
|
74
|
+
special_use = \Sent
|
75
|
+
}
|
76
|
+
|
77
|
+
# If you have a virtual "All messages" mailbox:
|
78
|
+
#mailbox virtual/All {
|
79
|
+
# special_use = \All
|
80
|
+
# comment = All my messages
|
81
|
+
#}
|
82
|
+
|
83
|
+
# If you have a virtual "Flagged" mailbox:
|
84
|
+
#mailbox virtual/Flagged {
|
85
|
+
# special_use = \Flagged
|
86
|
+
# comment = All my flagged messages
|
87
|
+
#}
|
88
|
+
|
89
|
+
# If you have a virtual "Important" mailbox:
|
90
|
+
#mailbox virtual/Important {
|
91
|
+
# special_use = \Important
|
92
|
+
# comment = All my important messages
|
93
|
+
#}
|
94
|
+
}
|
data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-imap.conf
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
##
|
2
|
+
## IMAP specific settings
|
3
|
+
##
|
4
|
+
|
5
|
+
# If nothing happens for this long while client is IDLEing, move the connection
|
6
|
+
# to imap-hibernate process and close the old imap process. This saves memory,
|
7
|
+
# because connections use very little memory in imap-hibernate process. The
|
8
|
+
# downside is that recreating the imap process back uses some resources.
|
9
|
+
#imap_hibernate_timeout = 0
|
10
|
+
|
11
|
+
# Maximum IMAP command line length. Some clients generate very long command
|
12
|
+
# lines with huge mailboxes, so you may need to raise this if you get
|
13
|
+
# "Too long argument" or "IMAP command line too large" errors often.
|
14
|
+
#imap_max_line_length = 64k
|
15
|
+
|
16
|
+
# IMAP logout format string:
|
17
|
+
# %i - total number of bytes read from client
|
18
|
+
# %o - total number of bytes sent to client
|
19
|
+
# %{fetch_hdr_count} - Number of mails with mail header data sent to client
|
20
|
+
# %{fetch_hdr_bytes} - Number of bytes with mail header data sent to client
|
21
|
+
# %{fetch_body_count} - Number of mails with mail body data sent to client
|
22
|
+
# %{fetch_body_bytes} - Number of bytes with mail body data sent to client
|
23
|
+
# %{deleted} - Number of mails where client added \Deleted flag
|
24
|
+
# %{expunged} - Number of mails that client expunged, which does not
|
25
|
+
# include automatically expunged mails
|
26
|
+
# %{autoexpunged} - Number of mails that were automatically expunged after
|
27
|
+
# client disconnected
|
28
|
+
# %{trashed} - Number of mails that client copied/moved to the
|
29
|
+
# special_use=\Trash mailbox.
|
30
|
+
# %{appended} - Number of mails saved during the session
|
31
|
+
#imap_logout_format = in=%i out=%o deleted=%{deleted} expunged=%{expunged} \
|
32
|
+
# trashed=%{trashed} hdr_count=%{fetch_hdr_count} \
|
33
|
+
# hdr_bytes=%{fetch_hdr_bytes} body_count=%{fetch_body_count} \
|
34
|
+
# body_bytes=%{fetch_body_bytes}
|
35
|
+
|
36
|
+
# Override the IMAP CAPABILITY response. If the value begins with '+',
|
37
|
+
# add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
|
38
|
+
#imap_capability =
|
39
|
+
|
40
|
+
# How long to wait between "OK Still here" notifications when client is
|
41
|
+
# IDLEing.
|
42
|
+
#imap_idle_notify_interval = 2 mins
|
43
|
+
|
44
|
+
# ID field names and values to send to clients. Using * as the value makes
|
45
|
+
# Dovecot use the default value. The following fields have default values
|
46
|
+
# currently: name, version, os, os-version, support-url, support-email,
|
47
|
+
# revision.
|
48
|
+
#imap_id_send =
|
49
|
+
|
50
|
+
# ID fields sent by client to log. * means everything.
|
51
|
+
#imap_id_log =
|
52
|
+
|
53
|
+
# Workarounds for various client bugs:
|
54
|
+
# delay-newmail:
|
55
|
+
# Send EXISTS/RECENT new mail notifications only when replying to NOOP
|
56
|
+
# and CHECK commands. Some clients ignore them otherwise, for example OSX
|
57
|
+
# Mail (<v2.1). Outlook Express breaks more badly though, without this it
|
58
|
+
# may show user "Message no longer in server" errors. Note that OE6 still
|
59
|
+
# breaks even with this workaround if synchronization is set to
|
60
|
+
# "Headers Only".
|
61
|
+
# tb-extra-mailbox-sep:
|
62
|
+
# Thunderbird gets somehow confused with LAYOUT=fs (mbox and dbox) and
|
63
|
+
# adds extra '/' suffixes to mailbox names. This option causes Dovecot to
|
64
|
+
# ignore the extra '/' instead of treating it as invalid mailbox name.
|
65
|
+
# tb-lsub-flags:
|
66
|
+
# Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g. mbox).
|
67
|
+
# This makes Thunderbird realize they aren't selectable and show them
|
68
|
+
# greyed out, instead of only later giving "not selectable" popup error.
|
69
|
+
#
|
70
|
+
# The list is space-separated.
|
71
|
+
#imap_client_workarounds =
|
72
|
+
|
73
|
+
# Host allowed in URLAUTH URLs sent by client. "*" allows all.
|
74
|
+
#imap_urlauth_host =
|
75
|
+
|
76
|
+
# Enable IMAP LITERAL- extension (replaces LITERAL+)
|
77
|
+
#imap_literal_minus = no
|
78
|
+
|
79
|
+
# What happens when FETCH fails due to some internal error:
|
80
|
+
# disconnect-immediately:
|
81
|
+
# The FETCH is aborted immediately and the IMAP client is disconnected.
|
82
|
+
# disconnect-after:
|
83
|
+
# The FETCH runs for all the requested mails returning as much data as
|
84
|
+
# possible. The client is finally disconnected without a tagged reply.
|
85
|
+
# no-after:
|
86
|
+
# Same as disconnect-after, but tagged NO reply is sent instead of
|
87
|
+
# disconnecting the client. If the client attempts to FETCH the same failed
|
88
|
+
# mail more than once, the client is disconnected. This is to avoid clients
|
89
|
+
# from going into infinite loops trying to FETCH a broken mail.
|
90
|
+
#imap_fetch_failure = disconnect-immediately
|
91
|
+
|
92
|
+
protocol imap {
|
93
|
+
# Space separated list of plugins to load (default is global mail_plugins).
|
94
|
+
#mail_plugins = $mail_plugins
|
95
|
+
##### SmartMachine Begin.
|
96
|
+
mail_plugins = $mail_plugins quota imap_sieve
|
97
|
+
##### SmartMachine Close.
|
98
|
+
|
99
|
+
# Maximum number of IMAP connections allowed for a user from each IP address.
|
100
|
+
# NOTE: The username is compared case-sensitively.
|
101
|
+
#mail_max_userip_connections = 10
|
102
|
+
}
|
data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/20-lmtp.conf
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
##
|
2
|
+
## LMTP specific settings
|
3
|
+
##
|
4
|
+
|
5
|
+
# Support proxying to other LMTP/SMTP servers by performing passdb lookups.
|
6
|
+
#lmtp_proxy = no
|
7
|
+
|
8
|
+
# When recipient address includes the detail (e.g. user+detail), try to save
|
9
|
+
# the mail to the detail mailbox. See also recipient_delimiter and
|
10
|
+
# lda_mailbox_autocreate settings.
|
11
|
+
#lmtp_save_to_detail_mailbox = no
|
12
|
+
|
13
|
+
# Verify quota before replying to RCPT TO. This adds a small overhead.
|
14
|
+
#lmtp_rcpt_check_quota = no
|
15
|
+
|
16
|
+
# Add "Received:" header to mails delivered.
|
17
|
+
#lmtp_add_received_header = yes
|
18
|
+
|
19
|
+
# Which recipient address to use for Delivered-To: header and Received:
|
20
|
+
# header. The default is "final", which is the same as the one given to
|
21
|
+
# RCPT TO command. "original" uses the address given in RCPT TO's ORCPT
|
22
|
+
# parameter, "none" uses nothing. Note that "none" is currently always used
|
23
|
+
# when a mail has multiple recipients.
|
24
|
+
#lmtp_hdr_delivery_address = final
|
25
|
+
|
26
|
+
# Workarounds for various client bugs:
|
27
|
+
# whitespace-before-path:
|
28
|
+
# Allow one or more spaces or tabs between `MAIL FROM:' and path and between
|
29
|
+
# `RCPT TO:' and path.
|
30
|
+
# mailbox-for-path:
|
31
|
+
# Allow using bare Mailbox syntax (i.e., without <...>) instead of full path
|
32
|
+
# syntax.
|
33
|
+
#
|
34
|
+
# The list is space-separated.
|
35
|
+
#lmtp_client_workarounds =
|
36
|
+
|
37
|
+
protocol lmtp {
|
38
|
+
# Space separated list of plugins to load (default is global mail_plugins).
|
39
|
+
#mail_plugins = $mail_plugins
|
40
|
+
##### SmartMachine Begin.
|
41
|
+
mail_plugins = $mail_plugins sieve
|
42
|
+
##### SmartMachine Close.
|
43
|
+
}
|
data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-quota.conf
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
##
|
2
|
+
## Quota configuration.
|
3
|
+
##
|
4
|
+
|
5
|
+
# Note that you also have to enable quota plugin in mail_plugins setting.
|
6
|
+
# <doc/wiki/Quota.txt>
|
7
|
+
|
8
|
+
##
|
9
|
+
## Quota limits
|
10
|
+
##
|
11
|
+
|
12
|
+
# Quota limits are set using "quota_rule" parameters. To get per-user quota
|
13
|
+
# limits, you can set/override them by returning "quota_rule" extra field
|
14
|
+
# from userdb. It's also possible to give mailbox-specific limits, for example
|
15
|
+
# to give additional 100 MB when saving to Trash:
|
16
|
+
|
17
|
+
plugin {
|
18
|
+
#quota_rule = *:storage=1G
|
19
|
+
#quota_rule2 = Trash:storage=+100M
|
20
|
+
|
21
|
+
# LDA/LMTP allows saving the last mail to bring user from under quota to
|
22
|
+
# over quota, if the quota doesn't grow too high. Default is to allow as
|
23
|
+
# long as quota will stay under 10% above the limit. Also allowed e.g. 10M.
|
24
|
+
#quota_grace = 10%%
|
25
|
+
|
26
|
+
# Quota plugin can also limit the maximum accepted mail size.
|
27
|
+
#quota_max_mail_size = 100M
|
28
|
+
}
|
29
|
+
|
30
|
+
##
|
31
|
+
## Quota warnings
|
32
|
+
##
|
33
|
+
|
34
|
+
# You can execute a given command when user exceeds a specified quota limit.
|
35
|
+
# Each quota root has separate limits. Only the command for the first
|
36
|
+
# exceeded limit is executed, so put the highest limit first.
|
37
|
+
# The commands are executed via script service by connecting to the named
|
38
|
+
# UNIX socket (quota-warning below).
|
39
|
+
# Note that % needs to be escaped as %%, otherwise "% " expands to empty.
|
40
|
+
|
41
|
+
plugin {
|
42
|
+
#quota_warning = storage=95%% quota-warning 95 %u
|
43
|
+
#quota_warning2 = storage=80%% quota-warning 80 %u
|
44
|
+
}
|
45
|
+
|
46
|
+
# Example quota-warning service. The unix listener's permissions should be
|
47
|
+
# set in a way that mail processes can connect to it. Below example assumes
|
48
|
+
# that mail processes run as vmail user. If you use mode=0666, all system users
|
49
|
+
# can generate quota warnings to anyone.
|
50
|
+
#service quota-warning {
|
51
|
+
# executable = script /usr/local/bin/quota-warning.sh
|
52
|
+
# user = dovecot
|
53
|
+
# unix_listener quota-warning {
|
54
|
+
# user = vmail
|
55
|
+
# }
|
56
|
+
#}
|
57
|
+
|
58
|
+
##
|
59
|
+
## Quota backends
|
60
|
+
##
|
61
|
+
|
62
|
+
# Multiple backends are supported:
|
63
|
+
# dirsize: Find and sum all the files found from mail directory.
|
64
|
+
# Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.
|
65
|
+
# dict: Keep quota stored in dictionary (eg. SQL)
|
66
|
+
# maildir: Maildir++ quota
|
67
|
+
# fs: Read-only support for filesystem quota
|
68
|
+
|
69
|
+
plugin {
|
70
|
+
#quota = dirsize:User quota
|
71
|
+
#quota = maildir:User quota
|
72
|
+
#quota = dict:User quota::proxy::quota
|
73
|
+
#quota = fs:User quota
|
74
|
+
}
|
75
|
+
|
76
|
+
# Multiple quota roots are also possible, for example this gives each user
|
77
|
+
# their own 100MB quota and one shared 1GB quota within the domain:
|
78
|
+
plugin {
|
79
|
+
#quota = dict:user::proxy::quota
|
80
|
+
#quota2 = dict:domain:%d:proxy::quota_domain
|
81
|
+
#quota_rule = *:storage=102400
|
82
|
+
#quota2_rule = *:storage=1048576
|
83
|
+
}
|
84
|
+
|
85
|
+
##### SmartMachine Begin.
|
86
|
+
plugin {
|
87
|
+
quota = count:User quota
|
88
|
+
quota_vsizes = yes
|
89
|
+
|
90
|
+
quota_status_success = DUNNO
|
91
|
+
quota_status_nouser = DUNNO
|
92
|
+
quota_status_overquota = "452 4.2.2 Mailbox is full and cannot receive any more emails"
|
93
|
+
}
|
94
|
+
|
95
|
+
service quota-status {
|
96
|
+
executable = /usr/lib/dovecot/quota-status -p postfix
|
97
|
+
unix_listener /var/spool/postfix/private/quota-status {
|
98
|
+
user = postfix
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
plugin {
|
103
|
+
quota_warning = storage=95%% quota-warning 95 %u
|
104
|
+
quota_warning2 = storage=80%% quota-warning 80 %u
|
105
|
+
}
|
106
|
+
service quota-warning {
|
107
|
+
executable = script /usr/local/bin/quota-warning.sh
|
108
|
+
unix_listener quota-warning {
|
109
|
+
user = vmail
|
110
|
+
group = vmail
|
111
|
+
mode = 0660
|
112
|
+
}
|
113
|
+
}
|
114
|
+
##### SmartMachine Close.
|
data/lib/smart_machine/templates/dotsmartmachine/config/emailer/etc/dovecot/conf.d/90-sieve.conf
ADDED
@@ -0,0 +1,229 @@
|
|
1
|
+
##
|
2
|
+
## Settings for the Sieve interpreter
|
3
|
+
##
|
4
|
+
|
5
|
+
# Do not forget to enable the Sieve plugin in 15-lda.conf and 20-lmtp.conf
|
6
|
+
# by adding it to the respective mail_plugins= settings.
|
7
|
+
|
8
|
+
# The Sieve interpreter can retrieve Sieve scripts from several types of
|
9
|
+
# locations. The default `file' location type is a local filesystem path
|
10
|
+
# pointing to a Sieve script file or a directory containing multiple Sieve
|
11
|
+
# script files. More complex setups can use other location types such as
|
12
|
+
# `ldap' or `dict' to fetch Sieve scripts from remote databases.
|
13
|
+
#
|
14
|
+
# All settings that specify the location of one ore more Sieve scripts accept
|
15
|
+
# the following syntax:
|
16
|
+
#
|
17
|
+
# location = [<type>:]path[;<option>[=<value>][;...]]
|
18
|
+
#
|
19
|
+
# If the type prefix is omitted, the script location type is 'file' and the
|
20
|
+
# location is interpreted as a local filesystem path pointing to a Sieve script
|
21
|
+
# file or directory. Refer to Pigeonhole wiki or INSTALL file for more
|
22
|
+
# information.
|
23
|
+
|
24
|
+
plugin {
|
25
|
+
# The location of the user's main Sieve script or script storage. The LDA
|
26
|
+
# Sieve plugin uses this to find the active script for Sieve filtering at
|
27
|
+
# delivery. The "include" extension uses this location for retrieving
|
28
|
+
# :personal" scripts. This is also where the ManageSieve service will store
|
29
|
+
# the user's scripts, if supported.
|
30
|
+
#
|
31
|
+
# Currently only the 'file:' location type supports ManageSieve operation.
|
32
|
+
# Other location types like 'dict:' and 'ldap:' can currently only
|
33
|
+
# be used as a read-only script source ().
|
34
|
+
#
|
35
|
+
# For the 'file:' type: use the ';active=' parameter to specify where the
|
36
|
+
# active script symlink is located.
|
37
|
+
# For other types: use the ';name=' parameter to specify the name of the
|
38
|
+
# default/active script.
|
39
|
+
sieve = file:~/sieve;active=~/.dovecot.sieve
|
40
|
+
|
41
|
+
# The default Sieve script when the user has none. This is the location of a
|
42
|
+
# global sieve script file, which gets executed ONLY if user's personal Sieve
|
43
|
+
# script doesn't exist. Be sure to pre-compile this script manually using the
|
44
|
+
# sievec command line tool if the binary is not stored in a global location.
|
45
|
+
# --> See sieve_before for executing scripts before the user's personal
|
46
|
+
# script.
|
47
|
+
#sieve_default = /var/lib/dovecot/sieve/default.sieve
|
48
|
+
|
49
|
+
# The name by which the default Sieve script (as configured by the
|
50
|
+
# sieve_default setting) is visible to the user through ManageSieve.
|
51
|
+
#sieve_default_name =
|
52
|
+
|
53
|
+
# Location for ":global" include scripts as used by the "include" extension.
|
54
|
+
#sieve_global =
|
55
|
+
|
56
|
+
# The location of a Sieve script that is run for any message that is about to
|
57
|
+
# be discarded; i.e., it is not delivered anywhere by the normal Sieve
|
58
|
+
# execution. This only happens when the "implicit keep" is canceled, by e.g.
|
59
|
+
# the "discard" action, and no actions that deliver the message are executed.
|
60
|
+
# This "discard script" can prevent discarding the message, by executing
|
61
|
+
# alternative actions. If the discard script does nothing, the message is
|
62
|
+
# still discarded as it would be when no discard script is configured.
|
63
|
+
#sieve_discard =
|
64
|
+
|
65
|
+
# Location Sieve of scripts that need to be executed before the user's
|
66
|
+
# personal script. If a 'file' location path points to a directory, all the
|
67
|
+
# Sieve scripts contained therein (with the proper `.sieve' extension) are
|
68
|
+
# executed. The order of execution within that directory is determined by the
|
69
|
+
# file names, using a normal 8bit per-character comparison.
|
70
|
+
#
|
71
|
+
# Multiple script locations can be specified by appending an increasing number
|
72
|
+
# to the setting name. The Sieve scripts found from these locations are added
|
73
|
+
# to the script execution sequence in the specified order. Reading the
|
74
|
+
# numbered sieve_before settings stops at the first missing setting, so no
|
75
|
+
# numbers may be skipped.
|
76
|
+
#sieve_before = /var/lib/dovecot/sieve.d/
|
77
|
+
#sieve_before2 = ldap:/etc/sieve-ldap.conf;name=ldap-domain
|
78
|
+
#sieve_before3 = (etc...)
|
79
|
+
|
80
|
+
# Identical to sieve_before, only the specified scripts are executed after the
|
81
|
+
# user's script (only when keep is still in effect!). Multiple script
|
82
|
+
# locations can be specified by appending an increasing number.
|
83
|
+
#sieve_after =
|
84
|
+
#sieve_after2 =
|
85
|
+
#sieve_after2 = (etc...)
|
86
|
+
##### SmartMachine Begin.
|
87
|
+
sieve_after = /etc/dovecot/sieve-after
|
88
|
+
##### SmartMachine Close.
|
89
|
+
|
90
|
+
# Which Sieve language extensions are available to users. By default, all
|
91
|
+
# supported extensions are available, except for deprecated extensions or
|
92
|
+
# those that are still under development. Some system administrators may want
|
93
|
+
# to disable certain Sieve extensions or enable those that are not available
|
94
|
+
# by default. This setting can use '+' and '-' to specify differences relative
|
95
|
+
# to the default. For example `sieve_extensions = +imapflags' will enable the
|
96
|
+
# deprecated imapflags extension in addition to all extensions were already
|
97
|
+
# enabled by default.
|
98
|
+
#sieve_extensions = +notify +imapflags
|
99
|
+
|
100
|
+
# Which Sieve language extensions are ONLY available in global scripts. This
|
101
|
+
# can be used to restrict the use of certain Sieve extensions to administrator
|
102
|
+
# control, for instance when these extensions can cause security concerns.
|
103
|
+
# This setting has higher precedence than the `sieve_extensions' setting
|
104
|
+
# (above), meaning that the extensions enabled with this setting are never
|
105
|
+
# available to the user's personal script no matter what is specified for the
|
106
|
+
# `sieve_extensions' setting. The syntax of this setting is similar to the
|
107
|
+
# `sieve_extensions' setting, with the difference that extensions are
|
108
|
+
# enabled or disabled for exclusive use in global scripts. Currently, no
|
109
|
+
# extensions are marked as such by default.
|
110
|
+
#sieve_global_extensions =
|
111
|
+
##### SmartMachine Begin.
|
112
|
+
sieve_global_extensions = +vnd.dovecot.pipe
|
113
|
+
##### SmartMachine Close.
|
114
|
+
|
115
|
+
# The Pigeonhole Sieve interpreter can have plugins of its own. Using this
|
116
|
+
# setting, the used plugins can be specified. Check the Dovecot wiki
|
117
|
+
# (wiki2.dovecot.org) or the pigeonhole website
|
118
|
+
# (http://pigeonhole.dovecot.org) for available plugins.
|
119
|
+
# The sieve_extprograms plugin is included in this release.
|
120
|
+
#sieve_plugins =
|
121
|
+
##### SmartMachine Begin.
|
122
|
+
sieve_plugins = sieve_imapsieve sieve_extprograms
|
123
|
+
##### SmartMachine Close.
|
124
|
+
|
125
|
+
# The maximum size of a Sieve script. The compiler will refuse to compile any
|
126
|
+
# script larger than this limit. If set to 0, no limit on the script size is
|
127
|
+
# enforced.
|
128
|
+
#sieve_max_script_size = 1M
|
129
|
+
|
130
|
+
# The maximum number of actions that can be performed during a single script
|
131
|
+
# execution. If set to 0, no limit on the total number of actions is enforced.
|
132
|
+
#sieve_max_actions = 32
|
133
|
+
|
134
|
+
# The maximum number of redirect actions that can be performed during a single
|
135
|
+
# script execution. If set to 0, no redirect actions are allowed.
|
136
|
+
#sieve_max_redirects = 4
|
137
|
+
|
138
|
+
# The maximum number of personal Sieve scripts a single user can have. If set
|
139
|
+
# to 0, no limit on the number of scripts is enforced.
|
140
|
+
# (Currently only relevant for ManageSieve)
|
141
|
+
#sieve_quota_max_scripts = 0
|
142
|
+
|
143
|
+
# The maximum amount of disk storage a single user's scripts may occupy. If
|
144
|
+
# set to 0, no limit on the used amount of disk storage is enforced.
|
145
|
+
# (Currently only relevant for ManageSieve)
|
146
|
+
#sieve_quota_max_storage = 0
|
147
|
+
|
148
|
+
# The primary e-mail address for the user. This is used as a default when no
|
149
|
+
# other appropriate address is available for sending messages. If this setting
|
150
|
+
# is not configured, either the postmaster or null "<>" address is used as a
|
151
|
+
# sender, depending on the action involved. This setting is important when
|
152
|
+
# there is no message envelope to extract addresses from, such as when the
|
153
|
+
# script is executed in IMAP.
|
154
|
+
#sieve_user_email =
|
155
|
+
|
156
|
+
# The path to the file where the user log is written. If not configured, a
|
157
|
+
# default location is used. If the main user's personal Sieve (as configured
|
158
|
+
# with sieve=) is a file, the logfile is set to <filename>.log by default. If
|
159
|
+
# it is not a file, the default user log file is ~/.dovecot.sieve.log.
|
160
|
+
#sieve_user_log =
|
161
|
+
|
162
|
+
# Specifies what envelope sender address is used for redirected messages.
|
163
|
+
# The following values are supported for this setting:
|
164
|
+
#
|
165
|
+
# "sender" - The sender address is used (default).
|
166
|
+
# "recipient" - The final recipient address is used.
|
167
|
+
# "orig_recipient" - The original recipient is used.
|
168
|
+
# "user_email" - The user's primary address is used. This is
|
169
|
+
# configured with the "sieve_user_email" setting. If
|
170
|
+
# that setting is unconfigured, "user_mail" is equal to
|
171
|
+
# "recipient".
|
172
|
+
# "postmaster" - The postmaster_address configured for the LDA.
|
173
|
+
# "<user@domain>" - Redirected messages are always sent from user@domain.
|
174
|
+
# The angle brackets are mandatory. The null "<>" address
|
175
|
+
# is also supported.
|
176
|
+
#
|
177
|
+
# This setting is ignored when the envelope sender is "<>". In that case the
|
178
|
+
# sender of the redirected message is also always "<>".
|
179
|
+
#sieve_redirect_envelope_from = sender
|
180
|
+
|
181
|
+
##### SmartMachine Begin.
|
182
|
+
# From elsewhere to Junk folder
|
183
|
+
imapsieve_mailbox1_name = Junk
|
184
|
+
imapsieve_mailbox1_causes = COPY
|
185
|
+
imapsieve_mailbox1_before = file:/etc/dovecot/sieve/learn-spam.sieve
|
186
|
+
|
187
|
+
# From Junk folder to elsewhere
|
188
|
+
imapsieve_mailbox2_name = *
|
189
|
+
imapsieve_mailbox2_from = Junk
|
190
|
+
imapsieve_mailbox2_causes = COPY
|
191
|
+
imapsieve_mailbox2_before = file:/etc/dovecot/sieve/learn-ham.sieve
|
192
|
+
|
193
|
+
sieve_pipe_bin_dir = /etc/dovecot/sieve
|
194
|
+
##### SmartMachine Close.
|
195
|
+
|
196
|
+
## TRACE DEBUGGING
|
197
|
+
# Trace debugging provides detailed insight in the operations performed by
|
198
|
+
# the Sieve script. These settings apply to both the LDA Sieve plugin and the
|
199
|
+
# IMAPSIEVE plugin.
|
200
|
+
#
|
201
|
+
# WARNING: On a busy server, this functionality can quickly fill up the trace
|
202
|
+
# directory with a lot of trace files. Enable this only temporarily and as
|
203
|
+
# selective as possible.
|
204
|
+
|
205
|
+
# The directory where trace files are written. Trace debugging is disabled if
|
206
|
+
# this setting is not configured or if the directory does not exist. If the
|
207
|
+
# path is relative or it starts with "~/" it is interpreted relative to the
|
208
|
+
# current user's home directory.
|
209
|
+
#sieve_trace_dir =
|
210
|
+
|
211
|
+
# The verbosity level of the trace messages. Trace debugging is disabled if
|
212
|
+
# this setting is not configured. Possible values are:
|
213
|
+
#
|
214
|
+
# "actions" - Only print executed action commands, like keep,
|
215
|
+
# fileinto, reject and redirect.
|
216
|
+
# "commands" - Print any executed command, excluding test commands.
|
217
|
+
# "tests" - Print all executed commands and performed tests.
|
218
|
+
# "matching" - Print all executed commands, performed tests and the
|
219
|
+
# values matched in those tests.
|
220
|
+
#sieve_trace_level =
|
221
|
+
|
222
|
+
# Enables highly verbose debugging messages that are usually only useful for
|
223
|
+
# developers.
|
224
|
+
#sieve_trace_debug = no
|
225
|
+
|
226
|
+
# Enables showing byte code addresses in the trace output, rather than only
|
227
|
+
# the source line numbers.
|
228
|
+
#sieve_trace_addresses = no
|
229
|
+
}
|