I use MySQL to store user data in courier. Here’s how to set it up. Configure Courier Before you begin, find your courier installation’s configuration directory. It is usually /usr/local/etc/courier, /etc/courier or /usr/local/courier/etc. Unless otherwise noted, the files mentioned here will be in this directory. smtpaccess/ You need to edit the files in this directory to allow relaying by IP address. To allow an IP to relay, add a line like this to any file in this directory.
Like many people, I setup courier to use mysql for authentication. When I went through the setup, I decided to store username as [email protected] in the accounts table. Users who are not in the default domain, can login as [email protected] and they are good to go. This works well in most modern email clients, but some older clients, notably Netscape 4.5, can’t use this syntax and are unable to login.
Note: I have switched to amavisd-new. These docs should still work but I am no longer maintaining them. See Courier with Amavisd-new. These intructions walk you through the setup of AMaViS-ng with the F-Prot virus scanner from Frisk. It should be fairly trivial to use another virus scanner, such as clamav, instead. Needed Ports archivers/lha archivers/unarj or archivers/arj archivers/unrar or archivers/rar archivers/zoo or archivers/unzoo archivers/arc archivers/p5-Compress-Zlib archivers/p5-Archive-Tar archivers/p5-Archive-Zip archivers/bzip2 devel/p5-IO-stringy converters/p5-MIME-Base64 converters/p5-Convert-UUlib converters/p5-Convert-TNEF mail/p5-MIME-Tools mail/p5-Mail-Tools devel/p5-Config-IniFiles devel/p5-File-MMagic sysutils/p5-Unix-Syslog F-Prot You need to install wget (ftp/wget) and unzip (archivers/unzip) for check-updates.
Real-time Blacklists (RBLs) are commonly used to block mail from known spammers or servers that can be used to send spam (open relays and the like). I found a lot of good info on setting up rbldnsd here. I use Bind 9 on my DNS servers so that I can run rbldnsd on the same IP as bind. Note: Setting up and configuring Bind 9 for basic DNS is beyond the scope of this document.