Postfix Myths
Qmail is easier to set up than Postfix.
I'd dispute this if only because with no prior experience I was able to look at the well-commented config file, change a couple lines to illinois.dyndns.org and change it from 'mbox' to 'Maildir/' because Maildir was what courier required. Unless qmail comes with a setup that autodetects the settings in your mind, I think that at most, they could be equally easy to set up.
especially if you are routing SMTP,
This requires a little bit of reading, but there are text files in the /usr/local/etc/postfix (or wherever your system keeps postfix configs) for various things. a text file to specify routing tables is one of the files
in there (although perhaps not created by default).
or have many domains to deal with.
The above comment applies here too.
Qmail has never had a security breach.
djb is known for his secure code. I don't know if I like software that has never seen a breach though. Maybe its just paranoia.
http://www.postfix.org/
For instructions, I've found a couple good walk-throughs although the
files in /usr/local/etc/postfix are very well commented.
http://freshrpms.net/docs/mail-server/
- This example uses RedHat 7.3 and includes integration with dovecot for secure imap services and ldap.
http://www.littlewhitedog.com/reviews_other_00029.asp
- This example is part of a complete FreeBSD configuration. The examples given for postfix and courier are very good.
To install postfix, I recommend using apt-get on recent redhat systems (or use the regular methods), postfix is already installed on mandrake (unless you have changed it), apt-get can be used to install it on debian-based
systems, you can fetch it from www.postfix.org, or, my favorite option if I have to use Linux: NetBSD's pkgsrc. This is a complete port of the ports system to multiple platforms including Linux.
cd /usr/pkgsrc/mail/postfix && bmake install clean
You can get more info on nbsd pkgsrc from http://netbsd.pair.com/Documentation/software/packages.html
(netbsd.pair.com is a www.netbsd.org mirror, slightly closer to home). As I understand it, pkgsrc also has binary packages for multiple platforms, including debian and more interestingly Slackware.
--Brandon
2003-11-23 (23:07) -Changed make to bmake. On Linux systems the default make(1) is GNU make. The ports and pkgsrc system (different names for essentially the same thing) use berkley make, or bmake (sometimes called pmake or make4.4). If you use make install clean, more than likely (depending on what you've done, symlinks or messing with your PATH could change this) you will be using GNU make and get an error message.
Postfix Books
Securing Postfix
Dumping your non-default config values
postconf -n
Rejecting AntiVirus Spam with Postfix
Tired of those emails that advertise "Our Most Excellent AntiVirus System (insert brand here) has detected that you sent us a virus-infected email"?
Steve provides this solution:
Given that a) we don't run Windows, and b) every one of the Windows email viruses going around spoofs the sender address, I'm really sick of receiving warning messages from other people's poorly configured virus filters. I dug through my procmail log and found as many of the subject lines from those messages as I could in order to set up header_checks rules to block the damn messages. I feel like sharing, so the results are below. :-)
Oh, and on this subject, I used to feel bad that majordomo replied with a message whenever email was held for moderation, since it ended up replying to the wrong person when it received virus messages, but I'm doing virus filtering with amavis now, so I don't think those messages are necessarily a bad thing anymore.
Postfix header_checks
Add this to your header_checks pcre map (Postfix users only), replacing "YOUR_MESSAGE_HERE" with something like "We didn't send you a virus so don't send us your spam."
/^Subject:.*ALERT - GroupShield ticket number .* was/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*A mail message with subject .* contained a virus$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Antigen found VIRUS=/ REJECT YOUR_MESSAGE_HERE
/^Subject: Attachment too large$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Attachments not Delivered by MailScan\!$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*A virus *was detected in the message$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Disallowed attachment type found in sent message/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Email was scanned, virus was removed:/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*eTrust InoculateIT Lotus Notes Domino Option detected virus\!$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Failed to clean virus file/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*GateLock Virus Notification\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Important Notice: VIRUS GEFUNDEN\!$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*InterScan(_Virus_| NT )Alert/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Mail Cleaner Virus Alert$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*MAIL GATEWAY ALERT$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*\[MailServer Notification\] ?To (Sender|Recipient) virus found and action taken\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*MDaemon Warning - Virus Found$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*moscas \(infecciones\)/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*NAV detected a virus in a document you authored\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Net Integrator Virus Alert$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Non delivery report: .*\(Virus infection\)$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Norton AntiVirus detected (and quarantined )?a virus in a message you sent/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Norton AntiVirus failed to scan an attachment in a message you sent\./ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Norton Antivirus ha rilevato un virus nel documento/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Notification -- Attachment Removed From Message$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Returned due to virus;/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Returned mail: Possible Virus Infection$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*re\..*\{VIRUS\}/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*ScanMail Message: To .* virus found and action taken\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Symantec AntiVirus\/Filtering for Domino$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Symantec AVF detected a.*virus in a message you sent/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Symantec Mail Security detected a.*virus/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Undelivered \(Virus\)$/ REJECT YOUR_MESSAGE_HERE
/^Subject: Virus Alert$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Alert - ScanMail for Lotus Notes/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Check Alert/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*VIRUS.*dans votre courrier$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Detected by Network Associates, Inc\. Webshield/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus detected in attachment$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Detected in Email you sent\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus detected in mail/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus detected in ".*"$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus detected$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Detected$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Discarded$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*VIRUS en su e-mail/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus(es)? incident$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus(es)? picked up by Virex$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus found in a message you sent$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus found in (message|mail) from you\!$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Found in message ".*"$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus found in sent message/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus found in sent message$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus found in (sent|the) message/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus incident$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*VIRUS INFECTION ALERT/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Infection Alert\!/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*VIRUS.*IN MAIL FROM YOU$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus intercepted$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*VIRUS (\(.*\) )?IN YOUR MAIL/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus n\xe1jden\xfd vo Va\xb9ej po\xb9te/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*\[VIRUS REMOVED\]/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Virus Scan detected a virus in an email you sent\.$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus trouve dans le message envoye/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*virus trovato in un messaggio inviato/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Warning: antivirus system report$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Warning: E-mail virus(es)? detected$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Warning: E-mail virus(es)? detected$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*Warning: E-mail Virus \(virii\) Detected$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*WARNING: YOU MAY HAVE A VIRUS$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*WARNING: You tried to send a potential virus or unauthorised code$/ REJECT YOUR_MESSAGE_HERE
/^Subject:.*You sent potentially unsafe content:/ REJECT YOUR_MESSAGE_HERE