mostly mail changes, wip
authorIan Kelling <ian@iankelling.org>
Sun, 19 Feb 2017 00:37:11 +0000 (16:37 -0800)
committerIan Kelling <ian@iankelling.org>
Sun, 19 Feb 2017 00:37:11 +0000 (16:37 -0800)
13 files changed:
.dovecot.sieve [new file with mode: 0644]
filesystem/etc/dovecot/conf.d/10-mail.conf [new file with mode: 0644]
filesystem/etc/dovecot/conf.d/20-lmtp.conf [new file with mode: 0644]
filesystem/etc/dovecot/local.conf [new file with mode: 0644]
filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail [deleted file]
filesystem/etc/exim4/conf.d/acl/40_exim4-config_check_data [new file with mode: 0644]
filesystem/etc/exim4/conf.d/main/000_localmacros [deleted file]
filesystem/etc/exim4/conf.d/router/950_exim4-config_local_catchall [new file with mode: 0644]
filesystem/etc/exim4/conf.d/transport/30_exim4-config_dovecot_lmtp [new file with mode: 0644]
filesystem/etc/exim4/rcpt_local_acl [new file with mode: 0644]
machine_specific/treetowl/filesystem/etc/cron.d/treetowl
machine_specific/treetowl/filesystem/etc/systemd/system/btrbk.service
subdir_files/.config/mpv/mpv.conf

diff --git a/.dovecot.sieve b/.dovecot.sieve
new file mode 100644 (file)
index 0000000..fb852bc
--- /dev/null
@@ -0,0 +1,95 @@
+# Sieve filter
+##
+require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags" ];
+
+# Mailinglist Killfile
+if anyof (header :contains "from" "unwanted at example.com",
+          header :contains "from" "spammer at example.net",
+          header :contains "from" "troll at example.org"){
+       discard;
+       stop;
+}
+
+if anyof (header :contains "x-spam-flag" "yes",
+          allof (header :regex "X-DSPAM-Result" "^(Spam|Virus|Bl[ao]cklisted)$",
+                 not header :contains "X-DSPAM-Reclassified" "Innocent")){
+       # Spam goes into the spam folder
+       setflag "\\Seen";
+       fileinto :create "spam";
+       stop;
+}
+
+# split out the various list forms
+# Mailman & other lists using list-id
+if exists "list-id" {
+    if header :regex "list-id" "<([a-z_0-9-]+)[.@]" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } elsif header :regex "list-id" "^\\s*<?([a-z_0-9-]+)[.@]" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;}
+# Listar and mailman like
+elsif exists "x-list-id" {
+    if header :regex "x-list-id" "<([a-z_0-9-]+)\\\\." {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;}
+# Ezmlm
+elsif exists "mailing-list" {
+    if header :regex "mailing-list" "([a-z_0-9-]+)@" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;}
+# York lists service
+elsif exists "x-mailing-list" {
+    if header :regex "x-mailing-list" "^\\s*([a-z_0-9-]+)@?" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;}
+# Smartlist
+elsif exists "x-loop" {
+       if header :regex "x-loop" "^\\s*(a-z_0-9-]+)@?" {
+               set :lower "listname" "${1}";
+               fileinto :create "${listname}";
+       } else {
+           keep;
+       }
+    stop;}
+# poorly identified
+elsif envelope :contains "from" "owner-" {
+    if envelope :regex "from" "owner-([a-z_0-9-]+)-outgoing@" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } elsif envelope :regex "from" "owner-([a-z_0-9-]+)@" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } elsif header :regex "Sender" "owner-([a-z_0-9-]+)@" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;}
+# other poorly identified
+elsif  envelope :contains "from" "-request" {
+    if envelope :regex "from" "([a-z_0-9-]+)-request@" {
+        set :lower "listname" "${1}";
+        fileinto :create "${listname}";
+    } else {
+        keep;
+    }
+    stop;
+}
diff --git a/filesystem/etc/dovecot/conf.d/10-mail.conf b/filesystem/etc/dovecot/conf.d/10-mail.conf
new file mode 100644 (file)
index 0000000..95d0673
--- /dev/null
@@ -0,0 +1,392 @@
+##
+## Mailbox locations and namespaces
+##
+
+# Location for users' mailboxes. The default is empty, which means that Dovecot
+# tries to find the mailboxes automatically. This won't work if the user
+# doesn't yet have any mail, so you should explicitly tell Dovecot the full
+# location.
+#
+# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
+# isn't enough. You'll also need to tell Dovecot where the other mailboxes are
+# kept. This is called the "root mail directory", and it must be the first
+# path given in the mail_location setting.
+#
+# There are a few special variables you can use, eg.:
+#
+#   %u - username
+#   %n - user part in user@domain, same as %u if there's no domain
+#   %d - domain part in user@domain, empty if there's no domain
+#   %h - home directory
+#
+# See doc/wiki/Variables.txt for full list. Some examples:
+#
+#   mail_location = maildir:~/Maildir
+#   mail_location = mbox:~/mail:INBOX=/var/mail/%u
+#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
+#
+# <doc/wiki/MailLocation.txt>
+#
+# ian: commented out default below
+# layout=fs makes it be maildir instead of maildir++.
+# gnus seems to have no option for maildir++, and does not
+# see folders, which are .folder in maildir++.
+# Without INBOX setting, the cur/tmp/new folders would go
+# in /m/md and not be seen by gnus.
+mail_location = maildir:/m/md:LAYOUT=fs:INBOX=/m/md/INBOX
+#mail_location = mbox:~/mail:INBOX=/var/mail/%u
+
+# If you need to set multiple mailbox locations or want to change default
+# namespace settings, you can do it by defining namespace sections.
+#
+# You can have private, shared and public namespaces. Private namespaces
+# are for user's personal mails. Shared namespaces are for accessing other
+# users' mailboxes that have been shared. Public namespaces are for shared
+# mailboxes that are managed by sysadmin. If you create any shared or public
+# namespaces you'll typically want to enable ACL plugin also, otherwise all
+# users can access all the shared mailboxes, assuming they have permissions
+# on filesystem level to do so.
+namespace inbox {
+  # Namespace type: private, shared or public
+  #type = private
+
+  # Hierarchy separator to use. You should use the same separator for all
+  # namespaces or some clients get confused. '/' is usually a good one.
+  # The default however depends on the underlying mail storage format.
+  #separator =
+
+  # Prefix required to access this namespace. This needs to be different for
+  # all namespaces. For example "Public/".
+  #prefix =
+
+  # Physical location of the mailbox. This is in same format as
+  # mail_location, which is also the default for it.
+  #location =
+
+  # There can be only one INBOX, and this setting defines which namespace
+  # has it.
+  inbox = yes
+
+  # If namespace is hidden, it's not advertised to clients via NAMESPACE
+  # extension. You'll most likely also want to set list=no. This is mostly
+  # useful when converting from another server with different namespaces which
+  # you want to deprecate but still keep working. For example you can create
+  # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
+  #hidden = no
+
+  # Show the mailboxes under this namespace with LIST command. This makes the
+  # namespace visible for clients that don't support NAMESPACE extension.
+  # "children" value lists child mailboxes, but hides the namespace prefix.
+  #list = yes
+
+  # Namespace handles its own subscriptions. If set to "no", the parent
+  # namespace handles them (empty prefix should always have this as "yes")
+  #subscriptions = yes
+
+  # See 15-mailboxes.conf for definitions of special mailboxes.
+}
+
+# Example shared namespace configuration
+#namespace {
+  #type = shared
+  #separator = /
+
+  # Mailboxes are visible under "shared/user@domain/"
+  # %%n, %%d and %%u are expanded to the destination user.
+  #prefix = shared/%%u/
+
+  # Mail location for other users' mailboxes. Note that %variables and ~/
+  # expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the
+  # destination user's data.
+  #location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
+
+  # Use the default namespace for saving subscriptions.
+  #subscriptions = no
+
+  # List the shared/ namespace only if there are visible shared mailboxes.
+  #list = children
+#}
+# Should shared INBOX be visible as "shared/user" or "shared/user/INBOX"?
+#mail_shared_explicit_inbox = no
+
+# 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 =
+
+# 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 =
+
+# 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 =
+
+# 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
+
+# Dictionary for key=value mailbox attributes. This is used for example by
+# URLAUTH and METADATA extensions.
+#mail_attribute_dict =
+
+# A comment or note that is associated with the server. This value is
+# accessible for authenticated users through the IMAP METADATA server
+# entry "/shared/comment".
+#mail_server_comment = ""
+
+# Indicates a method for contacting the server administrator. According to
+# RFC 5464, this value MUST be a URI (e.g., a mailto: or tel: URL), but that
+# is currently not enforced. Use for example mailto:admin@example.com. This
+# value is accessible for authenticated users through the IMAP METADATA server
+# entry "/shared/admin".
+#mail_server_admin =
+
+##
+## Mail processes
+##
+
+# Don't use mmap() at all. This is required if you store indexes to shared
+# filesystems (NFS or clustered filesystem).
+#mmap_disable = no
+
+# 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
+
+# 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
+
+# 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
+
+# Directory in which LDA/LMTP temporarily stores incoming mails >128 kB.
+#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
+
+# 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
+
+# Maximum allowed length for mail keyword name. It's only forced when trying
+# to create new keywords.
+#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).
+# This setting doesn't affect login_chroot, mail_chroot or auth chroot
+# settings. If this setting is empty, "/./" in home dirs are ignored.
+# 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 =
+
+# Default chroot directory for mail processes. This can be overridden for
+# specific users in user database by giving /./ in user's home directory
+# (eg. /home/./user chroots into /home). Note that usually there is no real
+# 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 =
+
+# 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
+
+# Directory where to look up mail plugins.
+#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 =
+
+##
+## Mailbox handling optimizations
+##
+
+# Mailbox list indexes can be used to optimize IMAP STATUS commands. They are
+# also required for IMAP NOTIFY extension to be enabled.
+#mailbox_list_index = no
+
+# 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
+
+# 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 inotify and
+# kqueue to find out immediately when changes occur.
+#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
+
+# Max number of mails to keep open and prefetch to memory. This only works with
+# some mailbox formats and/or operating systems.
+#mail_prefetch_count = 0
+
+# How often to scan for stale temporary files and delete them (0 = never).
+# These should exist only after Dovecot dies in the middle of saving mails.
+#mail_temp_scan_interval = 1w
+
+##
+## Maildir-specific settings
+##
+
+# By default LIST command returns all entries in maildir beginning with a dot.
+# Enabling this option makes Dovecot return only entries which are directories.
+# 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
+
+# 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
+
+# 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
+
+# If enabled, Dovecot doesn't use the S=<size> in the Maildir filenames for
+# getting the mail's physical size, except when recalculating Maildir++ quota.
+# This can be useful in systems where a lot of the Maildir filenames have a
+# broken size. The performance hit for enabling this is very small.
+#maildir_broken_filename_sizes = no
+
+# Always move mails from new/ directory to cur/, even when the \Recent flags
+# aren't being reset.
+#maildir_empty_new = no
+
+##
+## mbox-specific settings
+##
+
+# Which locking methods to use for locking mbox. There are four available:
+#  dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
+#           solution. If you want to use /var/mail/ like directory, the users
+#           will need write access to that directory.
+#  dotlock_try: Same as dotlock, but if it fails because of permissions or
+#               because there isn't enough disk space, just skip it.
+#  fcntl  : Use this if possible. Works with NFS too if lockd is used.
+#  flock  : May not exist in all systems. Doesn't work with NFS.
+#  lockf  : May not exist in all systems. Doesn't work with NFS.
+#
+# You can use multiple locking methods; if you do the order they're declared
+# 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.
+#
+# The Debian value for mbox_write_locks differs from upstream Dovecot. It is
+# changed to be compliant with Debian Policy (section 11.6) for NFS safety.
+#       Dovecot: mbox_write_locks = dotlock fcntl
+#       Debian:  mbox_write_locks = fcntl dotlock
+#
+#mbox_read_locks = fcntl
+#mbox_write_locks = fcntl dotlock
+
+# Maximum time to wait for lock (all of them) before aborting.
+#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
+
+# 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
+# is usually just a newly appended mail, it'd be faster to simply read the
+# new mails. If this setting is enabled, Dovecot does this but still safely
+# fallbacks to re-reading the whole mbox file whenever something in mbox isn't
+# how it's expected to be. The only real downside to this setting is that if
+# 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
+
+# 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
+
+# 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
+
+# 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
+
+# Mail header selection algorithm to use for MD5 POP3 UIDLs when
+# pop3_uidl_format=%m. For backwards compatibility we use apop3d inspired
+# algorithm, but it fails if the first Received: header isn't unique in all
+# mails. An alternative algorithm is "all" that selects all headers.
+#mbox_md5 = apop3d
+
+##
+## mdbox-specific settings
+##
+
+# Maximum dbox file size until it's rotated.
+#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
+
+# 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
+
+##
+## Mail attachments
+##
+
+# sdbox and mdbox support saving mail attachments to external files, which
+# also allows single instance storage for them. Other backends don't support
+# this for now.
+
+# Directory root where to store mail attachments. Disabled, if empty.
+#mail_attachment_dir =
+
+# 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
+
+# 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
+
+# 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}
diff --git a/filesystem/etc/dovecot/conf.d/20-lmtp.conf b/filesystem/etc/dovecot/conf.d/20-lmtp.conf
new file mode 100644 (file)
index 0000000..0955b17
--- /dev/null
@@ -0,0 +1,36 @@
+##
+## LMTP specific settings
+##
+
+# Support proxying to other LMTP/SMTP servers by performing passdb lookups.
+#lmtp_proxy = no
+
+# When recipient address includes the detail (e.g. user+detail), try to save
+# the mail to the detail mailbox. See also recipient_delimiter and
+# lda_mailbox_autocreate settings.
+#lmtp_save_to_detail_mailbox = no
+
+# Verify quota before replying to RCPT TO. This adds a small overhead.
+#lmtp_rcpt_check_quota = no
+
+# Which recipient address to use for Delivered-To: header and Received:
+# header. The default is "final", which is the same as the one given to
+# RCPT TO command. "original" uses the address given in RCPT TO's ORCPT
+# parameter, "none" uses nothing. Note that "none" is currently always used
+# when a mail has multiple recipients.
+#lmtp_hdr_delivery_address = final
+
+protocol lmtp {
+  # Space separated list of plugins to load (default is global mail_plugins).
+  #mail_plugins = $mail_plugins
+
+#ian: added this, per https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration
+  mail_plugins = $mail_plugins sieve
+
+
+# ian: added this, based on errors and some googling.
+# Exim says something like "LMTP error after RCPT ... 550 ... User doesn't exist someuser@somedomain"
+# Dovecot verbose log says something like "auth-worker(9048): passwd(someuser@somedomain): unknown user"
+# reference: http://wiki.dovecot.org/LMTP/Exim
+  auth_username_format = %Ln
+}
diff --git a/filesystem/etc/dovecot/local.conf b/filesystem/etc/dovecot/local.conf
new file mode 100644 (file)
index 0000000..95536f2
--- /dev/null
@@ -0,0 +1,20 @@
+# so I can use a different login that my shell login for mail.  this is
+# worth doing solely for the reason that if this login is compromised,
+# it won't also compromise my shell password.
+!include conf.d/auth-passwdfile.conf.ext
+
+# settings derived from wiki and 10-ssl.conf
+ssl = required
+ssl_cert = </etc/exim4/exim.crt
+ssl_key = </etc/exim4/exim.key
+# https://github.com/certbot/certbot/raw/master/certbot-apache/certbot_apache/options-ssl-apache.conf
+# in my cert cronjob, I check if that has changed upstream.
+ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
+
+# ian: added this, more secure, per google etc
+ssl_prefer_server_ciphers = yes
+
+# for debugging info, uncomment these.
+# logs go to syslog, and to /var/log/mail.log
+# auth_verbose=yes
+mail_debug=yes
diff --git a/filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail b/filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail
deleted file mode 100644 (file)
index c51da90..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-### acl/30_exim4-config_check_mail
-#################################
-
-# This access control list is used for every MAIL command in an incoming
-# SMTP message. The tests are run in order until the address is either
-# accepted or denied.
-#
-
-acl_check_mail:
-
-# ian: I added this require statement only. accept at the end is
-# needed as the default is deny.
-  require
-    message = ian auth
-    authenticated = *
-  accept
diff --git a/filesystem/etc/exim4/conf.d/acl/40_exim4-config_check_data b/filesystem/etc/exim4/conf.d/acl/40_exim4-config_check_data
new file mode 100644 (file)
index 0000000..40b31cb
--- /dev/null
@@ -0,0 +1,94 @@
+
+### acl/40_exim4-config_check_data
+#################################
+
+# This ACL is used after the contents of a message have been received. This
+# is the ACL in which you can test a message's headers or body, and in
+# particular, this is where you can invoke external virus or spam scanners.
+
+acl_check_data:
+
+  # Deny if the message contains an overlong line.  Per the standards
+  # we should never receive one such via SMTP.
+  #
+  .ifndef IGNORE_SMTP_LINE_LENGTH_LIMIT
+  deny    message    = maximum allowed line length is 998 octets, \
+                       got $max_received_linelength
+          condition  = ${if > {$max_received_linelength}{998}}
+  .endif
+
+  # Deny unless the address list headers are syntactically correct.
+  #
+  # If you enable this, you might reject legitimate mail.
+  .ifdef CHECK_DATA_VERIFY_HEADER_SYNTAX
+  deny
+    message = Message headers fail syntax check
+    !acl = acl_local_deny_exceptions
+    !verify = header_syntax
+  .endif
+
+
+  # require that there is a verifiable sender address in at least
+  # one of the "Sender:", "Reply-To:", or "From:" header lines.
+  .ifdef CHECK_DATA_VERIFY_HEADER_SENDER
+  deny
+    message = No verifiable sender address in message headers
+    !acl = acl_local_deny_exceptions
+    !verify = header_sender
+  .endif
+
+
+  # Deny if the message contains malware. Before enabling this check, you
+  # must install a virus scanner and set the av_scanner option in the
+  # main configuration.
+  #
+  # exim4-daemon-heavy must be used for this section to work.
+  #
+  # deny
+  #   malware = *
+  #   message = This message was detected as possible malware ($malware_name).
+
+
+  # Add headers to a message if it is judged to be spam. Before enabling this,
+  # you must install SpamAssassin. You also need to set the spamd_address
+  # option in the main configuration.
+  #
+  # exim4-daemon-heavy must be used for this section to work.
+  #
+  # Please note that this is only suiteable as an example. There are
+  # multiple issues with this configuration method. For example, if you go
+  # this way, you'll give your spamassassin daemon write access to the
+  # entire exim spool which might be a security issue in case of a
+  # spamassassin exploit.
+  #
+  # See the exim docs and the exim wiki for more suitable examples.
+  #
+
+# ian: uncommented this. The above comment about this not
+# being suitable is mostly bs. The only thing I found was to
+# add the condition, cuz spamassassin has problems with big
+# messages and spammers don't bother with big messages,
+# but I've increased the size from 10k
+# suggested in official docs, and 100k in the wiki example because
+# those docs are rather old and I see a 110k spam message
+# pretty quickly looking through my spam folder.
+  warn
+    condition = ${if < {$message_size}{1000K}}
+    spam = Debian-exim:true
+    add_header = X-Spam_score: $spam_score\n\
+              X-Spam_score_int: $spam_score_int\n\
+              X-Spam_bar: $spam_bar\n\
+              X-Spam_report: $spam_report
+
+
+  # This hook allows you to hook in your own ACLs without having to
+  # modify this file. If you do it like we suggest, you'll end up with
+  # a small performance penalty since there is an additional file being
+  # accessed. This doesn't happen if you leave the macro unset.
+  .ifdef CHECK_DATA_LOCAL_ACL_FILE
+  .include CHECK_DATA_LOCAL_ACL_FILE
+  .endif
+
+
+  # accept otherwise
+  accept
diff --git a/filesystem/etc/exim4/conf.d/main/000_localmacros b/filesystem/etc/exim4/conf.d/main/000_localmacros
deleted file mode 100644 (file)
index 97945cb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-MAIN_TLS_ENABLE = true
diff --git a/filesystem/etc/exim4/conf.d/router/950_exim4-config_local_catchall b/filesystem/etc/exim4/conf.d/router/950_exim4-config_local_catchall
new file mode 100644 (file)
index 0000000..eb5121c
--- /dev/null
@@ -0,0 +1,12 @@
+# redirect anything that hasn't been caught yet to me,
+# based on
+# http://blog.alteholz.eu/2015/04/exim4-and-catchall-email-address/
+# that reference includes the lines allow_fail and allow_defer, but
+# afaik, they are completely superfluous and just copied from another
+# router, they apply when the expansion of data contains :defer: or :fail:,
+# but we are just using a string literal.
+local_catchall:
+  debug_print = "R: catchall for $local_part@$domain"
+  driver = redirect
+  domains = +local_domains
+  data = ian
diff --git a/filesystem/etc/exim4/conf.d/transport/30_exim4-config_dovecot_lmtp b/filesystem/etc/exim4/conf.d/transport/30_exim4-config_dovecot_lmtp
new file mode 100644 (file)
index 0000000..5c3138f
--- /dev/null
@@ -0,0 +1,6 @@
+# not currently used, but
+dovecot_lmtp:
+        driver = lmtp
+        socket = /var/run/dovecot/lmtp
+        #maximum number of deliveries per batch, default 1
+        batch_max = 200
diff --git a/filesystem/etc/exim4/rcpt_local_acl b/filesystem/etc/exim4/rcpt_local_acl
new file mode 100644 (file)
index 0000000..d547204
--- /dev/null
@@ -0,0 +1,6 @@
+# note, if we wanted authed senders for all domains,
+# we could make this condition in acl_check_mail
+deny
+  message = ian trusted domain recepient but no auth
+  !authenticated = *
+  domains = mail.iankelling.org
index e44ec1ccf612da190542d5d3433ae37684bab93a..b52070de8eeeb84f0167e93fe8e83c8fd2ba6660 100755 (executable)
@@ -6,8 +6,8 @@
 # stored for 3 days, 2 months, and unlimited respectively
 SHELL=/bin/bash
 0    4 * * * ian x=$(/a/exe/logq /a/bin/small-backup --retry daily 2M); [[ $? != 0 ]] && echo "$x"
-0    3 * * sun ian echo weekly backup results:; /a/bin/small-backup --retry weekly -batch -prefer ~/.mpv -silent 2>&1 | /a/exe/log-once unison-mpv
-*/5  * * * *   ian /a/bin/distro-setup/dynamic-ip-update.sh | /a/exe/log-once -15
-*/10 * * * *   ian /a/bin/small-backup 10minutes 3D 2>&1 | /a/exe/log-once small-backup-10min
+0    3 * * sun ian echo weekly backup results:; /a/bin/small-backup --retry weekly -batch -prefer ~/.mpv -silent 2>&1 | /usr/local/bin/log-once unison-mpv
+*/5  * * * *   ian /a/bin/distro-setup/dynamic-ip-update.sh 2>&1 | /usr/local/bin/log-once -15
+*/10 * * * *   ian /a/bin/small-backup 10minutes 3D 2>&1 | /usr/local/bin/log-once small-backup-10min
 # put things we don't want to send mail about below this:
 # MAILTO=""
index 0d288c4e03ee080f235338895f95792eec7f9328..4be721d626f96144c117689e1fad29db5b2899d2 100644 (file)
@@ -4,4 +4,4 @@ After=multi-user.target
 
 [Service]
 Type=oneshot
-ExecStart=/a/bin/log-quiet/sysd-mail-once /a/exe/btrbk-run
+ExecStart=/a/bin/log-quiet/sysd-mail-once btrbk /a/exe/btrbk-run
index 5e2d10787865733b989435f0aefc9e80ecb26592..8964c9193361a9e442d28044c3d2833cccd1a9c5 100644 (file)
@@ -1,4 +1,4 @@
 #loop=inf
 loop-file=inf
 shuffle
-volume=80
\ No newline at end of file
+volume=50
\ No newline at end of file