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.
Note
Every WebFaction account is created with an initial mailbox (named after the account’s username), which cannot be removed.
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:
Log in to the control panel.
Click E-mails ‣ Mailboxes. The list of mailboxes appears.
Click the Add new mailbox button. The Create a new mailbox form appears.
In the Mailbox name field, enter the mailbox name.
In the Password field, enter a password for the mailbox.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm password field, reenter the password for the mailbox.
Click to select a mail filtering mode.
To skip server-side spam filtering, select 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 be returned to the sending mail server. This error code should be reported as a bounced email to the original sender.
To redirect junk mail to an IMAP folder, select Redirect junk mail. A field appears. In the field, enter a folder name (such as spam).
To delete incoming junk mail, select Discard junk email.
To use advanced mail filtering rules, select Advanced. A field appears. Enter procmail rules into the field that appears.
See also
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:
In a web browser, open https://my.webfaction.com/change_mail_password/create.
In the Mailbox name field, enter the mailbox name.
In the Current password field, enter the preexisting password.
In the New password field, enter the new password.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm new password field, reenter the new password.
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:
Log in to the control panel.
Click E-mails ‣ Mailboxes. The list of mailboxes appears.
Click the name of the mailbox to change the password of.
In the Password section, click Change.
In the Password field, enter the new password.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm password field, reenter the new password.
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:
Log in to the WebFaction control panel.
Click E-mails ‣ E-mail addresses. The Email list appears.
Click the Add new email button. The Create a new email address form appears.
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.
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:
- In the field, enter the name of the mailbox until the mailbox appears in the list below.
- In the list, click the name of the mailbox.
To save incoming email to a new mailbox:
In the field, enter the name of the mailbox. A Create link appears in the list below.
In the list, click the Create link. Two password fields appears.
In the Password field, enter a password.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm password field, reenter the password.
Click the Save button. The mailbox is created.
To save incoming email to additional mailboxes, repeat the steps for a new or existing mailbox.
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.
See also
To send an automatic response to incoming email, in the Send automatic response, click Yes. A form appears.
See also
- In the From fields, enter an outgoing email address and display name for the automatic response.
- In the Subject field, enter a subject line for the automatic response.
- In the Message field, enter a message body for the automatic response.
- (Optional) In the Reply To fields, enter an email address and display name for the automatic response’s Reply-To address.
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, select a server. In the Path field, enter an absolute path to the program.
See also
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, select your client from the list:
Webmail¶
You can access your email at any time using our webmail tool, Roundcube. Roundcube is available at https://webmail.webfaction.com/. Roundcube requires no configuration to read email; just enter your mailbox name and password to read email messages.
You can also use SquirrelMail at https://squirrelmail.webfaction.com/.
Before you can send email via our webmail systems, you must set your outgoing email address.
To set your outgoing address with Roundcube:
- Log in to Roundcube.
- Click Personal Settings. The User preferences page appears.
- Click the Identities tab. A page listing all of your configured identities appears.
- For each email address you would like to send mail as:
- Click New identity. The New identity form appears.
- In the Display name field, enter your name.
- In the E-mail field, enter the outgoing email address.
- Click the Save button.
Now, when you compose a new email, each identity appears in the Sender menu.
To set your outgoing address with SquirrelMail:
- Log in to SquirrelMail.
- Click Options. The Options page appears.
- Click Personal Information. The Options - Personal Information form appears.
- In the E-mail Address field, enter an email address configured in the WebFaction control panel.
- In the other fields, enter your personal information as desired.
- Click the Submit button. The Options page appears with a confirmation message.
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:
- Log in to Roundcube.
- Click Settings. The menu of settings sections appears.
- In the Section menu, click User Interface. A settings form appears.
- In the Interface skin menu, select w21_mobile.
- Click the Save button.
Upgrading from Legacy Mail Configurations¶
In early 2009, WebFaction deployed a new email infrastructure to simplify mail server configuration so that all users could access incoming mail via mail.webfaction.com and send outgoing mail via smtp.webfaction.com. For mailboxes created before the infrastructure change, you accessed both incoming and outgoing mail through mailX.webfaction.com, where X was a number.
If your mail client settings are configured to use the mailX.webfaction.com series of mail servers, you can upgrade to the new configuration scheme. For each mailbox to upgrade:
Log in to the WebFaction control panel.
Click E-mails ‣ Mailboxes. The list of mailboxes appears.
Click the name of the mailbox to upgrade.
In the Password section, click Change.
In the Password field, enter a password. You may reuse the current password, if desired.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm password field, reenter the password.
Click the Save button.
Update your mail client settings. You must update both incoming (IMAP and POP) and outgoing (SMTP) mail settings.
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
The following directions only apply to mailboxes that use the Maildir storage format. If you have an older account, your mailboxes are on the mail1, mail2, or mail3 servers, and you want to use custom filtering rules, then please contact WebFaction support to have your mailboxes upgraded to the Maildir format.
To add a mail filter:
Log in to the control panel.
Click E-mails ‣ Mailboxes. The list of mailboxes appears.
Click the mailbox you want to add mail rules to. The mailbox’s details appear.
Click to select Advanced. A text field appears.
In the text field, enter your filtering rules.
Note
Rules are processed in order. Enter the most important rules first.
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).
Note
Mail servers mail1 through mail4 require an additional rule to enable the spam level header. Insert the following lines before any other rules:
:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamassassin
You can filter on higher spam levels by adding more asterisks (appropriately escaped with a backslash: \*) to the rule.
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:
- Log in to the WebFaction control panel.
- Click E-mails ‣ E-mail addresses. The list of addresses appears.
- Click on the email address to automatically forward email.
- 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.
- 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:
Log in to the WebFaction control panel.
Click E-mails ‣ E-mail addresses. The list of email addresses appears.
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.
In the From fields, enter an outgoing email address and display name for the automatic response.
In the Subject field, enter a subject line for the automatic response.
In the Message field, enter a message body for the automatic response.
- (Optional) In the Reply To fields,
enter an email address and display name for the automatic response’s Reply-To address.
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 Storage and Email Limits
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.
To use mail2script with an existing address:
- Log in to the WebFaction control panel.
- Click E-mails ‣ E-mail addresses. The list of email addresses appears.
- Click on the email address to send email to a script.
- 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.
- If applicable, in the Server field, select the program’s server.
- In the Path field, enter an absolute path to the program (for example, /home/username/myscript.py).
- 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:
- Open an SSH session to your account.
- 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 Storage and Email Limits¶
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.
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:
Log in to the WebFaction control panel.
Click Domains / websites ‣ Domains. The list of domains appears.
Click on the domain to switch to Google Apps mail.
In the Email section, click to select External.
Click Add Mail Server five times, to add five rows to the list of mail servers. Priority and Mail Server fields appear.
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
Click the Save button.
Additionally, to point a subdomain, for example, webmail.example.com, to Google Apps:
- Log in to the WebFaction control panel.
- Click Domains / websites ‣ Domains. The list of domains appears.
- Click on the domain to point to Google Apps.
- In the Hosting section, click to select Cname. The Cname field appears.
- In the Cname field, enter ghs.google.com.
- 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
See also
- Managing DNS Records with the Control Panel
- Google Apps Help: Configuring Your MX Records
- Google Apps Help: Web address
