Skip to content

Instantly share code, notes, and snippets.

View andrewnimmo's full-sized avatar

Andrew David Nimmo andrewnimmo

View GitHub Profile
@andrewnimmo
andrewnimmo / rspamd-lists.md
Created February 12, 2019 22:16 — forked from kvaps/rspamd-lists.md
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@andrewnimmo
andrewnimmo / rspamd-whitelisting.md
Created February 12, 2019 22:15 — forked from ThomasLeister/rspamd-whitelisting.md
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = "true";
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@andrewnimmo
andrewnimmo / dovecot-archive.sh
Created December 16, 2018 17:37 — forked from Disassembler0/dovecot-archive.sh
dovecot-archive.sh
#!/bin/bash
USER="box@example.com"
RETENTION=120
ARCHIVE_ROOT="Archiv"
BOXES_TO_ARCHIVE=("INBOX" "Odeslaná pošta")
# Load all existing subfolders in BOXES_TO_ARCHIVE
BOXES=()
acl_check_dkim:
# Skip this whole acl if header.d contains an @ sign because exim is
# breaking down the header.i part (which usually is an email address)
# bit by bit, working towards just the domain name.
accept condition = ${if match{$dkim_cur_signer}{\N@\N}}
accept dkim_status = none
sender_domains = KNOWN_DKIM_SIGNERS
dkim_signers = KNOWN_DKIM_SIGNERS
condition = ${if eqi{$sender_address_domain}{$dkim_cur_signer} {yes}{no}}
@andrewnimmo
andrewnimmo / openvpn-in-lxd.txt
Created April 10, 2018 07:19 — forked from wastrachan/openvpn-in-lxd.txt
OpenVPN in LXD Container
# On the host
=============
lxc config set openvpn raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'
lxc config device add openvpn tun unix-char path=/dev/net/tun
# In the container
==================
1. mknod /dev/net/tun c 10 200
#!/bin/bash
# "Register JDK7 for update-alternatives Script in Debian Way"
# Based on 1. codeslinger's "install_java7_alternatives" from https://gist.github.com/445930
# 2. sun-java6-plugin.deb postint script (for plugin)
# Modified by Cheng-Wei Chien<e.cwchien@gmail.com>, 2012-08-16
# ------------------------------------------------------------------------------
# Note: This script works on x86/amd64 Debian GNU/Linux|Ubuntu.
# If you use other arch or distro, you may have to modify some parameters.
#
# Usage: 1. Extract jdk7 tar.gz to, for example, /usr/lib/jvm/java-7-sun-1.7.0.13,