Skip to content

Instantly share code, notes, and snippets.

View vanthome's full-sized avatar

Thomas Hoppe vanthome

  • n-fuse GmbH
  • Stuttgart
View GitHub Profile
@vanthome
vanthome / postfix-upgrade.txt
Created March 18, 2013 09:58
Consider smtpd_recipient_restrictions when upgrading to Postfix 3.10.0 MTA
If you run a postfix MTA and find yourself unable to send mails from external eMail Clients like thunderbird, kmail etc.
And you see something like this in the logs:
postfix/smtpd[42360]: Anonymous TLS connection established ...
postfix/smtpd[42360]: NOQUEUE: reject: RCPT from xxx: 554 5.7.1 <mail@host.com>: Relay access denied; from=<mail@hos.com> to=<mail@host.com> proto=ESMTP helo=<[xxx]>
Then you should consider the newly introduced smtpd_relay_restrictions option as described here:
http://postfix.1071664.n5.nabble.com/smtpd-relay-restrictions-ready-for-general-use-td51323.html
@vanthome
vanthome / isClientOnSSl.js
Last active December 14, 2015 09:59
For nodejs: Find out whether a client connection which might be proxied by front-end apache or nginx server OR is directly terminated by node is protected by SSL / TLS
var util = require('utile'),
propUtil = require('./propUtil');
// Find out whether the client connection is encrypted
var isClientOnTls = function(req) {
var isEncrypted = true;
if(req.connection.encrypted === undefined) { // Derive from nodejs internals
isEncrypted = false;
}