Skip to content

Instantly share code, notes, and snippets.

@alexh-name
alexh-name / netqmail-1.05-tls-smtpauth-20190114.patch
Last active March 19, 2022 22:25
a standalone patch that could replace netqmail-1.05-tls-smtpauth-20070417.patch
VERSION: 20190114
This patch for netqmail 1.05 is a composite of the latest versions of Frederik
Vermulen's TLS patch (20070408) and Erwin Hoffmann's SMTP-AUTH (0.5.8) update
to Eric M. Johnston's and Krzysztof Dabrowski's qmail-smtpd-auth-0.31 patch.
It was later ported to openssl 1.1 by Alex H. (git@alexh.name).
To install, get netqmail 1.05, put it in the same directory as this patch, and
then set it up:
@alexh-name
alexh-name / centos_rhel_install.sh​
Last active November 13, 2021 01:49 — forked from rcubetrac/centos_rhel_install.sh​
Roundcube Install Scripts
#!/bin/sh
clear
if [ -z "${mysql_roundcube_password}" ]; then
tmp=$(</dev/urandom tr -dc A-Za-z0-9 | head -c12)
read -p "MySQL roundcube user password [${tmp}]:" mysql_roundcube_password
mysql_roundcube_password=${mysql_roundcube_password:-${tmp}}
echo "MySQL roundcube: ${mysql_roundcube_password}" >> .passwords
fi
/*
* One-time fix for mismatch of devices after a failed mount with message like
*
* BTRFS error (device sde): super_num_devices 7 mismatch with num_devices 6 found here
*
* Compile:
* gcc -o fix-dev-count fix-dev-count.c
*
* Run:
* ./fix-dev-count /dev/sdx <number>
@alexh-name
alexh-name / netqmail-1.06-openssl-1.1.patch
Created January 14, 2019 20:32
a subsequent patch to be applied on top of netqmail-1.05-tls-smtpauth-20070417.patch
diff --git a/qmail-remote.c b/qmail-remote.c
index 4504e28..9787135 100644
--- a/qmail-remote.c
+++ b/qmail-remote.c
@@ -270,8 +270,8 @@ char *append;
{
#ifdef TLS
/* shouldn't talk to the client unless in an appropriate state */
- int state = ssl ? ssl->state : SSL_ST_BEFORE;
- if (state & SSL_ST_OK || (!smtps && state & SSL_ST_BEFORE))
04810207d25649149497387723a730296860eb2e17c24404ed4a9a6da4e8d1aa4f7dc19d5d551ad30964d305000a2cb6de7df1af156f774405e80533058f64b06c
@alexh-name
alexh-name / basic_tables.sh
Last active November 8, 2016 12:50
Allowing netqmail + dovecot + roundcube for mail server.
#!/bin/sh
set -eu
function rules() {
$IPT -F
$IPT -X
$IPT -Z
if [[ $IPT == "iptables" ]]; then
4d062ace2d3f463132af05d048b2a8738bf9ca9e
<?php
/* Local configuration for Roundcube Webmail */
// ----------------------------------
// SQL DATABASE
// ----------------------------------
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql or sqlsrv
This will increase the accepted size for DNS responses in qmail from
512 to 65536 bytes, following a suggestion from
http://www.lifewithqmail.org/lwq.html#patches to work around large
responses, which can be common nowadays.
Patch was done against netqmail-1.06.
Alex H., 2016
--- dns.c.orig 2016-06-13 09:42:50.502001080 +0200
+++ dns.c 2016-06-13 09:44:02.233003195 +0200
@@ -19,7 +19,7 @@
#!/bin/sh
# Copy from http://www.lifewithqmail.org/ by Dave Sill, 30 November 2007
# License: "Life with qmail is covered by the OpenContent License, version 1.0. See http://www.opencontent.org/opl.shtml for the full license. Basically, you can copy, redistribute, or modify Life with qmail provided that modified versions, if redistributed, are also covered by the OpenContent License."
# https://web.archive.org/web/19981206111937/http://www.opencontent.org/opl.shtml
# or https://gist.github.com/alexh-name/ee2a9003039a284766f9ddd43a26e91b
# I slightly changed it. Alex H., 2016.
QMAILDUID="$(id -u qmaild)"
NOFILESGID="$(id -g qmaild)"