Configuring a catch-all email address with Postfix on Slicehost

In: development

6 Nov 2008

This post walks you through how to create a catch-all email for any emails sent to your domain that don’t resolve to an actual email account.  This is handy when people type your name wrong or think that there’s a webmaster@domain.com when that account really doesn’t exist.  Most of the tutorials I found have you modify the /etc/postfix/virtual file.  If you set up your slice as the articles showed you, you probably don’t have this file.  Here’s how to do it:

1. Create an email account for the email that you want all stray emails to go to.  If you already have the account created, you can ignore this step.
2. Run “mysql -u root -p” to go to the MySQL console.  You’ll be prompted for your root MySQL password.
3. Type “USE mail;” to use the mail database.
4. Type “INSERT into `forwards` (`source`, `destination`) VALUES (‘@domain.com’, ‘sendhere@domain.com);” to add an entry to the table saying that all emails sent to domain.com that don’t resolve to an account get forwarded to sendhere@domain.com.  Obviously, replace the appropriate values for your site.
5. Quit the MySQL console with “quit;” and then reload Postfix with “sudo /etc/init.d/postfix reload”

Comment Form

About this blog

I'm Jon Chin. I love technology, food, and learning. I served a mission in the Philippines and loved it. You probably can't type on my keyboard because I don't have qwerty installed--I use Colemak. I'm obsessed with learning about North Korea and abandoned anything.

Photostream