Category Archives: Open Source

Enhanced e-mail SPAM protection in ISPConfig 3

How to enchance e-mail SPAM protection in ISPConfig 3. In the end we will be able to

    Reject sender hostnames with invalid syntax
    Reject sender hostnames that are no fully qualified domains (e.g. reject “server1” but allow server1.domain.tld)
    Reject sender domains that have no DNS records
    Check sender IP addresses against realtime blacklists

Always ensure that you make a copy of your configuration file. In this case its at /etc/postfix/ on Debian.

sudo cp -pf /etc/postfix/ /etc/postfix/

Then execute this command as sudo

sudo postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_hostname, reject_non_fqdn_hostname, reject_unknown_recipient_domain, reject_non_fqdn_recipient, reject_unauth_destination, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_rbl_client,reject_rbl_client,reject_rbl_client, check_recipient_access mysql:/etc/postfix/, reject_unauth_destination'

Then restart postfix so that your changes will take effect immediately.

sudo /etc/init.d/postfix restart


Enable image caching in apache for better Google Page Speed results

High page speed and short page load times of your website are essential for good search engine rankings. To enable Image caching and http requests in apache, you need to enable the expires module on Ubunto or Debian. This module allows the apache web server to set HTTP headers. It sets the modification header for static assets like image and CSS files that do not change often.

a2enmod headers expires

Add the following directives inside the vhost file of the web site or at the end of the file /etc/apache2/apache2.conf to enable it globally.

Header set Cache-Control "max-age=3024000, public"

On ISPConfig 3 servers, this can be added in the “Apache Directives” field of the website instead. There is no apache reload required as ISPConfig takes care about that

Porteus Linux – Fast and versatile USB Linux

I was a searching for a Linux for installing into USB and also backing up files from windows. There is also several benefits of having a Linux USB.

  • Backup your files from Windows and GNU/Linux Operating System. That includes saving files across many file systems like Fat32, Ext3 and Ext4. You could also sync it with cloud services like Google drive, Dropbox etc.
  • Have your personalized Operating system load on any PC which could a public computer, friends’ laptop or a Browsing center (internet cafe).
  • Test drive a new Linux OS without having to mess with your operating system on the Desktop
  • Install Programming Language like Python and Ruby without the fear that you will mess with the system packages.
  • Browse anonymously and securely in a public unsafe networked environment.
  • Seamlessly encrypt and decrypt your data so that it does not get misused if lost or stolen.
  • Boot very fast and quickly complete the task because you are always in a hurry when you are working outside your home and office.
  • Able to boot from a dual partition pen drive (USB). This way if for some reason one is not able to boot from another PC, at least we should be able to use it as a windows recognizable drive.

Porteus surprised me by fulfilling many of expectations. I could install it within no time. the installation was radically different from many Ubuntu based distro and other modern GNU/Linux operating system. I could just mount the ISO file as a virtual CD and then copy the boot folder into the target thumb drive. Then its just a matter of running a bash script provided by Porteus.

If you have used Slitaz or Slax you would know the concept of package modules.  Changes to the Operating System could be stored and thus you could persist your session. There are several ways to store data, customize and even magic folder which are always in sync with each other.

Prior to installation I have partitioned the USB drive into two files systems. A Fat32 in the beginning and Ext4 in the end.







Things to do after Magento install

Replace Magento logo with your Brand Name

  • If you followed my other post for installation in a shared hosting environment, then you would want to do the following things.
  • Replace the Magento Logo with your store Brand. For this upload the logo to the following directory


  • then in your admin panel select configuration and then with your current configuration scope as Default Config
  • select Design from the left panel
  • make sure that your package name is rwd in the right side pane. if not replace rwd with the package name in the above path.
  • now scroll down to the Header section in the right pane and enter the name of the image you uploaded without changing the images/ prefix so it looks like images/yourbrand.png

Add products to your Magento webpage

  • From you admin panel CMS menu select pages
  • Then click on your existing homepage to edit the page.
  • Then click on the content tab.
  • In the HTML editor toolbar, look for the insert widget icon   and click it.
  • In the appearing panel window select catalog new products list for widget type
  • For display type, If you select new products, After populating the rest of the fields in the widget window, simply click the insert widget button to add the widget to your page.
  • If you want to get rid of the ugly bullets from the product, go to the custom design pane and paste the following code

<reference name="head">
<action method="addCss">

  • now upload the custom.css to the following magento installation sub directory.


Change the button text to your Locale

  • We, Indians speak English that is most similar to British and not U.S. So I selected British (English) as my Locale at the time of Magento Installation.  So the button names like Add to Cart, Proceed to Checkout etc. is good enough for most of the installation. However my client wanted to use Magento for sending Quotation instead of doing E-Commerce. So I had to change many of the buttons and hyperlinks. Lets see how to do this.
  • There are three different ways to change the Locale we will use the csv technique for making the changes.
  • Upload a CSV file like this one under the directory /magentodir/app/design/frontend/rwd/default/locale/en_GB
  • If no directory exists inside your theme/default then you can create it.

Change the new order email template

  • If you have made magento to bypass cron and send mail immediately after placing the order, then next step you want to take is change the emails text.
  • For this you need to edit the file located under folder magentodir/app/locale/en_us/template/email/sales

Magento step by step installation on a Shared Hosting

  •  Download the zip archive from Magento website. Do not use the downloader version because its more complicated.
  • create a subfolder under public_html.
  • Set folder permission 755 to the public_html/subfolder
  • Unzip the contents of Magento archive into it.
  • Set correct file permission 644 to the subfolder/index.php
  • replace the contents of .htaccess file with this code. please substitute subfolder with your actual magneto installation foldername

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subfolder/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subfolder/index.php [L]
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off

  • make following changes to file public_html/app/code/core/Mage/Sales/Model/Order.php at around line 325. This is not necessary but if you want Magento to send mail immediately without relying on Cron, you may do like this.

// $mailer->setQueue($emailQueue)->send();

Sending email screen shots from Enlightenment Linux

I read somewhere that its possible to take unattended screen shots (scrot) and mail it (heirloom-mailx) every one hour (/etc/cron.hourly). It was not easy particularly the mailing part because configuring any mail program to send mail from terminal to the outside world seemed a herculean task. The steps ..

$ sudo apt-get install scrot

$ sudo apt-get install heirloom-mailx

#  to install certutil in enlightenement

$ sudo apt-get install libss3-tools

# Create a certificate directory
$ mkdir .certs
# Create a new database in the certs dir
$ certutil -N -d .certs 
# Fetch the certificate from Gmail, saving in the text file GMAILCERT
echo -n | openssl s_client -connect | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > GMAILCERT
# Import the new cert file into the new database in the new dir. enter password when prompted
$ certutil -A -n “Google Internet Authority” -t “C,,” -d .certs -i GMAILCERT 
# Double Check
$ certutil -L -d .certs

Certificate Nickname                                         Trust Attributes
Google Internet Authority                                    C,,  
edit ~/..mailrc file
 account gmail {
 set smtp-use-starttls
 set ssl-verify=ignore
 set nss-config-dir=~/.certs
 set smtp=smtp://
 set smtp-auth-password=your_gmail_passwsord
 set from=”

Testing mail Config

 echo “Test Email” | mailx  -v -A gmail -s “test”




YII webapp customising from ground up

A)) config/main.php

1. name your webapp

‘name’=’my webapp’

2.  enable gii

// If removed, Gii defaults to localhost only. Edit carefully to taste.


3. create your database scheme

4.  beautify url


5. enable mysql or point to sqldatabase

‘connectionString’ => ‘mysql:host=localhost;dbname=mywebapp’,
’emulatePrepare’ => true,
‘username’ => ‘root’,
‘password’ => ‘password’,
‘charset’ => ‘utf8’,

6. set admin email

// this is used in contact page


7. show log messages in the webpage

/ uncomment the following to show log messages on web pages


7.  change default passwords

public function authenticate()
// username => password

BB) Download mbmenu plugi


1. change menus

<?php $this->widget(‘application.extensions.mbmenu.MbMenu’,array(
array(‘label’=>’Home’, ‘url’=>array(‘/site/index’)),
array(‘label’=>’Menu 1’, ‘url’=>array(‘/menu1l’),
array(‘label’=>’sub menu 1’, ‘url’=>array(‘/item11’)),
array(‘label’=>’sub menu 2’, ‘url’=>array(‘/item12)),

2. change footer

<div id=”footer”>
Copyright &copy; <?php echo date(‘Y’); ?> by my company – All Rights Reserved.<br/>
</div><!– footer –>

CC)  YII-booster plugin


Yii::setPathOfAlias(‘booster’, dirname(__FILE__) . DIRECTORY_SEPARATOR . ‘../extensions/yii-booster’);

// preloading ‘log’ component



‘booster’=> array(
‘class’ =>’booster.components.Booster’,