Welcome to Islandnet.com  
Locally owned and operated since 1993  
Live Help
LOG IN:  Username:    Password:    

Map Files

Return to the help index

Introduction

A map file is useful if you have your own domain name(s). They allow you to create any number of e-mail addresses (or aliases) within your domain and forward them to specific mailboxes.

The default behavior is to forward all messages for any address in your domain to your primary account (ie: the account that the domain belongs to). So if people send mail to "sales" at your domain, or "info", or "bigcheese", or anything else, the message will reach you.

But what if you want "sales" at your domain to go to someone else, and you don't want mail for "bigcheese" to be accepted at all? That's where a map file comes in.

Creating a Map File

A map file is a plain text file. You can create it using the helpdesk's File Manager program, or you can create it using any text editor or word processor (just be sure to save it as a text file without any word processor formatting).

The map file's name must begin with "map." and end with your domain name. So if your domain was "example.com", the name of the map file would be "map.example.com". The name must be all lower case letters.

The map file is created in, or uploaded to, the top level of your account's file area. This is on the same level where you'd see your PEP "mailrule" file, or the "www" directory, and so on.

Entries in the map file consists of a left-hand side and a right-hand side, separated with a colon. The left-hand side lists one or more addresses within your domain and the right-hand side controls what happens to messages that arrive for those addresses. For example:

   sales: jsmith@aol.com
That particular example means that any mail sent to "sales@example.com" will be forwarded to "jsmith@aol.com" instead of delivered to your local mailbox.

Note that it is not necessary to include the "@example.com" part in the left-hand side.

If you have multiple addresses that you want to forward to the same person, you can separate them with commas, like this:

   sales,marketing: jsmith@aol.com
That example forwards anything that arrives for either "sales@example.com" or "marketing@example.com".

Likewise, if you want to forward a message to more than one recipient, separate them with commas like this:

   sales: jsmith@aol.com,pfrank@aol.com
For readability you can spread the right-hand side over any number of lines. The example above could also have been done this way:

   sales: jsmith@aol.com
     pfrank@aol.com
Note that if a line has no colon in it, it is assumed to be a continuation of the previous line.

Blank lines are ignored, as are lines that begin with a '#' symbol. In fact, any text that appears after a '#' symbol is ignored. This is useful for leaving coments for yourself. For example:

   staff: mark@islandnet.com # Big Cheese
   sm@islandnet.com # Bottle washer
If you have more than one domain simply create a separate map file for each one. There is no limit to the number or size of your map files.

Actions

The examples above show the most common action, which is to forward the message to one or more addresses. But you can also tell it to reject the message like this:

   sales: !
Now messages that match that entry will generate a "No such user" error. You can customize the error message like this:

   sales: !We don't sell anything...

Wildcards

Normally an entry must match exactly, but you can also use the '*' wildcard. Consider this example:

   *master: jsmith@aol.com
That would forward any mail sent to "postmaster@example.com" and "webmaster@example.com" (plus any other address that ends with "master"). A common use of the wildcards would be to create a final default rule that deletes mail sent to unknown addresses:
   *: !

Allowing for Spelling Mistakes

In some situations it may be desireable to accept mail with a misspelled address. Consider the case where you have an address like "Jane_Smith" and people often use "Jane.Smith" or "Jnae-Smith" or other "close but not quite" spellings. One option would be to try and think of every possible spelling mistake and create individual entries for each of them, another would be to let the map file system allow for a certain number of mistakes.

To do this, simply add a number enclosed in square brackets to the end of the address, like this:

   jane_smith[3]: jsmith@aol.com
Now it will not only match "jane_smith" exactly, but anything that is within 3 spelling mistakes. So it would also match "jnae_smith", or "jane-smith" (dash instead of underscore), or "jan_smit", etc.

It works by adding up the number of characters that would have to be added, deleted, or transposed to make the addresses match. The higher the number you provide, the more errors it will accept.

Macros

In some cases you might have a list of addresses that you use more than once in your map file. Using a macro can make managing such a map file easier. To define a macro, you create an entry like this (note the use of '=' instead of ':'):

   staff = mark@islandnet.com,steve@islandnet.com
By itself that entry doesn't do anything, but we can now refer to this macro in subsequent entries like this:

   abuse: staff,abuse@islandnet.com
   support: staff,support@islandnet.com
And so on. Now if the staff list changes, you only need to change it on the first line. Note that macros can only be used in the right-hand side.

Spam Assassin

If an alias starts with a greater-than sign then the message's spam score (as determined by Spam Assassin) is tested and if it's greater than the number provided it's considered a match, regardless of the actual address. This is useful for rejecting spam that scores higher than a certain amount across your entire domain. For example:

   >10.0: !This message's spam score is higher than 10.0

An Example

Here is a sample map file for "example.com", complete with comments (note that the lines starting with pound signs are comments for your own use, the mail server ignores them):

   # EXAMPLE.COM Map File

   # Delete high scoring spam
   >15.0 : !Rejected due to a high spam score

   # Staff group alias
   staff = jsmith@aol.com
           rjones@msn.com

   # Forward sales and info enquires to staff plus Henry.
   sales,info: staff,phenry@hotmail.com

   # Forward Jane's personal e-mail to her alone
   jsmith: jsmith@aol.com
   jane_smith[3]: jsmith@aol.com

   # Forward Rick's personal e-mail to him
   rick: rjones@msn.com
   rick_jones[3]: rjones@msn.com

   # Ted no longer works here
   ted: !Ted's new address is ted@earthlink.com

   # Anything else is likely spam, reject it
   *: !

Map Files & PEP

Map files are distinct from the PEP facility, they have no connection to each other. Map files are processed early on in the overall e-mail delivery process, long before PEP gets involved. This is important to know, since any spam filtering that you have configured in PEP will not apply to mail that gets forwarded by your map files, unless of course they forward to a PEP protected mailbox.



Page generation time: 0.02 seconds