Skip to content

Instantly share code, notes, and snippets.

View markc's full-sized avatar

Mark Constable markc

View GitHub Profile
#!/usr/bin/env bash
# swbalance 20180623 - 20180623
# Copyright (C) 1995-2018 Mark Constable <markc@renta.net> (AGPL-3.0)
# apt install libxml2-utils
#SW_RESELLERID=YOUR_RESELLER_ID
#SW_APIKEY=YOUR_API_KEY
XMLREQF=$(mktemp)
@markc
markc / spamprobe_sieve
Last active June 19, 2018 13:05
How to use SpamProbe via sieve rules in Dovecot
This is a brief outline of how to take advantage of using only sieve scripts to manage spam via
`SpamProbe` and `Dovecot` IMAP services. First we assume there is a directory available for
global sieve scripts...
[[ ! -d /usr/lib/dovecot/sieve ]] && mkdir -p /usr/lib/dovecot/sieve
then we add these rules to a Dovecot config file. I'll assume `/etc/dovecot/dovecot.conf` for simplicity...
plugin {
imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/retrain-as-spam.sieve
@markc
markc / userChrome.css
Created March 1, 2015 05:47
Thunderbird userChrome.css for HiDPI screen
/* userChrome.css 20090601 (C) Mark Constable <markc@renta.net> (AGPL-3.0) */
/* Thunderbird support for wide view on a HiDPI screen (Kubuntu DPI 288) */
/* smaller folder tree fontsize */
#folderTree > treechildren {
font-size: 24px !important;
}
/* header at the top of the message content */
#msgHeaderView {
@markc
markc / Servers_with_multiple_IP_addresses.md
Created April 23, 2012 11:20
Courier MTA - Servers with multiple IP addresses

Servers with multiple IP addresses

The Courier mail server's default configuration listens on port 25 on all IP addresses. If the server has more than one IP address, Courier accepts connections on any IP address. Adjust the settings in the esmtpd configuration file to explicitly enumerate IP addresses that Courier listens on. This also applies to the ESMTP over SSL server on port 465 configured by esmtpd-ssl, and the MSA server on port 587, configured by

@markc
markc / gist:899249
Created April 2, 2011 05:19
serve_cgi
function serve_cgi(filename, res, get, post, method, vhost, port, pinfo, get, sname, uri, droot) {
var env = {
CONTENT_LENGTH: post.length,
CONTENT_TYPE: 'application/x-www-form-urlencoded',
DOCUMENT_ROOT: droot,
GATEWAY_INTERFACE: 'CGI/1.1',
HTTP_HOST: vhost,
QUERY_STRING: get,
REDIRECT_STATUS: '200',
REQUEST_METHOD: method,