Browse Source

10-mail.conf.erb template using variables

Xabier de Zuazo 11 years ago
parent
commit
069ddde3ee
1 changed files with 43 additions and 43 deletions
  1. 43 43
      templates/default/conf.d/10-mail.conf.erb

+ 43 - 43
templates/default/conf.d/10-mail.conf.erb

@@ -27,7 +27,7 @@
 #
 # <doc/wiki/MailLocation.txt>
 #
-#mail_location = 
+<%= Dovecot::Conf.attribute(@conf, 'mail_location') %>
 
 # If you need to set multiple mailbox locations or want to change default
 # namespace settings, you can do it by defining namespace sections.
@@ -106,26 +106,26 @@
 # System user and group used to access mails. If you use multiple, userdb
 # can override these by returning uid or gid fields. You can use either numbers
 # or names. <doc/wiki/UserIds.txt>
-#mail_uid =
-#mail_gid =
+<%= Dovecot::Conf.attribute(@conf, 'mail_uid') %>
+<%= Dovecot::Conf.attribute(@conf, 'mail_gid') %>
 
 # Group to enable temporarily for privileged operations. Currently this is
 # used only with INBOX when either its initial creation or dotlocking fails.
 # Typically this is set to "mail" to give access to /var/mail.
-#mail_privileged_group =
+<%= Dovecot::Conf.attribute(@conf, 'mail_privileged_group') %>
 
 # Grant access to these supplementary groups for mail processes. Typically
 # these are used to set up access to shared mailboxes. Note that it may be
 # dangerous to set these if users can create symlinks (e.g. if "mail" group is
 # set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
 # mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
-#mail_access_groups =
+<%= Dovecot::Conf.attribute(@conf, 'mail_access_groups') %>
 
 # Allow full filesystem access to clients. There's no access checks other than
 # what the operating system does for the active UID/GID. It works with both
 # maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
 # or ~user/.
-#mail_full_filesystem_access = no
+<%= Dovecot::Conf.attribute(@conf, 'mail_full_filesystem_access', false) %>
 
 ##
 ## Mail processes
@@ -133,50 +133,50 @@
 
 # Don't use mmap() at all. This is required if you store indexes to shared
 # filesystems (NFS or clustered filesystem).
-#mmap_disable = no
+<%= Dovecot::Conf.attribute(@conf, 'mmap_disable', false) %>
 
 # Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
 # since version 3, so this should be safe to use nowadays by default.
-#dotlock_use_excl = yes
+<%= Dovecot::Conf.attribute(@conf, 'dotlock_use_excl', true) %>
 
 # When to use fsync() or fdatasync() calls:
 #   optimized (default): Whenever necessary to avoid losing important data
 #   always: Useful with e.g. NFS when write()s are delayed
 #   never: Never use it (best performance, but crashes can lose data)
-#mail_fsync = optimized
+<%= Dovecot::Conf.attribute(@conf, 'mail_fsync', 'optimized') %>
 
 # Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches
 # whenever needed. If you're using only a single mail server this isn't needed.
-#mail_nfs_storage = no
+<%= Dovecot::Conf.attribute(@conf, 'mail_nfs_storage', false) %>
 # Mail index files also exist in NFS. Setting this to yes requires
 # mmap_disable=yes and fsync_disable=no.
-#mail_nfs_index = no
+<%= Dovecot::Conf.attribute(@conf, 'mail_nfs_index', false) %>
 
 # Locking method for index files. Alternatives are fcntl, flock and dotlock.
 # Dotlocking uses some tricks which may create more disk I/O than other locking
 # methods. NFS users: flock doesn't work, remember to change mmap_disable.
-#lock_method = fcntl
+<%= Dovecot::Conf.attribute(@conf, 'lock_method', 'fcntl') %>
 
 # Directory in which LDA/LMTP temporarily stores incoming mails >128 kB.
-#mail_temp_dir = /tmp
+<%= Dovecot::Conf.attribute(@conf, 'mail_temp_dir', '/tmp') %>
 
 # Valid UID range for users, defaults to 500 and above. This is mostly
 # to make sure that users can't log in as daemons or other system users.
 # Note that denying root logins is hardcoded to dovecot binary and can't
 # be done even if first_valid_uid is set to 0.
-#first_valid_uid = 500
-#last_valid_uid = 0
+<%= Dovecot::Conf.attribute(@conf, 'first_valid_uid', '500') %>
+<%= Dovecot::Conf.attribute(@conf, 'last_valid_uid', '0') %>
 
 # Valid GID range for users, defaults to non-root/wheel. Users having
 # non-valid GID as primary group ID aren't allowed to log in. If user
 # belongs to supplementary groups with non-valid GIDs, those groups are
 # not set.
-#first_valid_gid = 1
-#last_valid_gid = 0
+<%= Dovecot::Conf.attribute(@conf, 'first_valid_gid', '1') %>
+<%= Dovecot::Conf.attribute(@conf, 'last_valid_gid', '0') %>
 
 # Maximum allowed length for mail keyword name. It's only forced when trying
 # to create new keywords.
-#mail_max_keyword_length = 50
+<%= Dovecot::Conf.attribute(@conf, 'mail_max_keyword_length', '50') %>
 
 # ':' separated list of directories under which chrooting is allowed for mail
 # processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
@@ -185,7 +185,7 @@
 # WARNING: Never add directories here which local users can modify, that
 # may lead to root exploit. Usually this should be done only if you don't
 # allow shell access for users. <doc/wiki/Chrooting.txt>
-#valid_chroot_dirs = 
+<%= Dovecot::Conf.attribute(@conf, 'valid_chroot_dirs') %>
 
 # Default chroot directory for mail processes. This can be overridden for
 # specific users in user database by giving /./ in user's home directory
@@ -193,18 +193,18 @@
 # need to do chrooting, Dovecot doesn't allow users to access files outside
 # their mail directory anyway. If your home directories are prefixed with
 # the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
-#mail_chroot = 
+<%= Dovecot::Conf.attribute(@conf, 'mail_chroot') %>
 
 # UNIX socket path to master authentication server to find users.
 # This is used by imap (for shared users) and lda.
-#auth_socket_path = /var/run/dovecot/auth-userdb
+<%= Dovecot::Conf.attribute(@conf, 'auth_socket_path', '/var/run/dovecot/auth-userdb') %>
 
 # Directory where to look up mail plugins.
-#mail_plugin_dir = /usr/lib/dovecot/modules
+<%= Dovecot::Conf.attribute(@conf, 'mail_plugin_dir', '/usr/lib/dovecot/modules') %>
 
 # Space separated list of plugins to load for all services. Plugins specific to
 # IMAP, LDA, etc. are added to this list in their own .conf files.
-#mail_plugins = 
+<%= Dovecot::Conf.attribute(@conf, 'mail_plugins') %>
 
 ##
 ## Mailbox handling optimizations
@@ -213,20 +213,20 @@
 # The minimum number of mails in a mailbox before updates are done to cache
 # file. This allows optimizing Dovecot's behavior to do less disk writes at
 # the cost of more disk reads.
-#mail_cache_min_mail_count = 0
+<%= Dovecot::Conf.attribute(@conf, 'mail_cache_min_mail_count', 0) %>
 
 # When IDLE command is running, mailbox is checked once in a while to see if
 # there are any new mails or other changes. This setting defines the minimum
 # time to wait between those checks. Dovecot can also use dnotify, inotify and
 # kqueue to find out immediately when changes occur.
-#mailbox_idle_check_interval = 30 secs
+<%= Dovecot::Conf.attribute(@conf, 'mailbox_idle_check_interval', '30 secs') %>
 
 # Save mails with CR+LF instead of plain LF. This makes sending those mails
 # take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
 # But it also creates a bit more disk I/O which may just make it slower.
 # Also note that if other software reads the mboxes/maildirs, they may handle
 # the extra CRs wrong and cause problems.
-#mail_save_crlf = no
+<%= Dovecot::Conf.attribute(@conf, 'mail_save_crlf', false) %>
 
 ##
 ## Maildir-specific settings
@@ -237,15 +237,15 @@
 # This is done by stat()ing each entry, so it causes more disk I/O.
 # (For systems setting struct dirent->d_type, this check is free and it's
 # done always regardless of this setting)
-#maildir_stat_dirs = no
+<%= Dovecot::Conf.attribute(@conf, 'maildir_stat_dirs', false) %>
 
 # When copying a message, do it with hard links whenever possible. This makes
 # the performance much better, and it's unlikely to have any side effects.
-#maildir_copy_with_hardlinks = yes
+<%= Dovecot::Conf.attribute(@conf, 'maildir_copy_with_hardlinks', true) %>
 
 # Assume Dovecot is the only MUA accessing Maildir: Scan cur/ directory only
 # when its mtime changes unexpectedly or when we can't find the mail otherwise.
-#maildir_very_dirty_syncs = no
+<%= Dovecot::Conf.attribute(@conf, 'maildir_very_dirty_syncs', false) %>
 
 ##
 ## mbox-specific settings
@@ -265,15 +265,15 @@
 # in is important to avoid deadlocks if other MTAs/MUAs are using multiple
 # locking methods as well. Some operating systems don't allow using some of
 # them simultaneously.
-#mbox_read_locks = fcntl
-#mbox_write_locks = dotlock fcntl
+<%= Dovecot::Conf.attribute(@conf, 'mbox_read_locks', 'fcntl') %>
+<%= Dovecot::Conf.attribute(@conf, 'mbox_write_locks', 'dotlock fcntl') %>
 
 # Maximum time to wait for lock (all of them) before aborting.
-#mbox_lock_timeout = 5 mins
+<%= Dovecot::Conf.attribute(@conf, 'mbox_lock_timeout', '5 mins') %>
 
 # If dotlock exists but the mailbox isn't modified in any way, override the
 # lock file after this much time.
-#mbox_dotlock_change_timeout = 2 mins
+<%= Dovecot::Conf.attribute(@conf, 'mbox_dotlock_change_timeout', '2 mins') %>
 
 # When mbox changes unexpectedly we have to fully read it to find out what
 # changed. If the mbox is large this can take a long time. Since the change
@@ -284,37 +284,37 @@
 # some other MUA changes message flags, Dovecot doesn't notice it immediately.
 # Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK 
 # commands.
-#mbox_dirty_syncs = yes
+<%= Dovecot::Conf.attribute(@conf, 'mbox_dirty_syncs', true) %>
 
 # Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
 # EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
-#mbox_very_dirty_syncs = no
+<%= Dovecot::Conf.attribute(@conf, 'mbox_very_dirty_syncs', false) %>
 
 # Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
 # commands and when closing the mailbox). This is especially useful for POP3
 # where clients often delete all mails. The downside is that our changes
 # aren't immediately visible to other MUAs.
-#mbox_lazy_writes = yes
+<%= Dovecot::Conf.attribute(@conf, 'mbox_lazy_writes', true) %>
 
 # If mbox size is smaller than this (e.g. 100k), don't write index files.
 # If an index file already exists it's still read, just not updated.
-#mbox_min_index_size = 0
+<%= Dovecot::Conf.attribute(@conf, 'mbox_min_index_size', '0') %>
 
 ##
 ## mdbox-specific settings
 ##
 
 # Maximum dbox file size until it's rotated.
-#mdbox_rotate_size = 2M
+<%= Dovecot::Conf.attribute(@conf, 'mdbox_rotate_size', '2M') %>
 
 # Maximum dbox file age until it's rotated. Typically in days. Day begins
 # from midnight, so 1d = today, 2d = yesterday, etc. 0 = check disabled.
-#mdbox_rotate_interval = 0
+<%= Dovecot::Conf.attribute(@conf, 'mdbox_rotate_interval', '0') %>
 
 # When creating new mdbox files, immediately preallocate their size to
 # mdbox_rotate_size. This setting currently works only in Linux with some
 # filesystems (ext4, xfs).
-#mdbox_preallocate_space = no
+<%= Dovecot::Conf.attribute(@conf, 'mdbox_preallocate_space', false) %>
 
 ##
 ## Mail attachments
@@ -331,15 +331,15 @@
 
 # Attachments smaller than this aren't saved externally. It's also possible to
 # write a plugin to disable saving specific attachments externally.
-#mail_attachment_min_size = 128k
+<%= Dovecot::Conf.attribute(@conf, 'mail_attachment_min_size', '128k') %>
 
 # Filesystem backend to use for saving attachments:
 #  posix : No SiS done by Dovecot (but this might help FS's own deduplication)
 #  sis posix : SiS with immediate byte-by-byte comparison during saving
 #  sis-queue posix : SiS with delayed comparison and deduplication
-#mail_attachment_fs = sis posix
+<%= Dovecot::Conf.attribute(@conf, 'mail_attachment_fs', 'sis posix') %>
 
 # Hash format to use in attachment filenames. You can add any text and
 # variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
 # Variables can be truncated, e.g. %{sha256:80} returns only first 80 bits
-#mail_attachment_hash = %{sha1}
+<%= Dovecot::Conf.attribute(@conf, 'mail_attachment_hash', '%{sha1}') %>