Category: Linux

Configure postfix to use Sendgrid as default Relay

Configure postfix to use Sendgrid as default Relay

If you would like to configure postfix to use Sendgrid as the mail relay, you can do so by editing the postfix main configuration file. vi /etc/postfix/main.cf And then paste the content below at...

Touch command tips and tricks

Touch command tips and tricks

Changing modification time using touch: touch -d ‘-4 day’ filename touch -d ‘-4 hour’ filename touch -d "30 days ago" filename Setting Timestamp : touch -t 201606101712 filename

Bash – Convert a comma separated list to any Array

Bash – Convert a comma separated list to any Array

#!/bin/bash IFS="," sampleData="59,100,23,98,50" arr=($sampleData) for i in "${!arr[@]}";do echo Item $i:"${arr[$i]}" done unset IFS echo "Completed"

Postfix Queue Management

Postfix Queue Management

Retry delivery of mail in queue : postqueue -f Flush mail for a domain to primary mail server from Relay server: postqueue -s domain.com Delete all email in queue for a domain: postqueue -p...

Build 32 bit application or libraries on 64 bit machine

Build 32 bit application or libraries on 64 bit machine

In order to configure script to build 32bit library on a 64 bit machine, you would have to pass the following arguments : ./configure –build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" Also, If you get an error...

Nagios Bash script to monitor Domain Expiration

Nagios Bash script to monitor Domain Expiration

This little script here, lets you use nagios to monitor domain name expiration and warn you ahead of time. You can also use it to just run some cron jobs, our extract the portion...

New Apache : Authz_core:error Client Denied by Server Configuration

New Apache : Authz_core:error Client Denied by Server Configuration

The newer version of apache 2.4.6 that comes with Centos 7, seems to require some additional statement. If you are using htaccess , then you have to add the following keyword in order to...

Postfix – Sender address rejected: User unknown in virtual mailbox table

Postfix – Sender address rejected: User unknown in virtual mailbox table

Sometimes you may want to be able to send  email from non existent email addresses on your own networks for notification purposes, you may get error ‚ÄúSender address rejected: User unknown in virtual mailbox...

Postfix Spam Control

Postfix Spam Control

Reject / Discard / Redirect emails based on header checks : vi /etc/postfix/main.cf header_checks = regexp:/etc/postfix/header_checks vi /etc/postfix/header_checks /^From: "Mechanic/ REJECT /^To: someone@example.com/ REDIRECT someone@example2.com /^To: bademail@example.com/ REJECT /^Subject: .*badWord/ DISCARD Reject By Subnet...