Click Technology

Linux, Windows, Mac it's all good

Ban a sender from sending you mail on Postfix

September7

This is quite handy and easy to set up.

First, open up main.cf, the principal configuration file in Postfix. I use vim, but of course you can use whatever editor you like, e.g. vi, nano etc.

sudo vim /etc/postfix/main.cf

In your main.cf, add the following lines in the configuration

smtpd_sender_restrictions =
        check_sender_access hash:/etc/postfix/sender_access

Now, create a file to store the list of banned names.

sudo touch /etc/postfix/sender_access

and now edit it to add the banned names…

sudo vim /etc/postfix/sender_access

Add the banned addresses in the following format..

news@z.mindsportzero.com REJECT
subscriptions@cashiq.net REJECT
business-quote@receiveyourquote.co.uk REJECT
penny.fox@flashmarketing.info REJECT
enquiries@flashmarketing.info REJECT

Save the file. Now, create the hashed db file for this file..

sudo postmap /etc/postfix/sender_access

Now you should have a file in the /etc/postfix directory called /etc/postfix/sender_access.db

Now all you need to do is restart postfix.

sudo service postfix restart

Tanaaaa!

posted under Linux Tips | No Comments »

Mail Ports

April6

Network ports used in conjunction with IP addresses are used to define the TCPIP socket for network connections between hosts on an (inter)network so they can communicate with each other. Some port numbers are classics and here are those used for electronic mail.

POP3 – port 110

IMAP – port 143

SMTP – port 25

HTTP – port 80

Secure SMTP (SSMTP) – port 465

Secure IMAP (IMAP4-SSL) – port 585

IMAP4 over SSL (IMAPS) – port 993

Secure POP3 (SSL-POP) – port 995

posted under Linux Tips | No Comments »

This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.