unix virtual server

This section provides information to help you configure your e-mail server. You can configure autoreplies, aliases, mailing lists, virtmaps, catchalls for “general delivery” mail, and access control (blocking unsolicited e-mail or spam).

Access Control
The proliferation of spam is an increasing annoyance to everyone. The VPS v2 Virtual Server provides two ways to control spammer access:
  • It prevents spam from being sent to users on the VPS v2 Virtual Server
  • It prevents spam from being sent through the VPS v2 Virtual Server (relaying).

Note: If the access file is not configured correctly, e-mail usage may break.

Blocking Incoming Spam
The access databases feature provides the ability to allow or refuse mail from specified domains and IP addresses. One method is to enter the from address in the e-mail header of the spam message in the /etc/mail/access file.
    1. Type:
      % cd /etc/mail
    2. Create the /etc/mail/access file and make your entries, using the /etc/mail/access.sample file entries as examples.
The /etc/mail/access file consists of two columns. The left column lists:
  • domain names (example: smut.org)
  • e-mail addresses (example: becky@cycle.info)
  • local parts of e-mail addresses (example: joe)
  • IP addresses (complete or subnets), for example:
    • 111.22.33.44
    • 192.2.3
    • 10
The right column lists:
  • OK – accept e-mail even if other rules in the current rule set would reject
  • RELAY – allow domain to relay through the mail server 
  • REJECT – reject the e-mail with a general error message
  • DISCARD – silently discard the message completely
  1. Type make to rebuild the database. Likewise, make will generate a new sendmail.cf file if there are changes to the sendmail.mc file, and then it will restart Sendmail.

    or
    Type makemap hash /etc/mail/access < /etc/mail/access to rebuild the access database only.

Maintaining the Access File
When choosing values to place in the /etc/mail/access file, you should understand the layout and contents of the mail message headers in an unsolicited message. Mail message layouts (as read by your VPS v2 Virtual Server) enable you to locate and recognize the message's SMTP envelope sender.

Header Lines “From” and “From:”
Your VPS v2 Virtual Server places the sender address in the header line that begins with "From " (the word "From" followed by one space character).

Notice the differences between "From" and "From:" Header lines are not required to be the same, although they often are. The "From:" header line is part of the message content, not part of the SMTP envelope. If a discrepancy exists between the "From" address and the "From:" address, use the "From" address as your value for inclusion in the /etc/mail/access file.

Envelope sender blocking is not foolproof. Because the envelope sender can be (and often is) falsified by spam purveyors, the blocking can be circumvented. Most messages are deflected; however, you must diligently maintain the /etc/mail/access file.

Autoreplies
An autoreply program automatically sends a predetermined reply to e-mail received at a specific address. It can be used to automatically reply to requests for product lists, FAQs and other common documents. It is also useful for sending an automatic confirmation that e-mail has been received.

An autoreply program will respond to every incoming message to the e-mail addresses designated in the aliases file. If you expect to receive a significant number of e-mails from individual users, but don't wish to send an autoreply to every e-mail, you might want to use the vacation program that is shipped with Sendmail. It limits the number of replies to a given sender, so that a reply is sent only once per week (or another configurable period of time).

Your server uses the Autoreply program by default. If you prefer to use the Reply-O-Matic (rom) autoreply program, consult the rom man page and replace /usr/local/bin with /usr/local/sbin/rom with the appropriate flags.

Creating Autoreply Addresses
Use the following as an example when creating your own autoreply.

info: joeuser, "|/usr/local/bin/autoreply -f \"autobot@mydomain.com\" -m /home/joeuser/info.reply -a    \"info@mydomain.com\""

    1. Go to /etc/mail.
    2. Edit the /etc/mail/aliases file by typing in the following form (all on one line):       
alias: recipient, "|/usr/bin/autoreply -f name -m message -a address"
  • Alias   Replace alias with the name of your autoreply, such as "info."
  • Recipient   Replace with the recipient address that receives copies of incoming messages (in a fashion similar to a normal alias).
  • |   Passes the incoming message to the autoreply program and sends back the text of a predetermined message in reply.
  • Name   Replace name with the name you want to use in the "From:" line of the message your autoreply sends.
  • -f   (from address)   The –f option causes a From: header to be inserted at the top of the message, giving autobot@mydomain.com as the sender. This will override any From: headers that appear in the file containing the autoreplyReplace name with the name you want to use in the "From:" line of the message your autoreply sends.
  • -m   The fully qualified name of the file that contains the text of the autoreply. The -m option is not optional. (The other options are optional.)
  • Message   Contains the pathname of your desired message text. If the -m option is not specified, the reply text is taken from a file named .autoreply in the VPS v2 Virtual Server root directory. The -a option specifies a user that an autoreply can reply for. The user specified should be the same as the user (alias) configured for the autoreply.
  • -a   Searches the To: and Cc: headers of incoming mail for the address specified in this option. If the address is found in a To: or Cc: header, send the autoreply; otherwise, don't send the autoreply. (Note: If autoreply is invoked without the -a option, then autoreply always sends the reply--without scanning the To: and Cc: headers.)
  1. Type:
    % newaliases
    Note: The autoreply program searches the "To:" and "Cc:" header lines for the text specified by the address value. Autoreply replies to the message if "address" is found. If "address" is not found, autoreply ignores the message.

Customizing Autoreply Text
Customize the content of both the header lines and the bodylines of the autoreply message.
    1. When preparing the message text, place your customized header lines ("Subject" or "Reply-To") at the start of the file, one after another.
    2. Separate them from the body portion of the message by a single blank line. The first blank line signals the start of the body of the message.
    3. Remove any blank lines that might cause an intended header line to be considered part of the body.

The following is a sample autoreply message:

Reply-To: sales-reply@your_company.com
Subject: Your Information Request
Greetings!
Thank you for your interest in Enetrics Communications. We are an independent organization whose mission is to ...
Hosting  ::  Web Design  :: Server Administration  ::  Tech Support  ::  Contacts
Data Centers  ::  Tier I Global IP Network  ::  SLA/Contracts  ::  Search  ::  Account Login