Skip to content

Instantly share code, notes, and snippets.

View milosdjakonovic's full-sized avatar

Miloš Đakonović milosdjakonovic

  • Belgrade, Republic of Serbia
View GitHub Profile
milosdjakonovic /
Last active March 18, 2019 13:28
Strip some sensitive info from Postfix-sent emails

Received: from [192.168 Received: from localhost

nano /etc/postfix/header_checks

/^Received: from \[192\.168\..*$/   IGNORE
/^Received: from localhost .*$/     IGNORE
/^Received: from.*127\.0\.0\.1.*$/  IGNORE

#Installing configuring Postfix/Dovecot/Spamassassin/Roundcube

I've documented the steps in short to help me reproduce all the steps. Published it here for improvement and as a reference for others. Of course feel free to comment to improve this document.

This Gist is quite big and not all details are fully explained. But if you're going to run a mailserver you should be able to fill in the missing parts. The most important are covered. But be sure to read up to understand the meaning of all the stuff you configure. Since I used a lot of references of other sources (See at the end) I left out a lot of explanation in this document.

Don't forget that I'm not a Postfix/Dovecot/Spamassasin pro either. I just got it working the way I wanted to.

  • Used Ubuntu 12.04 LTS.
  • Set a root password.
milosdjakonovic /
Created March 19, 2017 13:46
Clamsmtp reject zipped dangerous files (exe, com...) in attachments
milosdjakonovic / index.js
Created November 21, 2016 14:07
Requirejs with localstorage caching
var DATA_MAIN='assets/js/login';
sc = d.createElement('script'), head = d.getElementsByTagName('head')[0];
sc.setAttribute('data-main', DATA_MAIN );
sc.setAttribute('async', 'true');
if( !'localStorage' in w || !w.localStorage.getItem('requirejs')){
} else {
milosdjakonovic / loadCss.js
Last active November 8, 2016 10:49
Dynamic css loader
var head = d.head || d.getElementsByTagName('head')[0],
raf = w.requestAnimationFrame ||
w.mozRequestAnimationFrame ||
w.webkitRequestAnimationFrame ||
w.msRequestAnimationFrame ||
function(callback) {
return setTimeout(callback, 16)
milosdjakonovic / registerResizeFunction.js
Created September 28, 2016 12:24
Register resize function - an easy way to register function for debounced execution with parameters
* Usage example:
* $('#headerghost').css('height', $('header').outerHeight()-32);
* registerResizeFunction(function($header, $headerghost){
* $headerghost.css('height', $header.outerHeight()-32);
* }, $('header'), $('#headerghost'));
milosdjakonovic / SmallestDOMReadyEnhanced.js
Created September 3, 2016 10:56
Smallest DOM Ready ever enhanced
* This is patch to famous Dustin Diaz's
* Smallest DomReady Ever
* It is executing argument function inside
* anonimous function specified in setTimeout
* That way, we can use Smallest DomReady Ever in
milosdjakonovic / pattern.js
Created July 28, 2016 18:50
Regex to match media queries and get values
* Only basically tested.
* Should match min-max-width-height number px|em and following rules.
* Provides capturing groups to determinate condition alongside with css.
* Created with help of regex101
milosdjakonovic / datasrc.js
Created July 15, 2016 12:52
Auto lazy load of data-src images
var fn=function(){
var body = d.body || d.getElementsByTagName('body')[0];
var allimgs = d.querySelectorAll('img[data-src]'), allimgs_len = allimgs.length;
for(var i=0;i<allimgs_len;i++){
allimgs[i].setAttribute('src', allimgs[i].getAttribute('data-src'));
milosdjakonovic /
Created July 15, 2016 12:50 — forked from Spea/
Script to auto reply emails.


This script can be used in conjunction with the ISPmail tutorial and the Roundcube autoreply plugin


Database setup

Create the following table in the database where you created the tables from the ISPmail tutorial.