Email

On WebFaction, it’s easy to create email addresses, access your mail in a variety of ways, and make use of advanced features, like auto-responders, forwarders, spam protection, and mailing lists.

Mailboxes and Addresses

The WebFaction mail system works with two basic units, email addresses and mailboxes. An email address is a public identifier where others can direct mail (for example, me@example.com). A mailbox is a place on the WebFaction mail servers where email received by one or more addresses is stored.

A mailbox has a single username and password and with them you can access all the mail received by any email address which points to that mailbox. While mailboxes generally correspond to one person, email addresses can point to, or target many mailboxes. In other words, email addresses can be thought of as aliases for mailboxes.

Note

Mail stored in a WebFaction mailbox counts toward disk usage limits.

For example, suppose there are two people using the email system, Jane and Sam. Jane has a mailbox called jane and Sam has a mailbox called sam. While sam@example.net and jane@example.net point to sam and jane, respectively, team@example.net points to both sam and jane, so that both of them receive email messages directed to their team.

Additionally, our mail system supports mail extensions, also known as “sub-addressing,” “tag addressing”, and “plus addressing.” This type of addressing allows you to insert into a valid email address the plus (+) symbol followed by arbitrary characters between the local part of the email address and the domain. For example, consider the email address joe@example.net: mail addressed to joe+extratext@example.net will be correctly routed to Joe’s mailbox, where Joe can use the text between the plus (+) symbol and the at (@) symbol to filter email.

Create an Email Mailbox with the Control Panel

To create an email mailbox with the control panel:

  1. Log in to the control panel.

  2. Click E-mails ‣ Mailboxes. The list of mailboxes appears.

  3. Click the Add new mailbox button. The Create a new mailbox form appears.

    _images/mailbox_form.png
  4. In the Mailbox name field, enter the mailbox name. Mailbox names must be unique. If the message Mailbox with this Name already exists appears, choose a different name for your mailbox.

  5. In the Password field, enter a password for the mailbox.

    See also

    See Strengthening Passwords for important information about choosing passwords.

  6. In the Confirm password field, reenter the password for the mailbox.

  7. Click to select a mail filtering mode.

    • To skip server-side spam filtering, choose None. Use this option to rely on your mail client’s junk mail filters only. Note that messages coming from a blacklisted or misconfigured mail server are rejected, and an error code is returned to the sending mail server. This error code is typically reported to the original sender as a bounced message.

    • To redirect junk mail to an IMAP folder, choose Redirect junk mail. A field appears. In the field, enter a folder name (such as spam).

      Note

      Mail stored in IMAP folders is not accessible to POP clients. Don’t choose this option for mailboxes that are to be accessed primarily by POP clients.

    • To delete incoming junk mail, choose Discard junk email.

    • To use advanced mail filtering rules, choose Advanced. A field appears. Enter procmail rules into the field that appears.

  8. Click the Save button. The mailbox is created and added to the list.

Change an Email Mailbox Password

There are two ways to change an email mailbox password: a web form and the control panel.

Change an Email Mailbox Password without the Control Panel

You can use a form to change email mailbox passwords without logging into the WebFaction control panel. This method is the preferred way to allow your users to change their own mailbox password, because it does not require giving them access to your account.

To change an email mailbox password with the form:

  1. In a web browser, open https://my.webfaction.com/change_mail_password/create.

  2. In the Mailbox name field, enter the mailbox name.

  3. In the Current password field, enter the preexisting password.

  4. In the New password field, enter the new password.

    See also

    See Strengthening Passwords for important information about choosing passwords.

  5. In the Confirm new password field, reenter the new password.

  6. Click the Change password button. The password is changed.

You can use the new password to log in to the mailbox.

Change an Email Mailbox Password with the Control Panel

To change an email mailbox password with the control panel:

  1. Log in to the control panel.

  2. Click E-mails ‣ Mailboxes. The list of mailboxes appears.

  3. Click the name of the mailbox to change the password of.

  4. In the Password section, click Change.

  5. In the Password field, enter the new password.

    See also

    See Strengthening Passwords for important information about choosing passwords.

  6. In the Confirm password field, reenter the new password.

  7. Click the Save button. The password is updated.

You can use the new password to log in to the mailbox.

Create an Email Address with the Control Panel

To create an email address with the control panel:

  1. Log in to the WebFaction control panel.

  2. Click E-mails ‣ E-mail addresses. The Email list appears.

  3. Click the Add new email button. The Create a new email address form appears.

    _images/email_form.png
  4. In the Email fields, enter the local-part and the domain name of the email address. For example, to create no-reply@example.com, enter no-reply and example.com.

    If the address is for a new domain, click Create in the list when it appears. The domain name will be automatically added to your list of domains.

  5. To save incoming email to a mailbox, in the Save to local mailboxes section, click Yes. A field appears.

    To save incoming email to an existing mailbox:

    1. In the field, enter the name of the mailbox until the mailbox appears in the list below.
    2. In the list, click the name of the mailbox.

    To save incoming email to a new mailbox:

    1. In the field, enter the name of the mailbox. A Create link appears in the list below.

    2. In the list, click the Create link. Two password fields appears.

    3. In the Password field, enter a password.

      See also

      See Strengthening Passwords for important information about choosing passwords.

    4. In the Confirm password field, reenter the password.

    5. Click the Save button. The mailbox is created.

    To save incoming email to additional mailboxes, repeat the steps for a new or existing mailbox.

  6. To forward incoming email to another address, in the Forward to other email addresses section, click Yes. A field appears. In the field, enter an email address.

    To forward incoming email to additional addresses, enter more addresses.

  7. To send an automatic response to incoming email, in the Send automatic response, click Yes. A form appears.

    1. In the From fields, enter an outgoing email address and display name for the automatic response.
    2. In the Subject field, enter a subject line for the automatic response.
    3. In the Message field, enter a message body for the automatic response.
    4. (Optional) In the Reply To fields, enter an email address and display name for the automatic response’s Reply-To address.
  8. To send incoming email to a program, in the Send to a program section, click Yes. A Path field appears. If you have plans on more than one server, a Server field appears.

    If applicable, in the Server field, click to select a server. In the Path field, enter an absolute path to the program.

  9. Click the Save button. The address is created. A confirmation message appears.

You can receive mail at the new address.

Accessing Email

There are several ways to access your email stored on WebFaction’s mail servers. You can access your mail using an email client, such as a desktop or mobile application, or using our webmail access.

Configuring an Email Client

Webfaction’s mail servers support clients that use IMAP or POP to access received mail. You can also access your mail on the web. The SMTP protocol is required for outgoing email.

To setup your client to access your Webfaction mailbox, choose your client from the list:

Webmail

You can access your email at any time using Roundcube, a webmail interface. Roundcube is available at https://webmail.webfaction.com/. Roundcube requires no configuration to read email: just log in with your mailbox name and password.

You can also use an alternative webmail interface, SquirrelMail, at https://squirrelmail.webfaction.com/. Like Roundcube, SquirrelMail requires no configuration to read email: just log in with your mailbox name and password.

To send mail with either webmail interface, you must assign an outgoing email address.

To set your outgoing address with Roundcube:

  1. Log in to Roundcube.

    Note

    If it’s your first time logging in to Roundcube, a Please complete your sender identity dialog appears. If the dialog appears, then follow these steps:

    1. In the Display Name field, enter your name as you would like it to appear to mail recipients.
    2. In the Email field, enter an address you want to send mail from (for example, demo@example.com).
    3. Click the Save button.

    The email address is added to the From menu when composing messages with Roundcube. If you want to add more outgoing email addresses, then continue to the next step.

  2. Click Settings.

  3. Click Identities.

  4. At the bottom of the Identities column, click the + (plus) button. The New identity form appears.

  5. In the Display Name field, enter your name as you would like it to appear to mail recipients.

  6. In the Email field, enter an address you want to send mail from (for example, demo@example.com).

  7. Click the Save button.

The email address is added to the From menu when composing messages with Roundcube.

To set your outgoing address with SquirrelMail:

  1. Log in to SquirrelMail.

    Note

    If it is your first time logging in to SquirrelMail, then you may be redirected to the Options - Personal Information form. If your are redirected to the form, skip ahead to step 4.

  2. Click Options. The Options page appears.

  3. Click Personal Information. The Options - Personal Information form appears.

  4. In the Full Name field, enter your name as you would like it to appear to mail recipients.

  5. In the E-mail Address field, enter the address you want to send mail from (for example, demo@example.com).

  6. Click the Submit button. The Options page appears with a confirmation message.

The email address is used for outgoing messages sent with SquirrelMail.

Using Roundcube on a Mobile Device

By selecting a difference appearance, Roundcube can be easier to use with some mobile touchscreen devices. To change Roundcube’s appearance:

  1. Log in to Roundcube.
  2. Click Settings. The menu of settings sections appears.
  3. In the Section menu, click User Interface. A settings form appears.
  4. In the Interface skin menu, select w21_mobile.
  5. Click the Save button.

Managing Email Automatically

WebFaction offers you several ways of managing email programmatically, with automatic forwarding and responders, spam protection, and integration with scripts or applications.

Automatically Filtering Email

You can enable server-side filtering rules to help you manage mail. Unlike filtering rules set in your email client, server-side filters are applied to all incoming mail, regardless of which email client you use.

Note

Mail stored in IMAP folders is not accessible to POP clients. Server-side mail filters are not recommended for mailboxes primarily accessed by POP clients.

To add a mail filter:

  1. Log in to the control panel.

  2. Click E-mails ‣ Mailboxes. The list of mailboxes appears.

  3. Click the mailbox you want to add mail rules to. The mailbox’s details appear.

  4. Click to select Advanced. A text field appears.

  5. In the text field, enter your filtering rules.

    Note

    Rules are processed in order. Enter the most important rules first.

  6. Click the Save button.

Filtering by Sender

To filter email based on the sender, use this mail rule:

:0:
* ^From:<regex>
.<folder>/

where:

  • <regex> is a regular expression. For example, to filter on a sender’s domain, use a regular expression like .*@example.com.
  • <folder> is the name of the destination folder.

Filtering by Subject

To filter email based on the contents of the subject line, use this mail rule:

:0:
* ^Subject:<regex>
.<folder>/

where:

  • <regex> is a regular expression. For example, to filter on a word appearing in the subject line, use a regular expression like .*word.*.
  • <folder> is the name of the destination folder.

Filtering Spam

You can filter incoming mail based on its spam score. To filter mail which has a spam score greater than or equal to 3, use this mail rule:

:0:
* ^X-Spam-Level: \*\*\*
.<spam>/

where <spam> is the name of the spam destination folder (for example, spam or junk).

You can filter on higher spam levels by adding more asterisks to the rule (don’t forget to escape the asterisk with a backslash, like this: \*).

Automatically Forwarding Email

Any email address set up in the WebFaction control panel can be configured to automatically forward email to another email address (or several email addresses).

Note

Obvious spam email will not be automatically forwarded. If you wish to retain email which is not forwarded to other addresses, be sure to save incoming email to a mailbox.

See also

Mail forwarded to a Google Gmail account will not appear in the Gmail inbox if the sender is the same Gmail account. Such incoming messages are ignored. Only the original, sent message will appear in Sent Mail. Please see the Gmail support article An incoming message hasn’t arrived for more details.

To automatically forward email:

  1. Log in to the WebFaction control panel.
  2. Click E-mails ‣ E-mail addresses. The list of addresses appears.
  3. Click on the email address to automatically forward email.
  4. In the Forward to other email addressees section, click Yes. A field appears. In the field, enter the destination address. To forward to additional addresses, enter more addresses in the field.
  5. Save your changes. Click the Save. A confirmation message appears.

New incoming messages are forwarded to the specified addresses. You can also configure forwarding destinations while creating a new email address in the control panel. For more information, see Create an Email Address with the Control Panel.

Automatically Responding to Email

Any email address set up in the control panel can be configured to automatically respond to incoming email. To setup an autoresponder:

  1. Log in to the WebFaction control panel.
  2. Click E-mails ‣ E-mail addresses. The list of email addresses appears.
  3. Click on the email address to automatically respond to email. In the Send automatic response section, click Yes. Fields for customizing the autoresponder messages appear.
  4. In the From fields, enter an outgoing email address and display name for the automatic response.
  5. In the Subject field, enter a subject line for the automatic response.
  6. In the Message field, enter a message body for the automatic response.
  7. (Optional) In the Reply To fields, enter an email address and display name for the automatic response’s Reply-To address.
  8. Click the Save button to save your changes. A confirmation message appears.

New incoming messages receive an automatic response. You can also configure autoresponders while creating a new email address in the control panel. For more information, see Create an Email Address with the Control Panel.

Automatically Emptying a Folder

To delete all of the email in a folder automatically, run this Python script:

#!/usr/local/bin/python2.4
import imaplib
M = imaplib.IMAP4('mail.webfaction.com')
M.login('<mailbox_name>', '<mailbox_password>')
M.select('<folder>')
typ, data = M.search(None, 'ALL')
for msgid in data[0].split():
    M.store(msgid, '+FLAGS', '(\\Deleted)')
M.expunge()
M.close()
M.logout()

where:

  • <mailbox_name> is the name of a WebFaction mailbox as it appears on the control panel,
  • <mailbox_password> is the mailbox password,
  • and <folder> is the name of the folder to be emptied (for example, Spam or Junk).

If you want to schedule a folder to emptied on a regular basis, run the script as a cron job.

Spam Protection

You can filter incoming spam messages on any of your mailboxes. Our spam protection strategy uses blacklists and SpamAssassin, an effective, open source spam filter. You can automatically direct junk messages to a folder, delete junk messages, or use custom filtering. To configure a mailbox’s spam handling, see Create an Email Mailbox with the Control Panel for details.

Backscatter Spam

Does it look like your email account has been hacked? If you’ve suddenly received many notifications of bounced email—email messages with phrases like delivery failed, no such user, or mailbox not found—in response to messages you don’t recall sending, your account probably wasn’t hacked. Instead, you may be the victim of backscatter spam.

Backscatter spam is the result of spammers sending email with forged From addresses. When the faked sender address happens to be your mail account, the various bounce responses are sent to your address, rather than the actual sender.

Typically, backscatter spam appears in batches. You may receive many backscatter spam messages over the course of several hours and then go weeks, months, or even years without seeing more. In such cases, it’s easiest to delete the offending messages and move on. But if you find yourself the frequent victim of backscatter spam, try these solutions:

  • Where possible, remove catchall email addresses. With a catchall address, all email addresses on a domain are considered valid. Because spammers often use random sender addresses, this increases the likelihood that your address will receive the backscatter spam messages.

  • Consider creating an SPF record for your domain. SPF records, or Sender Policy Framework records, inform receiving mail servers of servers permitted to send on behalf of your domain, allowing recipients to silently reject mail sent from unauthorized sources. Not all mail servers verify incoming mail against SPF records, however, so this method may only reduce, not eliminate, the volume of backscatter spam you receive.

    To configure an SPF record, create an SPF DNS record with the control panel. If you’re sending mail from WebFaction’s SMTP server or webmail only, use this record: v=spf1 a:smtp.webfaction.com ~all. If you’re sending mail from a third-party mail server, use an SPF record like this: v=spf1 a:smtp.webfaction.com include:domain ~all, where domain is the third-party mail server. If you’re sending mail from Google Apps, see Using Google Apps for Email.

    For more details on what an SPF records are and how to use them, see Wikipedia’s Sender Policy Framework article and the Sender Policy Framework project.

Sending Mail from an Application

WebFaction web servers provide a sendmail interface via /usr/bin/sendmail or /usr/sbin/sendmail. Mail can be sent directly with sendmail or through a programming language’s wrapper around sendmail, like like PHP’s mail() function.

Mail sent through sendmail, by default, is from a sendmail_username@hostname address, where username is your username and hostname is the host name of your web server (for example, sendmail_demo@web100.webfaction.com). Alternatively, you may specify an outgoing address in the message’s From header.

Note

A sendmail_username@hostname address can only be used to send email. Incoming messages cannot be received at such an address.

You also have the option of connecting to an outside SMTP server, such as the WebFaction SMTP server. Many languages have libraries to simplify this process.

For example, this Python script will send the contents email_msg.txt to team@example.com.

from smtplib import SMTP

from_addr = 'my_email_address@example.com'
to_addrs = ['team@example.com']
msg = open('email_msg.txt','r').read()

s = SMTP()
s.connect('smtp.webfaction.com')
s.login('my_mailbox_name','password1')
s.sendmail(from_addr, to_addrs, msg)

This PHP script sends a message using the built-in mail() function:

<?php
$msg = "This is only a test.\n";
mail('example@example.com', 'Test Message', $msg);
?>

This PHP script uses the PEAR mail package to send a message without the built-in mail() function:

<?php
require_once "Mail.php";

$from_addr = "Me <my_email_address@example.com>";
$to = "Team <team@example.com>";
$subject =  "Hello!";
$body = "Dear Team, here is my message text.";

$headers = array ("From" => $from_addr,
                  "To" => $to,
                  "Subject" => $subject);
$smtp = Mail::factory("smtp", array ('host' => "smtp.webfaction.com",
                                     'auth' => true,
                                     'username' => "my_mailbox_name",
                                     'password' => "password1"));

$mail = $smtp->send($to, $headers, $body);
?>

Here is a Perl script that demonstrates sending an email:

#!/usr/bin/perl -w

use Net::SMTP;
use MIME::Base64;

$smtphost = "smtp.webfaction.com";
$username = '<username>';
$password = '<password>';
$TZoffset = <tz_offset>;
$emailto = '<recipient>';
$subject = '<subject>';
$message = '<message>';

sub date_r
{
    my ($monthday, $mon, $yr, $ time, $hour, $str);
    my (@lt) = ();

    @lt = localtime();
    $monthday = $lt[3];
    $mon = $lt[4]+1;
    $yr = $lt[5]+1900;
    $hour = $lt[2]+$TZoffset;
    $time = sprintf("%02d:%02d:%02d", $hour, $lt[1], $lt[0]);
    $str = $mon . "/" .$monthday . "/" . $yr . " " . $time;
    return $str;
}

$smtp = Net::SMTP->new($smtphost, Debug => 1, Timeout => 5);

$smtp->datasend("AUTH LOGIN\n");
$smtp->datasend(encode_base64($username));
$smtp->datasend(encode_base64($password));

$smtp->mail($emailfrom);
$smtp->to($emailto);

$smtp->data();

$smtp->datasend("MIME-Version: 1.0\n");
$smtp->datasend("From: $emailfrom\n");
$smtp->datasend("To: $emailto\n");
$smtp->datasend("Date: " . date_r() . "\n");
$smtp->datasend("Subject: $subject");
$smtp->datasend("\n\n");
$smtp->datasend($message);
$smtp->datasend("\n\n");

$smtp->dataend();
$smtp->quit;

Warning

Please note that your script or application must comply with WebFaction’s Acceptable Use Policy (AUP). Do not send unsolicited bulk email messages. All mass mailings must be opt-in and provide a means for subscribers to easily opt-out. Violation of the AUP may result in suspension or termination of your account.

See also: Email Limitations and Restrictions

Sending Mail to a Script

Our mail system features mail2script, which allows you to send email to a script in your home directory. When an email message is received by our mail server, mail2script executes the specified script with the email message (including any headers and attachments) provided via standard input.

Some caution is required before handling incoming mail with a program. Failures in the script occur silently. If something goes wrong with the program that’s processing incoming mail, then you will not be notified. If you want to retain a copy of all messages, then choose to save to local mailboxes or forward to another destination, in addition to sending mail to a script.

To use mail2script with an existing address:

  1. Log in to the WebFaction control panel.
  2. Click E-mails ‣ E-mail addresses. The list of email addresses appears.
  3. Click on the email address to send email to a script.
  4. In the Send to a program section, click Yes. A Path field appears. If you have plans on more than one server, a Machine field appears.
  5. If applicable, in the Server field, click to select the program’s server.
  6. In the Path field, enter an absolute path to the program (for example, /home/username/myscript.py).
  7. Click the Save button to save your changes. A confirmation message appears.

For example, this Python script writes all incoming email to example-script.out in user123‘s home directory:

#!/usr/bin/env python

import sys

output = open('/home/user123/example-script.out', 'a')
output.write(sys.stdin.read())
output.close()

Note

mail2script scripts are run as your user and must be executable by your user. To make your script executable:

  1. Open an SSH session to your account.
  2. Enter chmod u+x path, where path is the path to the script, and press Enter.

Mailing Lists

Each WebFaction account comes with an unlimited number of Mailman mailing lists, with web-based administration tools and user-driven opt-in and unsubscribe actions.

To create a mailing list, you will need to request it by creating a support ticket with the following information:

  • an email address for the mailing list itself, where incoming and outgoing mail will be sent and received, like project-discuss@example.com,
  • another email address for the person responsible for administering the mailing list, and
  • optionally, a administration password (if unspecified, one will be generated for you).

Warning

Common list names such as members, discuss, or news are not available. The list’s name is the portion of the address before the @ symbol. Please choose a name which uniquely identifies your mailing list (for example, myorg-discuss).

Note

Mailing lists are only available to domains and subdomains that use WebFaction’s mail servers to manage email. If a domain’s MX record is pointing to a third-party mail server, such as Google Apps for Domains’s mail server, then that domain cannot be used with a WebFaction mailing list.

To use a WebFaction mailing list with a domain using a third-party mail server, create a subdomain for the mailing list (for example, lists.example.com), and create MX records pointing to WebFaction’s mail servers.

See Managing DNS Records with the Control Panel and Using Your Own Name Server for more details.

To create a support ticket to request a mailing list, see Opening a Ticket.

Email Limitations and Restrictions

WebFaction does not arbitrarily limit the total number of messages you may store on our mail servers. Stored messages count toward your total disk space allotment, however. Email storage is not unlimited.

Incoming and outgoing email messages may not exceed 20MB, including attachments.

Please limit your average number of outgoing messages to 500 messages per day. If you need to send more mail, then we strongly recommend a dedicated mail service, such as iContact or MailChimp.

Using WebFaction’s SMTP server, you may not send email with a sender address domain used by common email providers, including aol.com, gmail.com, hotmail.com, outlook.com, and yahoo.com. To send messages from such providers’ addresses, please use the provider’s SMTP server. All outgoing mail with such a sender address domain is silenty discarded unsent; no error or bounce message is returned to the sender.

As always, please consider the WebFaction Acceptable Use Policy, which prohibits unsolicited bulk email and prohibits mailing lists which are not opt-in.

Using Google Apps for Email

If you have a Google Apps account, you can use Google Apps mail instead of WebFaction’s mail server. To configure a domain to use Google Apps for email:

  1. Log in to the WebFaction control panel.

  2. Click Domains / websites ‣ Domains. The list of domains appears.

  3. Click on the domain to switch to Google Apps mail.

  4. In the Email section, click to select External.

  5. Click Add Mail Server five times, to add five rows to the list of mail servers. Priority and Mail Server fields appear.

  6. In the Priority and Mail Server fields, enter the following value pairs:

    Priority

    Mail Server

    1

    ASPMX.L.GOOGLE.COM

    5

    ALT1.ASPMX.L.GOOGLE.COM

    5

    ALT2.ASPMX.L.GOOGLE.COM

    10

    ASPMX2.GOOGLEMAIL.COM

    10

    ASPMX3.GOOGLEMAIL.COM

  7. Click the Save button.

Additionally, to point a subdomain, for example, webmail.example.com, to Google Apps:

  1. Log in to the WebFaction control panel.
  2. Click Domains / websites ‣ Domains. The list of domains appears.
  3. Click on the domain to point to Google Apps.
  4. In the Hosting section, click to select Cname. The Cname field appears.
  5. In the Cname field, enter ghs.google.com.
  6. Click the Save button.

If are using SPF records and sending mail only from Google Apps, use Google’s recommended SPF record:

v=spf1 include:_spf.google.com ~all

If you are using SPF records and sending mail from both Google Apps and WebFaction’s SMTP server, use this SPF record:

v=spf1 a:smtp.webfaction.com include:_spf.google.com ~all