Category: Mail Servers

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

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

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

Root Alias with Qmail

Root Alias with Qmail

In order to create root alias , you have to edit the .qmail-root file on qmail server vi /var/qmail/alias/.qmail-root Now add the email address that you want to alias to and add & at...

Block Chinese Spam

Block Chinese Spam

## Charsets from asia: /^Content-type:.*charset\s*=[\s\"]*(big5|euc-kr|gb2312|ks_c_5601-1987|ISO-2022-JP)/ REJECT /^Subject:.*\[Big5\].*/ REJECT /^Subject: \=\?iso-8859-1.*/ REJECT

Configure Postfix as a backup MX

Configure Postfix as a backup MX

In order to configure postfix as a backup mx, you need to make some changes to the configuration file : Add the following line to the main.cf file: vi /etc/postfix/main.cf Add  permit_mx_backup to the...

Spam Filtering with postifx and pcre

Spam Filtering with postifx and pcre

1. Check if postfix has pcre support : postconf -m 2. Add the below lines to main.cf vi /etc/postfix/main.cf body_checks = pcre:/etc/postfix/body_checks.pcre header_checks = pcre:/etc/postfix/header_checks.pcre 3. Put the keywords and details that you want...

Postfix Tips and Tricks

Postfix Tips and Tricks

Postfix mail for domain.com loops back to myself Update mydestination using postconf or by editing main.cf file: mydestination = localhost.$mydomain, localhost, mail.example.com Once done reload postfix: service postfix reload Sender address rejected not owned...