Skip to content

Instantly share code, notes, and snippets.

Miloš Đakonović milosdjakonovic

Block or report user

Report or block milosdjakonovic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
milosdjakonovic /
Last active Mar 18, 2019
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
View Installing and configuring Postfix Dovecot

#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 Mar 19, 2017
Clamsmtp reject zipped dangerous files (exe, com...) in attachments
milosdjakonovic / index.js
Created Nov 21, 2016
Requirejs with localstorage caching
View index.js
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 Nov 8, 2016
Dynamic css loader
View loadCss.js
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 Sep 28, 2016
Register resize function - an easy way to register function for debounced execution with parameters
View registerResizeFunction.js
* Usage example:
* $('#headerghost').css('height', $('header').outerHeight()-32);
* registerResizeFunction(function($header, $headerghost){
* $headerghost.css('height', $header.outerHeight()-32);
* }, $('header'), $('#headerghost'));
milosdjakonovic / SmallestDOMReadyEnhanced.js
Created Sep 3, 2016
Smallest DOM Ready ever enhanced
View SmallestDOMReadyEnhanced.js
* 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 Jul 28, 2016
Regex to match media queries and get values
View pattern.js
* 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 Jul 15, 2016
Auto lazy load of data-src images
View datasrc.js
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 Jul 15, 2016 — 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.

You can’t perform that action at this time.