Using address extension
Postfix (and many other mail servers) offers one nice address
extension feature: addresses like
<user+whaterver@>
are implicit aliases to
<user@>
. This allows users to implement a simple measure to
fight spam:
- when SomeCompany® or whatever asks for your email address, give
them
<user+somecompany@>
; - if you start receiving spam at that address, you know who sold or was stolen your address;
- finally, you will be able to disable that address so messages are simply refused with a permanent error code.
Disabling an extended address
So, here is how to implement that last step with Postfix, when you
detect that your extended address <user+evilcorp@>
is
being spammed. In /etc/postfix/main.cf
:
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipients, […]
Then, create /etc/postfix/recipients
containing the
addresses to disable:
user+evilcorp@example.com 553 5.7.1 I did not subscribe to receive spam, go away
Of course, the error codes and message can be freely configured, just make sure you are using a permanent error code so senders do not retry. Hash that table, reload Postfix and it is done:
# postmap /etc/postfix/recipients # service postfix reload
After that, your mail server will reject messages sent to these
addresses. And it will do so at the RCPT TO
step, saving
your bandwidth for more useful things.
10 comments
wednesday 09 april 2014 à 08:09 Alberto Luaces said : #1
wednesday 09 april 2014 à 10:36 Tanguy said : #2
wednesday 09 april 2014 à 12:11 Erbureth said : #3
wednesday 09 april 2014 à 14:36 Marcos Dione said : #4
wednesday 09 april 2014 à 15:36 Tim said : #5
wednesday 09 april 2014 à 16:21 Tanguy said : #6
wednesday 09 april 2014 à 16:39 Tim said : #7
thursday 10 april 2014 à 15:53 Jacques said : #8
thursday 10 april 2014 à 15:59 Jacques said : #9
thursday 10 april 2014 à 16:04 Tanguy said : #10