Slashdot Mirror


Postfix: A Secure and Easy-to-Use MTA

BSD Forums writes "On March 3rd, 2003, Internet Security Systems, in cooperation with the Department of Homeland Security, issued a warning regarding a hole found in Sendmail. The warning, echoed by CERT, warned system admins that any version lower than 8.12.8 was vulnerable to a serious root exploit. Sendmail has a long history of security holes, most of which have been thoroughly documented on security sites. While Sendmail runs half the mail servers in the world, there are smaller and easier-to-use mail transfer agents (MTAs). Network administrator Glenn Graham demonstrates how Postfix gives you most of the power with a fraction of the pain."

42 of 374 comments (clear)

  1. Or try qmail - unbroken since v1.03 (1998) by KeithH · · Score: 5, Informative

    Qmail is rock-solid. The best proof I can offer is that fact that no security flaw has been found since 1.03 was released in 1998. The man is a cryptographer and designed it for security.

    There is also an enormous amount of support for the product available. Check out qmail.org and cr.yp.to/qmail.html

    1. Re:Or try qmail - unbroken since v1.03 (1998) by semanticgap · · Score: 1, Informative

      I've run qmail on my machine for almost a year. In the end I ended up switching back to sendmail - while it may be "unbroken", qmail is cumbersome to use and lacks many important features of sendmail.

    2. Re:Or try qmail - unbroken since v1.03 (1998) by The+Original+Yama · · Score: 2, Informative

      Want an idea of how secure qmail is? Take a look at the The qmail Security Challenge.

    3. Re:Or try qmail - unbroken since v1.03 (1998) by Lussarn · · Score: 4, Informative

      More info is definetely needed before +5 interesting. Which OS, Filesystem, mountoptions and queue disk setup did you use for qmail to act like this.

      I've had qmail experience the behavior you are talking about using Solaris/ufs/noasync (single scsi disk) but using ext3/async,noatime (single scsi) under Linux X86 has proven to be very nice.

      Reiser would probably do a good job here too.

      Setting up mailservers is more science then just telling what sucks and what does not.

    4. Re:Or try qmail - unbroken since v1.03 (1998) by KeithH · · Score: 5, Informative

      The DoS problem doesn't lie with qmail itself. That particular issue is best addressed through thresholding which is supported by ucspi-tcp's tcpserver (a replacement for inetd or xinetd).

      If you are using ucspi-tcp already, then it is probably as simple as modifying the contents of /var/qmail/control/concurrencyincoming.

      ucspi-tcp is not *required* but much of the qmail documentation assumes that you are using it. ucspi-tcp is also written by Dan Berstein (cr.yp.to/ucspi-tcp.html)

    5. Re:Or try qmail - unbroken since v1.03 (1998) by KC7GR · · Score: 4, Informative
      At the risk of sounding like one of those infomercial testimonials...

      I ran qmail for a year or so, then ended up switching to Postfix. At this point, you couldn't pay me to switch back to qmail.

      It's not that qmail's a "bad" program. It's certainly not! Dave B. did a heck of a job with it, and I know it's in service as a Sendmail replacement at thousands of sites.

      My gripes with qmail are that you practically need to be a programmer to implement it "properly" (at least that's my impression), and that, in order to have an ideal working environment for it, you have to replace the inetd daemon, and add in other tools that are far from simple for non-programmers to implement and use.

      My biggest gripe with qmail was how it implemented spam blocking. Complex and clumsy (to my view), with no way that I found to "whitelist" a given domain name or IP, and no way to block on domain name lookup either.

      Postfix solved all the problems listed above, and it came pre-installed with NetBSD (my Internet server OS of choice). As for its blocking/whitelist syntax, it couldn't be simpler. Examples...

      For blocking: some.host 554 Access denied.
      For whiteliesting: some.host OK

      You simply replace 'some.host' with an IP address or host name, and the three-digit error code with anything you want. qmail was limited to two error codes. The best part is that you can, if you wish, block entire countries that have become spam sewers simply by doing things like this in the blocklist:

      .cn 554 Access denied. China's a spammer paradise.



      With qmail, you'd have to go through and enter every single IP range assigned to China, manually. I know -- I did this at one time for qmail, and it was two hours plus worth of work! What's even worse is that you have no control over what error message text is sent back. Postfix lets you put in anything you want.

      While I will admit that Postfix's default blocking file cannot directly accomodate CIDR notation or IP ranges, Rahul Dhesi, one of the nice folks who inhabits news.admin.net-abuse.email, wrote a handy script to take a source blockfile, complete with said CIDR notations and specific syntax to indicate a range, and convert it into a form usable with Postfix. He also has a bunch of other handy tools for use with Postfix on his site.

      I may not know what a "milter" is, but I do know that postfix can block or pass mail on just about anything you want. It supports regular expressions, hashes, etc.

      I guess I do sound like a testimonial... Well, the heck with it! I like Postfix. ;-) The info at Postfix's home site speaks for itself.

      Keep the peace(es).

      --

      Bruce Lane, KC7GR,

      Blue Feather Technologies

  2. Use Qmail by The+Original+Yama · · Score: 5, Informative

    The Qmail author offers money for any holes found. So far he hasn't had to pay a cent.

    1. Re:Use Qmail by dasmegabyte · · Score: 4, Informative

      Qmail is a little tricky to set up, but it's also small, has some awesome optional features (virtualhosts and the .qmail aliasing system are wierd, but once you get them down you'll appreciate the flexibility they offer) and once you're done it's worth it. It's nice to have a service that you can say, "This is done. I no longer have to worry about it."

      Of course, since I use DJBDNS and qmail-pop3, I have 3 services I can mostly ignore. And it only took me 8 hours curled up with lifewithqmail.org to do it.

      --
      Hey freaks: now you're ju
    2. Re:Use Qmail by hanssprudel · · Score: 3, Informative

      the author of qmail, ha[s] a very low opinion of your fellow developers.

      If you had looked at the license for qmail, you would already know this.

  3. I've switched one box to postfix.. by brentlaminack · · Score: 5, Informative

    In general I found that virtual domains were a bit trickier to set up in postfix than in sendmail. Ordinary aliases were just as easy (read identical). My sites don't do enough volume to tell any difference in performance. The build/install process was probably a bit easier for postfix, i.e. didn't have to monkey around with M4. So as a sendmail admin of more years than I care to think about, postfix seems about as easy to administer as sendmail on a day-to-day basis.

    1. Re:I've switched one box to postfix.. by bigberk · · Score: 4, Informative
      In general I found that virtual domains were a bit trickier to set up in postfix than in sendmail
      postfix used to have a different way to do virtual domains (in fact, it was called the "sendmail-style" virtual domains). These were a pain. Now it is very easy to set up virtual domains. There are 3 steps, and it will take you all of 2 minutes to set this up. I kid you not...
      1. Make sure 'virtual_maps' directive is in postfix.conf; e.g. virtual_maps = hash:/etc/postfix/virtual
      2. Edit the file 'virtual' making sure you include the "Virtual domain" as the first line of a group. Include as many as of these blocks as you want, multiple domains.
        example.com Virtual domain
        ad1@example.com destuser1
        ad2@example.com destuser2

      3. Run 'postmap /etc/postfix/virtual'
  4. Re:Milters? by CoolVibe · · Score: 3, Informative
    No, postfix has no milters. A shame really, since milter is a nice way to control how your mail flows (and to filter/reject/bounce when needed).

    Milter is one of the things that's keeping me with sendmail.

  5. Panther / Mac OS X 10.3 (11?) will use Postfix by tm2b · · Score: 4, Informative

    Just as a heads up to Mac users... the next major revision of Mac OS X, Panther, will be changing from Sendmail to Postfix. So if you use Mac OS X, you don't need to do anything special other than buy Panther when it becomes available.

    Personally, that's what is pushing me over the edge to learn Postfix and use it on my OpenBSD servers. In a nostalgic way, it's too bad... I once made some seriously good money writing custom sendmail.cf files on a consulting basis.

    --
    "It is our blasphemy which has made us great, and will sustain us, and which the gods secretly admire in us." - Zelazny
  6. Courier by dusanv · · Score: 5, Informative

    I have been using Courier for over two years now. No remote roots ever or problems of any kind (I am amazed!). It's open sourced and a full package (esmtp, pop, imap, webmail and a thousand other things). It gets my vote.

  7. Debian may switch by mcgroarty · · Score: 4, Informative
    Debian has been installing exim by default forever now. It's also remarkably easy to use and configure, and it's just as versatile as sendmail.

    There's been discussion about switching to postfix as the default for new installs however, and it may even be a done deal. A lot of arguments have been tossed about for this, however the biggie seems to be its simplicity: with something as complex as exim or sendmail, there are just more opportunities for something to go wrong. Postfix is quite enough for most users.

    1. Re:Debian may switch by HoserHead · · Score: 2, Informative

      If you've bothered to read any of that particular thread ("default MTA for sarge"), you'd have found that Postfix isn't actually very likely to be the default MTA for any Debian release any time soon. exim4 is simple and powerful, and what's more, it builds on the legacy of exim as the default mailer in Debian.

      There isn't really any compelling reason to switch away from exim, and that more than anything else is likely to leave exim as the default for years to come.

  8. Alternatives by rf0 · · Score: 2, Informative

    Postfix is cool and words but so does Exim, Qmail et al. Sendmail is a large code base that has devloped over many years but its secret is its ability to do alomst anything required. Of course its almost impenterable if you don't want to learn rule sets but you can just get the Orielly book which is only about 1000 pages long :)

    Rus

  9. Wait for the "backlash" by heironymouscoward · · Score: 2, Informative

    I'm expecting certain people to make much of this news, citing the "insecurity that comes with open source".

    All it demonstrates is that large complex pieces of software are inherently more difficult to secure than smaller simpler ones.

    Sendmail is great but we switched to another MTA about four years ago, also because Sendmail had exploits.

    --
    Ceci n'est pas une signature
  10. Popular open-source packages with security holes by shoppa · · Score: 4, Informative
    Citing a long history of security holes and patches is one way of justifying going with a less-populare but maybe more secure package. Right off the top of my head are these long-standing open-source packages with long histories of security holes:
    • wu-ftpd. Most recently known for the crack of alpha.gnu.org.
    • sendmail. "Not having sendmail is like not having VD", according to popular wisdom
    • vixie-cron. I don't even know of a "virgin" distribution of this, which is probably a good thing; all the Linux vendors have their own set of extensive patches to vixie-cron.
    There are multiple choices for replacing each of these, most of them a written-from-scratch replacement. Not all of these are perfect, either, but at least they're less popular, so (hopefully?) less likely to get hacked.

    I personally run fcron, postfix, and proftpd instead of the more popular packages. I don't honestly claim that they're any more secure, in all cases they were mostly personal choices having to do with cleanness/installation ease.

  11. Re:Qmail just works by InsaneGeek · · Score: 5, Informative

    What you talking about Willis?

    Sendmail & Postfix support virtual domains with no problems.

    Postfix: http://www.postfix.org/faq.html#virtual_domains

    Sendmail you can do it extremely easily with the virtualusertable (and I have for years and years)

  12. Re:What's wrong with sendmail? by UnclPedro · · Score: 2, Informative
    Heck, if sendmail were so insecure, why is OpenBSD still including it in it's base?
    Because it's the only major MTA with a license that's acceptable to Theo.
  13. Re:What's wrong with sendmail? by CoolVibe · · Score: 2, Informative
    Yeah, but OpenBSD is including an ancient version that they spent tons of time audding.

    False:

    220 xxxxxxxxxxxx ESMTP Sendmail 8.12.9/8.12.9; Mon, 25 Aug 2003 15:30:11 +0200 (CEST)

    Well well well, ancient huh? Whatever. Yes, that's openbsd's default sendmail as of version 3.3

  14. Re:Stupid question... by Basje · · Score: 5, Informative

    No it doesn't. Debian has Exim as it's default MTA.

    --
    the pun is mightier than the sword
  15. Re:Milters? by Anonymous Coward · · Score: 5, Informative

    content_filter is the equivalent of Milter for Postfix.

    This is quite powerful. For example, you can have some regular expression (around header or body), that sent to the content_filter.

    If you want to switch and have milter in mind, please consult the documentation about content_filter...

  16. Not Debian by autechre · · Score: 4, Informative

    I think they switched which MTA was installed by default between Potato and Woody, but neither one was Sendmail. And of course, they have you configure it when it's installed, and you can just tell it to not run the daemon and deliver local mail only (so you still get important stuff sent to root).

    I've used Postfix, and like it very much. Currently, the email server for which I'm responsible runs Sendmail, because I haven't had time to figure out how to port the virtusertable over to Postfix.

    As for hackstraw's comment, Debian makes it easy because packages depend on "an MTA", and all of the MTAs conflict, so you just use APT to install your MTA of choice, and it replaces the existing one.

    --
    WMBC freeform/independent online radio.
  17. Postfix virus filter by hey · · Score: 3, Informative
    I love postfix. A while ago I added a filter to
    stop executable (ie virus) content. And nobody
    in my company got the recent SoBig virus. Here's the line:

    /(filename|name)=".*\.(asd|chm|dll|com|exe|hlp|hta |js|ocx|pif|lnk)"/i REJECT Executable content not allowed

    1. Re:Postfix virus filter by hey · · Score: 2, Informative
      Ooops, you are right. I have another line that catches other extensions (I just forgot to post it here). My second line:

      /(filename|name)=".*\.(scr|shb|shs|vb|vbe|vbs|wsf| wsh)"/i REJECT Executable content now allowed - you can place it in a zip

      Other example scripts can be fond on the left-bottom of
      here


      I prefer to keep it simple. Ie not filtered for spam strings, etc. Just stuff catching content that is very very obviously bad.

    2. Re:Postfix virus filter by cloudmaster · · Score: 4, Informative

      Even more fun than than that (in newer versions o' postfix) is this one:



      /^Content-(Type|Disposition):.*(file)?name=.*\.(as d|bat|chm|cmd|dll|exe|hlp|hta|jse|lnk|ocx|pif|scr| shb|shm|shs|vb|vbe|vbs|vbx|vxd|wsf|wsh)/ REJECT Sorry, we do not accept .${3} file types.



      Mostly I like that because you include the actual extension in the return message and it allows the string "file=blah.exe" in headers other than those two that might cause a problem



      Note that I left .com out of the list because that one also catches messages with URLs attached (like, http://domain.com/). Since we mail URLs a lot where I work, that's not so good to block.

  18. Re:What's wrong with sendmail? by macdaddy · · Score: 4, Informative
    If you coded a sendmail.cf from scratch then you are a damned fool. There's no other way to put it. YOU DO NOT CODE THE CF BY HAND. YOU DO NOT EVEN TOUCH THE CF! The Sendmail gurus have been saying this for years and there is NO excuse for not heeding their warnings. You use the M4 macros to build your CF. There is rarely, and I do mean rarely, any reason to directly edit the cf. You can do everything you need to do in the M4 macro file. Even the Sendmail gurus themselves don't touch the CF.

    This is something that really pisses me off. People bitch and moan about Sendmail being so hard to configure when really they haven't done the tiniest bit of research or RTFM. If they had they would have known not to edit the CF. "Don't touch the CF" is the most common answer on comp.mail.sendmail. Yet these novices still feel knowledgeable enough to make claims about how hard it is to configure Sendmail. I swear the quality of sysadm nowadays is somewhere in the crapper. I've been using Sendmail since 8.8.7. I have never had an unusual configuration I couldn't quickly create with a minimal amount of online research. It's not rocket science folks.

  19. Re:Its look like Qmail Vs Postfix war by A.+Lynch · · Score: 2, Informative

    We handle about 14 million incoming messages per day, across 8 qmail-ldap hosts, in a clustered environment. And we use SpamAssassin for mail filtering, as well.

    Those 8 hosts (which are quite modest IBM x335 servers) carry almost no load, and their queues are quite small (about 20,000msgs per host, mostly junk waiting to bounce).

    The biggest performace increase we saw was when we switched from magnetic disks to Solid State (RAM) disks for the queue drives.

  20. Re:Don't forget BIND. by shoppa · · Score: 3, Informative

    It turns out that the wu-ftpd report for the crack of alpha.gnu.org on slashdot was in fact wrong, and in fact alpha.gnu.org wasn't even running wuftpd. It was "just" the linux kernel ptrace vulnerability and a local user.

  21. Re:Milters? by cloudmaster · · Score: 5, Informative

    Yes, postfix has mail filters. They're just not *called* "milters", and they're readable by people who don't have M4 parsers built into their reading glasses. Grumble grumble crummy sendmail configuration grumble.

    In fact, most of the things you can do with sendmail through external additions are already in postfix. I'm pretty sure that Postfix is also overall "faster" than Sendmail, and it upgrades easier, and the config system is useful, etc...

  22. Re:not only qmail but courier mail as well. by Feyr · · Score: 2, Informative

    better get your facts straights

    www.courier-mta.org

    full blown email server: MTA, filtering, pop3, imap and webmail, all neatly packaged (and written) by the great Sam. works like a charm too

  23. Big Lose by Anonymous Coward · · Score: 2, Informative

    While it has been years since I have done sendmail, I remember it as being that I lost 2 things.
    1) being cracked almost as easily as an XP box (it was 6 years ago), so it required constant update.
    2) certain config tools work on sendmail only (but there are much better replacements in postfix and other mtas).
    3) the speed and scalability. To this day, sendmail is the better choice for extreme loads, say 5000 users on up.
    Postfix is a great choice for home all the way up to small-large businesses. I did not lose any capabilities (in fact gained some new ones).

  24. Postfix+IMAP/POP+Webmin+Usermin=great system by f1ipf10p · · Score: 2, Informative

    I presently use this combination for many customers, and will continue to do so.

    Postfix is much easier to deal with than sendmail. The configuration file "main.cf" is long but well documented, and it is often the only file you need to muck with.

    Add Webmin and you can leave the system in the hands of a local admin without much training.

    Add Usermin and basic webmail is painless.

    Try it, you might like it.

    --
    ~8^]
  25. Re:This is all just FUD by wwest4 · · Score: 3, Informative

    Actually, it hasn't been that long. The latest security problems in sendmail were found in March.

    Sendmail isn't awful - but some of its code is old, it's complicated, and it's richly-featured. All of these things contribute to an increased risk of bugs and vulnerabilities. In those respects, it's similar to some of those products by "that corporation," except that sendmail issues timely patches and the current developers, at least, care about security from the outset versus considering it as an afterthought.

  26. The truth, instead of libel against sendmail.... by Anonymous Coward · · Score: 1, Informative

    /.

    Postfix is great. We all know that, hell, Wietse wrote it and he wrote TCP wrappers for linux.

    Postfix has had security holes. They were fixed.

    Sendmail can gruesomely difficult to configure because it can do ANYTHING. Most people do not need the raw power of sendmail. However, those that do can spring $100 for the sendmail GUI and it becomes butt-simple to configure. (Please don't bother with the jokes about Marshal's butt).

    Sendmail has had security holes. They were fixed. In fact, Sendmail has had more bugs fixed than any other mailer, so we could be just as illogical as the original post and say it is obviously is the most secure mailer.

    Qmail's brilliant but difficult creator, Dr. Bernstein, has posted a reward for finding security holes in Qmail. According to rumor, he has refrained from paying that reward by the simple expedient of not accepting any allegations of security holes. I am not qualified to judge the truth of the rumors as I have not studied the code. I prefer the license terms of Sendmail and Postfix (Qmail comes with source code, but is not Open Sourced).

    The slashdot denigration of sendmail for security problems is undeserved. Acknowledging and fixing security holes should not be a subject for ridicule, it ought to be admired! Sendmail is ancient, proven, mature, pick your favorite word.

    Postfix is excellent. It stands on its own merits and doesn't have to take swipes at sendmail.

    If you want to diss sendmail, you should be dissing the monolithic design and dependency on *nix (since the *nix security model SUCKS - suid root is an atrocity).

    Having a long record of bug fixes simply means the code has been thoroughly scrutinized and tested under fire!

    --Charlie

  27. Re:.. in scripts? by cloudmaster · · Score: 4, Informative

    postfix is sommand-line compatible with sendmail, even going so far as to include a binary named "sendmail" for just that reason. I've got several CGIs that use that, just because they're no important enough for me to rewrite them.

    I can't comment on other MTAs in that regard.

  28. Re:Stupid question... by johnnyb · · Score: 2, Informative

    Red Hat has "alternatives" set up, which make it real easy to switch MTAs. For RH8, I only have to do the following:

    alternatives --set mta /usr/sbin/sendmail.postfix

    service sendmail stop

    chkconfig sendmail off

    service postfix start

    chkconfig postfix on

    And you now run Postfix!

  29. Re:Stupid question... by Basje · · Score: 3, Informative

    Yes, I prefer postfix myself.

    The only thing missing with postfix is native authenticated smtp. One needs to authenticate through sasl to use it, and I don't trust sasl. I'm not implying that sasl is an insecure product by virtue of bugs, but there are too many variables to make me confident that I can configure and deploy it securely.

    --
    the pun is mightier than the sword
  30. a good comparison of all the major mailers by stinkfoot · · Score: 3, Informative
    http://www.mailsoftware.cjb.net/

    "major" being: courier, sendmail, postfix, exim and qmail.

    it looks like it's about a year old, and has some missing information, but it's a place to start for anyone looking to switch MTAs.

  31. The article didn't mention the best feature by Eric+Smith · · Score: 4, Informative
    If you need to run a backup MX for a lot of domains, you don't have to configure them all manually. You can just tell Postfix that it's allowed to backup domains that have MXes on specific networks. For instance, my Postfix main.cf includes:

    smtpd_recipient_restrictions = permit_mynetworks, permit_mx_backup, reject
    permit_mx_backup_networks = 64.15.260.112/27, 282.66.92.0/22, 67.91.305.33/32

    (specific addresses changed to protect the innocent, and yes, I know that a byte can't exceed 255, that was deliberate)

    This tells Postfix to accept mail for any domain that has an MX in one of the specified networks. So whenever I add a new domain to one of my primary MX servers, I don't have to change the configuration on my backup MX servers at all.