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
milosdjakonovic / postfix.md
Last active Mar 18, 2019
Strip some sensitive info from Postfix-sent emails
View postfix.md

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 Spamassasin.md

#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
milosdjakonovic / readme.md
Created Mar 19, 2017
Clamsmtp reject zipped dangerous files (exe, com...) in attachments
View readme.md
@milosdjakonovic
milosdjakonovic / index.js
Created Nov 21, 2016
Requirejs with localstorage caching
View index.js
(function(w,d){
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')){
sc.src="assets/js/require.min.js"
} else {
sc.innerHTML=localStorage.getItem('requirejs');
}
@milosdjakonovic
milosdjakonovic / loadCss.js
Last active Nov 8, 2016
Dynamic css loader
View loadCss.js
;(function(w,d){
var head = d.head || d.getElementsByTagName('head')[0],
raf = w.requestAnimationFrame ||
w.mozRequestAnimationFrame ||
w.webkitRequestAnimationFrame ||
w.msRequestAnimationFrame ||
function(callback) {
return setTimeout(callback, 16)
@milosdjakonovic
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
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
* http://dustindiaz.com/smallest-domready-ever
*
* It is executing argument function inside
* anonimous function specified in setTimeout
*
* That way, we can use Smallest DomReady Ever in
@milosdjakonovic
milosdjakonovic / pattern.js
Created Jul 28, 2016
Regex to match media queries and get values
View pattern.js
/@\s*?media\s*?\(\s*?(min|max)-(width|height)\s*?:\s*?(\d+)(px|em)\s*?\)\s*?{(.*)}/gms
/**
* 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
* https://regex101.com/r/zA6fX2/1
@milosdjakonovic
milosdjakonovic / datasrc.js
Created Jul 15, 2016
Auto lazy load of data-src images
View datasrc.js
;(function(w,d){
var fn=function(){
var body = d.body || d.getElementsByTagName('body')[0];
if(d.querySelectorAll)
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
milosdjakonovic / README.md
Created Jul 15, 2016 — forked from Spea/README.md
Script to auto reply emails.
View README.md

General

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

Installation

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.