Spam Reduction with Email Aliases

Background

Email extensions and aliases can be powerful tools to limit the amount of spam your system receives and provide greater security for your personal information.  Use of either technique can provide a means of both identifying the source of spam as well as a selective method to “turn off” the address without affecting other senders.  Both extensions and aliases work by obscuring your “real” email address and preventing it from being targeted directly by spammers.

A common use of aliases or extensions is to provide a unique registration email address for each site.  For example, when registering for an Amazon account, you create an alias of “amazon@example.com” or use an extension like “groucho+amazon@example.com”.  Should the Amazon address ever be compromised, it is easily disabled and obvious as to which site requires a new contact address.

Email Extensions

Email extensions are simply modifications of the “base” email address.  For example, if the base email address is “groucho@example.com”, an email extension may modify it to “groucho+marx@example.com”.  The extension is internally discarded by the mail server when routing the mail to your inbox.  The start of the extension is identified by a special separator character (typically a “+”) and anything following it up until the “@” is ignored by the receiving mail server.

Email extensions are very easy to use as once enabled they require no further setup.  Any number of extensions may be added to a base address without reconfiguration.  However, they do not provide as much security as an alias as the base email address remains easily identified.  In addition, some sites have taken to banning email addresses with extensions as legitimate registration addresses.

Email Aliases

Email aliases are a more thorough means of hiding your base email address.  They permit a total substitution of the recipient portion of the address instead of merely appending a unique extension.  For example, if the real email address is “groucho@example.com”, aliases may be created to direct “harpo@example.com”, “chico@example.com”, and “zeppo@example.com” to also forward all email to the “groucho” account.

Aliases are a bit more work to create than extensions as each alias must be added to the /etc/aliases file and the newaliases command run (as administrator).  However, they do provide a greater degree of security as the base email address is never revealed.

Implementation

Enabling Address Extensions

  1. Login as Administrator.
  2. Edit the /etc/postfix/main.cf file to enable the recipient_delimiter option.
    recipient_delimiter = +
  3. Launch the Server Admin application and connect to the server hosting mail services.
  4. Select the Mail service and restart the service.

Disabling Address Extensions

Disabling a particular email extension is not quite as easy as creating a new one.  In fact, it may be easiest simply to add a filtering rule on your email client to delete any email addressed to the compromised extension.  However, it can also be performed at a system level for cases where your email client may not support filtering rules (e.g. iPhone).

  1. Login as Administrator.
  2. Edit the /etc/aliases file by adding the compromised extension and redirecting it to /dev/null.
    grouch+marx:  /dev/null
  3. Run the newaliases command.
    sudo /usr/bin/newaliases

Enabling Address Aliases

Aliases can be added by adding an appropriate entry into the /etc/aliases file. The format for aliases is:

alias: address[, address, ...]

Note that an alias may specify more than one recipient address which results in the mail to that alias being sent to multiple recipients.

  1. Login as Administrator.
  2. Edit the /etc/aliases file and add in the alias and corresponding base address.
    harpo:  groucho
    chico:  groucho
    zeppo:  groucho
    marx: groucho, karl
  3. Run the newaliases command.
    sudo /usr/bin/newaliases

Disabling Address Aliases

If an email alias is compromised, it is a simple exercise to disable the alias and prevent the spam from cluttering up your inbox.  There are two different methods to disabling an alias each of which results in a different behavior.

The first method of disabling an alias is to simply either remove it or comment it out (by prefixing the line with a “#”) from the /etc/aliases file.  With it disabled in this manner, any mail destined for the alias will be “bounced” back to the originating system with a message indicating the recipient is not a valid address.  This provides feedback to the originator and may result in the address being pruned from a spammer’s list (as they don’t want to waste time and resources on a “dead” address).

The second method of disabling an alias is to redirect it to /dev/null instead of a legitimate address.  When disabled in this manner, the mail is simply discarded upon receipt by the server and no feedback is provided to the sender.  This may be preferred for hosts which recieve a lot of spam or with limited bandwidth as it uses less internal resources and outgoing bandwidth.

  1. Login as Administrator.
  2. Edit the /etc/aliases file and update the alias(es) as appropriate.
    # harpo:  groucho
    # chico:  groucho
    zeppo:  /dev/null
  3. Run the newaliases command.
    sudo /usr/bin/newaliases

3 thoughts on “Spam Reduction with Email Aliases

  1. Thanks! I’m glad you liked the article.

    More articles are coming — including spam reduction techniques through Domain Keys (DKIM).

  2. Good article Steven — I use a variety of aliases but never consider the use to reduce spam. Looking forward to more.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>