changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. Using Google SMTP with Postfix on Ubuntu/Debian

    December 22, 2014 by The Man

    I run a few servers at home for various things including a little Raspberry Pi running Debian which emails me alerts when certain things happen. I send these to an account or an Office365 account but being a home IP I often get blocked

    “(host[] said: 550 OU-002 (COL004-MC5F2) Unfortunately, messages from weren’t sent. Please contact your Internet service provider since part of their network is on our block list.”

    So the simple solution is to add a relay host to Postfix.

  2. Fix warning: database /etc/aliases.db is older than source file /etc/aliases

    November 6, 2014 by The Man

    Simply run

    sudo postmap /etc/aliases

    Then restart Postfix with

    sudo service postfix restart

  3. Gleylist spammers on Ubuntu using Postfix and Postgrey

    November 3, 2014 by The Man

    1. Hopefully you have Postfix already installed so simply install Postgres

    sudo apt-get install postgrey

    2. Edit the Postfix config file /etc/postfix/ and add or amend

    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
    reject_unauth_destination, reject_unknown_sender_domain,
    check_policy_service inet:


  4. Updating WordPress from the command line

    September 9, 2014 by The Man

    Just a reminder for me…

    wp core update /var/www/

  5. Use IPTABLES to block those pesky spammers.

    August 29, 2014 by The Man

    I recently had a spate of attacks on my site from bots trying to find weaknesses in WordPress and MySQL. I mainly just log and report but after a while of the same IP over and over I decided to just block it. So here is how to block by IP addresses in Ubuntu or any Linux distro.

    sudo iptables -I INPUT -s -j DROP

    and if you want to do a range

    sudo iptables -I INPUT -s -j DROP

    would block everything in 61.160.212.x

    And yes this is the real spammers ip address out of China. Quite prolific.

    If you installed iptables-persistent you can use

    sudo /etc/init.d/iptables-persistent save

    to save your iptables.


    Because I keep forgetting, here is another way to save if you use iptables-persistent

    sudo dpkg-reconfigure iptables-persistent

  6. Saving iptables with iptables-persistent

    May 28, 2014 by The Man

    To download

    sudo apt-get install iptables-persistent

    and then after you have made changes

    sudo dpkg-reconfigure iptables-persistent