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 can also point to both sam and jane, so that both of them can 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 mailboxes listing page loads.
Click the Add new button (
). The add mailbox form page
loads.
In the Name field, enter the mailbox name.
If you want to enable spam protection measures, click to select Enable spam protection.
If you want to automatically delete email marked as spam, click to select Discard spam.
If you want to automatically move email marked as spam to an IMAP directory (e.g. Spam), enter the name of the IMAP directory in the Spam redirect folder field.
If you want to use custom procmailrc rules, click to select Use manual procmailrc.
If you selected the option in the previous step, enter your procmailrc rules in the Manual procmailrc field.
Click the Create button. Your mailbox is created and a confirmation page loads.
Change an Email Mailbox Password¶
There are two ways to change an email mailbox password. The first is through a web form; the second is through the control panel.
Change an Email Mailbox Password without the Control Panel¶
You can use a form to change email mailbox passwords which is accessible without logging into a WebFaction account; this method is the preferred way to allow your users to change their own mailbox password without giving them access to the control panel.
To change an email mailbox password with the form:
In a web browser, open https://my.webfaction.com/change_mail_password/create.
Enter the email mailbox name in the Mailbox name field.
Enter the preexisting password in the Old mail password field.
Enter the replacement password in the New mail password field.
See also
See Strengthening Passwords for important information about choosing passwords.
Enter the replacement password again for confirmation in the Confirm new password field.
Click the Change button. The password record is updated.
Change an Email Mailbox Password with the Control Panel¶
You can change the password for any mailbox associated with your account from the control panel.
Log in to the WebFaction control panel.
Click E-mails ‣ Mailboxes. The Mailboxes page appears.
Click the View button (
) for the mailbox you want to
modify. The View page for that mailbox appears.Click the Change password button. The Change mailbox password page appears.
In the New mailbox password field, enter the new password.
See also
See Strengthening Passwords for important information about choosing passwords.
In the Confirm password field, enter the new password again.
Click the Change button. The View page appears along with a confirmation message that the password has been changed.
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, click Yes for Save to local mailboxes and then enter a mailbox name in the field that appears. If the mailbox name is for a new mailbox:
- When it appears in the list, click Create.
- In the New mailbox password and Confirm mailbox password fields, enter the new mailbox password.
- Click the Save password button. The mailbox will be created.
You can save incoming email to additional mailboxes by more mailbox names into the list.
To forward incoming email to another address, click Yes for Forward to other email addresses and enter the forwarding destination in the field that appears. You can forward incoming email to additional addresses by entering more addresses into the list.
See also
To send an automatic response to incoming email, click Yes for Send automatic response. 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, click Yes for Send to a program and, in the Path field, enter the absolute path to the program.
See also
Click Save. The address and any required domains and mailboxes are created. A confirmation message appears.
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.
Upgrading from Legacy Mail Configurations¶
In early 2009, WebFaction deployed a new email infrastructure to simplify mail server configuration such 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 mail through mailX.webfaction.com, where X was a number, for both incoming and outgoing mail.
If your mail client settings are configured to use the mailX.webfaction.com series of mail servers, you can upgrade to the mail.webfaction.com configuration scheme. For each mailbox to upgrade:
- Log in to the WebFaction control panel.
- Click E-mails ‣ Change mailbox password.
- In the Mailbox menu, click to select the mailbox to upgrade.
- In the New mailbox password field, enter a password. You may reuse the current password, if desired.
- In the Confirm password field, reenter the password.
- Click the Change button. The View page for the mailbox appears with a confirmation message.
- Update your mail client 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 WebFaction control panel.
Click E-mails ‣ Mailboxes. The Mailboxes list appears.
In the row of the mailbox to which you want to add mail rules, click the Edit (
) button. The Edit form appears.Click to select Use manual procmailrc.
In the Manual procmailrc field, enter your filtering rules.
Note
Rules are processed in order. Enter the most important rules first.
Click the Update button. The View page appears with a confirmation message.
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 (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 Gmail account will not appear in the Gmail inbox if the sender is the same Gmail account. Such messages will appear in Sent Mail. See Gmail Help 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 Email list appears.
- Click on the email address to automatically forward email.
- Click Yes for Forward to other email addressees and enter the destination address in the field that appears. To forward to additional addresses, enter more addresses in the field.
- Click the Save button to save your changes. A confirmation message appears.
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 Email list appears.
- Click on the email address to automatically respond to email.
- Click Yes for Send automatic response. A form appears.
- 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.
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 enable spam protection on any of your mailboxes. Our spam protection scheme includes SpamAssassin, an effective, open source spam filter and the use of blacklists. You can enable spam protection by selecting Enable spam protection on the add mailbox and edit mailbox pages (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 a TXT DNS override. 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@mydomain.tld.
from smtplib import SMTP
from_addr = 'my_email_address@mydomain.tld'
to_addrs = ['team@mydomain.tld']
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@mydomain.tld>";
$to = "Team <team@mydomain.tld>";
$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 Email list appears.
- Click on the email address to send email to a script.
- Click Yes for Send to a program. The Path field and (if applicable) the Server menu appear.
- If applicable, from the Server menu, click to select the server where the target script is located.
- In the Path field, enter the full path to the target script (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 Overriding 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 amount of email you may store on your mail server. The amount of email stored on our mail servers counts toward your total disk space allotment, however; email storage is not unlimited.
WebFaction strives to be a generous host with the volume of mail permitted on our mail servers; as such, we request that you limit your average number of outgoing messages to 500 messages per day.
If you need to send more mail, we strongly suggest 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 Domains list appears.
Click on the domain to switch to Google Apps mail.
Under Email, click to select External.
Click + five times, to add five rows to the list of mail servers. Priority and Mail Server fields appear.
In each pair of the Priority and Mail Server, enter the following values:
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.domain.tld, to Google Apps:
- Log in to the WebFaction control panel.
- Click Domains / websites ‣ Domains. The Domains list appears.
- Click on the domain to point to Google Apps.
- Under Hosting, 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
Finally, there are scripts available on the WebFaction forum which can automate this process for certain configurations.
See also
- Overriding DNS Records with the Control Panel
- Example DNS Override: Creating an SRV Record to Enable Google Talk
- Google Apps Help: Configuring Your MX Records
- Google Apps Help: Web address
