Slashdot Mirror


Postfix

honestpuck writes "After many years bashing my head against sendmail in all it's gory details I had amassed a fair amount of knowledge and documentation on handling the Mail Transfer Agent (MTA) in Linux and Mac OS X. This caused a fair amount of teeth gnashing when I discovered it had gone the way of all flesh in OS X Panther to be replaced with Postfix." To un-gnash his teeth, honestpuck used Kyle D. Dent's Postfix: The Definitive Guide (published by O'Reilly); read on for his review of the book. Postfix: The Definitive Guide author Kyle D. Dent pages 260 publisher O'Reilly and Associates rating 8/10 - Excellent book, a little thin on details in a few places reviewer Tony Williams ISBN 0596002122 summary An excellent guide to installing, configuring and running Postfix

Fortunately, my first needs were simple and I came to realise that Postfix was a much easier system to install and maintain. Now that my needs are more complex, I was glad when this book hit my desk at exactly the same time as I started upgrading the corporate servers from Mac OS 9 to OS X Server.

Postfix: The Definitive Guide seems to fit the bill. It is a well-written and well-constructed guide to mail systems in general and Postfix in particular. (Oh, and speaking of definitive, could someone at O'Reilly provide a definitive answer to both reviewers and their own editors as to that colon? This is the second 'Definitive Guide' I've reviewed in as many months, and they are sprinkled with instances of each book's title, sometimes including that colon, sometimes leaving it out.)

The book starts with a good overview of the underlying technology in Chapters 1 and 2. I can't blame Dent for my slight confusion in the section on addresses and headers - having RFC822 superseded by RFC2822 was just a little too much coincidence for this particular "bear of little brain." He then follows it with a chapter discussing Postfix's architecture, important since Postfix uses a much more modular approach than the sendmail monolith, with each part of the mail handling process a different executable and the single queue turned into five.

Once the background is well covered, Dent then gets onto the nitty-gritty of configuring and administering Postfix. He has certainly covered everything I needed, including spam handling, multiple domains, relaying, SASL authentication and using LDAP. Once I'd finished grokking all that, and getting it integrated into my servers, I had a corporate email system up in three sites that replaced and improved upon a couple of thousand dollars worth of proprietary dreck. Happy is an understatement.

Dent's writing is sometimes a little patchy, though never bad. The technical detail does seem overpowering in places, though, and I occasionally found myself reading a section through more than once with a configuration file open in front of me. There are certainly spots where a little more hand holding and care with the writing would have been appreciated. (If you are a little more cognizant of the interstices of mail systems then you may not have the same problem.)

I did, however, appreciate the appendices enormously. The four appendices cover configuration parameters, Postfix commands, installation, and an FAQ. My system came with Postfix compiled and installed just as I required it so I didn't get a chance to thoroughly test out Dent's installation procedure (though it looks good); the other three continue to be useful.

If you want to have a look for yourself, then the usual O'Reilly page is complete with a table of contents and index, but this time no example chapter is provided (how come, O'Reilly?). You can also get an expanded version of the FAQ in Appendix 4 from Dent's website. A better example of Dent's writing style is an excellent article on troubleshooting with Postfix logs at O'Reilly's Onlamp.com.

This is an excellent book, Dent has explained the underlying methodology and use of Postfix well, taken the reader through all aspects of this MTA system and explained both the why and the how. I would recommend this book (and, as a result Postfix) to anyone looking for an MTA and a guide to configuring and running it.

You can purchase Postfix: The Definitive Guide from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

31 of 161 comments (clear)

  1. Postfix Enabler by momerath2003 · · Score: 5, Informative

    Mac OS X users can find a cool, donation-ware (read: non-crippleware) GUI for the buil-in postfix server, Postfix Enabler. It allows some advanced configuration of the postfix server.

    It has some handy instructions for setting up Mac OS X's Mail.app to interface with the Postfix server as well.

    --
    I had but a simple dream, to destroy all humans.
  2. Re:Postfix shortcomings by Anonymous Coward · · Score: 2, Informative

    Check out this article....

    http://techie.org/Projects/TNMailServer-Full.asp x

  3. Postfix doesn't require a book by hey · · Score: 3, Informative

    It has no impossible-to-understand langauge, the options have reasonable names, they do what they suggest... it just works.

  4. Re:Postfix shortcomings by boobsea · · Score: 5, Informative

    Didn't google very well did you?

    here you go:

    http://www.geekly.com/entries/archives/00000155.ht m

    Good luck.

  5. Re:Postfix shortcomings by kaisyain · · Score: 3, Informative

    master.cf:
    mailbox_command = /usr/bin/procmail -p

    main.cf:
    smtp inet n - n - - smtpd -o content_filter=spamfilter
    spamfilter unix - n n - - pipe flags=Rq user=spam argv=/usr/local/sbin/spamfilter.sh -f ${sender} -- ${recipient}

    Both of which are documented in files linked to from http://www.postfix.org/docs.html

  6. Re:Postfix shortcomings by Howard+Beale · · Score: 3, Informative

    I used this article as the basis for my smtp gateway and it works fairly well:

    http://lawmonkey.org/anti-spam.html

  7. Re:Postfix shortcomings by jtosburn · · Score: 4, Informative
    Postfix is both well documented, and well supported. From the well commented main.cf :
    # The mailbox_command parameter specifies the optional external
    # command to use instead of mailbox delivery.
    [some snipping]
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"

    So not enabled by default, but easily remedied if you absolutely MUST have procmail. You can also enable it on a per-user basis by leaving those lines commented, and then using a .forward file in your home directory that calls procmail.

    As for playing with spamassassin or other 3rd party programs, no problem. A quick check of the Documentation page at www.postfix.org reveals all kinds of good info. The consensus on postfix-users is to use amavisd-new, and then call antivirus and/or spam filters from there.

    Good luck!
  8. Re:beats the hell outta sendmail... by cayenne8 · · Score: 5, Informative

    Yup...was very new to setting up an email server. I found this thread very helpful for setting up a simple home email system. Also way down in the thread is help and links for using spamassasin and other heuristic spam filters...

    --
    Light travels faster than sound. This is why some people appear bright until you hear them speak.........
  9. Re:Postfix shortcomings by outcast36 · · Score: 3, Informative

    You can also use amavisd. In addition to running your mail through spamassassin, this approach also lets you throw a virus scanner into the mix.

    here's a link

  10. Re:Postfix shortcomings by Anonymous Coward · · Score: 1, Informative

    in master.cf:

    # add at beginning
    smtp inet n - n - - smtpd
    -o content_filter=filter:dummy

    # add at end
    filter unix - n n - - pipe
    flags=R user=filter argv=/usr/local/bin/postfix-filter.sh -f ${sender} -- ${recipient}

    #
    # filter shell looks somthing like:
    FILTER=yourfilter
    cat > inp.$$ $FILTER < inp.$$ > msg.$$
    exec $POSTFIX "$@" <

  11. This book is great... by Mysticalfruit · · Score: 4, Informative
    I recently bought it from BookPool.com and it was cheap!

    Disclaimer: My buddy works at bookpool (but their prices really are great!)

    I've been using this book to migrate our existing sendmail gobbilygook mailsystem to a sane well documented postfix system and I've found the book to be a great help as I've had to do a one to one comparision between sendmail and postfix for configuration stuff.

    Plus Dent's writing style is excellent and the book is well laid out.

    --
    Yes Francis, the world has gone crazy.
  12. Re:beats the hell outta sendmail... by pdp11e · · Score: 3, Informative

    I agree. There is a world of difference between the Postfix and Sendmail.
    Many years ago I was "vi /etc/whatever" kind of guy whenever a service needed to be configured or tweaked. As I've got older I've learned to appreciate good tools for the system administration. One of the best (IMHO) is the Webmin. It has an awesome Postfix configuration module and it takes 10 minutes to have (non-trivial) mail-server up and running. But even with the Webmin Sendmail is still a bitch to configure.

  13. Re:Thank Apple for by jeremyp · · Score: 4, Informative

    Darwin doesn't use the FreeBSD kernel. It has its own (open source) kernel based on Mach, so it has nothing to contribute back to the FreeBSD kernel.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  14. Re:Postfix? by ScottSpeaks! · · Score: 4, Informative

    It says "mod this up" in tree format. At every fork, process the left branch, then the right, then the node at the fork itself. When you reach a leaf, use that letter. Later, rinse, recurse.

  15. An explanation by jared_hanson · · Score: 4, Informative

    Performing post order tree traversal on this tree yeilds:

    modthisup

    For those of you too long out out CS class, just remember: left, right, root.

    --
    -- Fighting mediocrity one bad post at a time.
  16. Another Postfix book is coming soon by EvilStein · · Score: 4, Informative

    Richard Blum wrote one - it's now quite outdated.

    Ralf Hildebrandt & someone else (sorry, forgot who) are working on another very current Postfix book as well. Keep an eye on Amazon.com for it.

    I've also read the O'Reilly Postfix book and found it to contain a lot of information. It's nice to have around.

    1. Re:Another Postfix book is coming soon by ISPpfy · · Score: 4, Informative
      The Ralf Hildebrandt & Patrick Koetter book "The Book of Postfix" can be found on Amazon here:

      http://www.amazon.com/exec/obidos/ASIN/159327001 1/qid=1077836565/sr=2-3/ref=sr_2_3/002-8092152-647 2869


      It isn't out yet, however.

      It's published by "No Starch Press," which must have some relationship with O'Reilly since it was in their latest catalog as well.
    2. Re:Another Postfix book is coming soon by Shaleh · · Score: 2, Informative

      O'Reilly recently started acting as their distributor. No Starch handles the actual content.

  17. Re:beats the hell outta sendmail... by wohlford · · Score: 5, Informative

    I'm a real big fan of Security Sage's postfix configuration. The cover pretty much everything interesting regarding Postfix except LDAP. Jason

    --
    Jason Wohlford
  18. Re:Thank Apple for by Anonymous Coward · · Score: 2, Informative
    Of note:

    http://netbsd.org/gallery/products.html#darwin

    ``NetBSD is used by Apple for a large portion of the user-space commands and tools in their Darwin project, and Darwin is the UNIX-based core used by MacOS X. NetBSD source tends to pay attention to issues of portability and correctness, and is virtually all BSD licenced, which avoids commercial problems with the GNU General Public Licence. At least one of the Apple developers has access to the NetBSD source tree and has fed back some useful changes.''


    FreeBSD or NetBSD is more than the kernel alone. Contributing to either doesn't have to be in the form of changes to /usr/src/sys. It could just be to /usr/src. :D

    Now "some useful changes" might be a man page type correction... I don't know. You're welcome to scan Net's cvsweb.
  19. Yet another convert. here... by Anonymous Coward · · Score: 3, Informative

    I ran sendmail for nearly a decade at various jobs and on various systems. I switched to Postfix a few months ago after trying out SuSE 8.1 Linux (love it, btw) and I'm hooked! I now run Postfix as an Internet-to-interior "smtp firewall" between the Internet and my internal Lotus Domino servers, and the pcre body_checks filters that became available in the first couple days of the MyDoom virus storm proved to be invaluable in keeping about a thousand viruses per hour from being relayed thru my SuSE Linux/Postfix "smtp firewall" and hammering away at the Trend Scanmail antivirus on my Domino server.

  20. editting sendmail.cf by MrChuck · · Score: 5, Informative
    I've made a LOT of money taking people's old sendmail configs and turning them into managable m4s. Esp when 4-5 system admins have passed through and just made "a little tweak."

    Postfix seems ok, I'd recommend it for folks setting up straightforward machines who didn't know sendmail

    But people whine that "sendmail is too complex" and at the same time they WANT complex things to happen.

    I had a guy come up to me at an event and shout:
    Guy: Sendmail is too hard.
    ok
    Guy: and is there any way to make it only send large (> 1MB) messages out after 7PM when my ISDN rates are lower?
    sure. 5 lines in your m4 file.

    Sendmail.cf is a binary. It is intended to be read and parsed quickly by a binary. Sendmail still runs on 4MB Sun 3 machines. You don't edit /bin/ls to effect a change there, you edit "ls.c".
    Similarly, you edit the .mc file to effect a change in the .cf.

    More, when sendmail changes major revisions (eg. you fianlly move from Sendmail 8.8 to 8.12), you regen your .cf and, barring some minor changes to remove defunct features or take advantage of new ones, you have a new working .cf file. You can't just move a 8.8 cf file to an 8.12 machine and expect it to work well and use new features.

    Having worked on HUNDREDS or THOUSANDS of config files (one set went onto 10,000 machines at a site), there's NOTHING you can do in the .cf that can't be done in the .mc.

    That said, the rule language is painfully ... complex? No, just the opposite. It's painfully simple. My experience with 6502 assm and a BASIC that had neither ELSE nor AND/OR options helped to make me really good at writing sendmail rules.

    Dealing with booleans (just to ruleset^Wsubroutine saving buffer, put time in buffer.
    Is message less than 1MB? then return
    is time after 1900 hrs? Yes? return dsmtp.
    Is time < 700 hrs? Yes? return dsmtp.
    Otherwise just return.
    In calling routine, look for return value and if it's dsmtp, put the saved buffer to the dsmtp mailer. Otherwise continue with the saved buffer.

    Hard? No, not really.

    Painful? You betcha. I'd love to have variables and ANDs and ELSEs. I've taken to putting complex logic in a perl milter at the RCPT TO phase and calling it a day.

    sub choosemailer {
    if ((($time > 1900) || ($time < 700)) && $size > 1MB) THEN $mailer=dsmtp
    }

    But the rulesets are just read by a parser. It's not rocket science (just computer science).

    It would be nice to have (perl) regex's and such built in.

    And that's where Postfix starts to have an advantage. I can live without UUCP for that. I'd just hope that new sendmail versions might rethink the whole language for processing mail. It's good to have competition. (qmail2 also looks promising to raise the envelope).

    But lets just recall that's its not about Sendmail vs postfix vs exim vs qmail.

    It's any of these VS Exchange/Notes/Gropewise. And we're losing.

    1. Re:editting sendmail.cf by Anonymous Coward · · Score: 2, Informative

      It would be nice to have (perl) regex's and such built in.

      Postfix supports PCRE (perl-compatible regular expression) and plain regexps

      And that's where Postfix starts to have an advantage. I can live without UUCP for that.

      Postfix supports UUCP

  21. Postfix for speed by hanksdc · · Score: 4, Informative

    While a lot of the comments here (at least those +3 and above) mention Postfix's ease of management vs. that of Sendmail, one point that hasn't received a lot of attention is how the two compare in terms of efficiency. My experience with Sendmail in a high-load environment tells me it's a monolithic, bloated, resource pig. But that was when I was still somewhat new to the admin game, so I'm sure with some expertise it can be tuned.

    Postfix, on the other hand, 'out of the box' was wonderful, (not to mention easy to use) and when I learned to tune things like filesystem parameters, optimal disk subsystem layout, and such it only got better. Our Postfix installation where I work continues to amaze me with how much mail it processes each day, with little or no maintenance, even under heavy load (1M+ incoming messages/day between 5 dual-CPU, 2-disk SCSI PIII-class machines). My gut feeling is that with some beefier boxes, and a pile of disks I could get that down to 2 machines handling the same amount of traffic.

    Another plus for Postfix is its flexibility, and, if you need to get so deep, its hackability. The code is extremely clean, modular, and easy to work with.

  22. Re:beats the hell outta sendmail... by adamruck · · Score: 2, Informative

    If you wanna spend a couple of bucks, try cpanel. Its webmin on steriods.

    --
    Selling software wont make you money, selling a service will.
  23. Re:*sigh* Humor impaired? by honestpuck · · Score: 3, Informative

    I agree, the original comment about why I had the time to review all those books *was* funny.

    The comment I was replying to was the one accusing me of being a "paid shill".

    Tony

  24. Re:PostFix + MYSQL + Cyrus Rocks!!! by jallen02 · · Score: 2, Informative

    One better... :)

    I had also known Sendmail was a little tedious to learn. My main job is software development, but we are a small company so I multi task as system admin for about 10 systems, mostly Linux with a couple of internal windows systems.

    None of the email systems are REAL painful to get working, even Sendmail. I can learn and understand these types of things easily with the years of experience I have. The thing is in a small company I have to squeeze every minute I can out of a day because my time means a lot. If I can spend half the time learning the ins and outs of a particular server app I am doing a good thing. So when I had to set up our first non shared systems in a data hosting facility I was very happy.

    I decided QMail had enough of a popular following and a reasonable enough featureset and great security track record that we could live with QMail. So I installed QMail, read books, tweaked and eventually installed. Got everything working: SMTP+POP3 with selective relaying based on who had just popped. Worked great. Then it came time to set QMail up on a different server as we were shuffling services around to free up the server we currently used for mail. I was not looking forward to doing QMail again. I didn't like managing it the way we had it set up and didn't really feel I had the time to mess around with it, so I looked for alternatives.

    I found Postfix. I downloaded it, compiled it, installed it and read through all of the configs and docs.Within an hour I was so amazed at the simplicity of Postfix and how much sense the configs made, I was in shock. Then I read a little more and searched around and found how easy IMAP was to get working as well. I then found an IMAP server that supported MySQL and found that Postfix also supported MySQL for domains/user configurations. That is all it took for me to be completely sold. I would have preferred more options for the RDBMS, but I wasn't going to complain much.. MySQL isn't to resource hungry. Performance wasn't a concern as I only needed mail for a pretty small group of people. As it is this setup is very READ heavy with the data being almost static (just needing a nice easy programmatic way to be updated when required) so it plays nicely into MySQLs performance forte.

    In one day of configuration and code writing I had Postfix doing all of our SMTP, Courier IMAP (which includes POP3) all on the same backend. I had web mail setup and working. All of our mail storage was now centralized which only makes it easier given some of us travel around a lot and still need our mail.The best part, I wrote a web based management tool to manage domains, accounts, and aliases for our mail system. No more unix command line, log onto the application fill in a form or two and its done. Setup a new domain for email? Fill in a few forms and voila it's all done. I think it was one of the most pleasant experiences setting up a network service I administer I have ever had. (I realize that I am a programmer and not everyone will have the knowledge to hammer out a management tool in a small timeframe like that, but for us it simply works).

    Thats my story for Postfix!

    (P.S. we just have our system send a welcome email and the Maildir folders automaticaly get created after the first incoming message. Postfix handles this for you. :) )

    Jeremy

  25. Qmail author doesn't have nice things to say about by Anonymous Coward · · Score: 1, Informative

    ...Postfix.

    http://cr.yp.to/maildisasters/postfix.html

    http://cr.yp.to/qmail/venema.html

    And after reading and realizing how some of the fundamental issues with Postfix were neither acknowledged nor understood by the author of Postfix (at first), I'm not sure if I really trust its security.

    I have nothing against Mr Venema, infact, I've used TCP Wrapper for a long time now.

    On the subject of Sendmail vs. the world, I think after 7 yrs of using Sendmail I feel quite comfortable with it. One thing I wish Sendmail was better at was the use of resources like Postfix and specially qmail.

    I keep thinking about making the switch to qmail or postfix but I can never find the time to learn any new stuff these days. I would have to learn it well too so I can do all the things I currently can with Sendmail e.g. virtual hosting, mailing lists, RBLs, SpamAssasin interface via .forward etc etc).

    My current mail server setup is:

    smptd (www.obtuse.com, small, fast, secure) for the front end (listening on port 25) which uses sendmail for the delivery, which in turn uses procmail (via .forward) to forward to SpamAssassin and finally deliver mail to the user.

  26. postfix by oohp · · Score: 2, Informative

    Postfix is very good and not crippled by stupid DJB style "licenses" like qmail. I'm using in on all my boxes (FreeBSD, Linux) and one of them delivers large amounts of mail. Very fast delivery, supports all kinds of stuff (maildirs, MySQL, LDAP, delivery to Cyrus, etc.) has some builtin unsolicited bulk email controls and some resource controls and it doesn't require 1e13 users on the system like qmail does. I'm surprised people still use Sendmail (and argue that it's somehow "better"). Very cool piece of software. I'd like to thank Wietse Venema and IBM for it.

    Some would argue about the license (especially BSD people who also argue about GPL being not liberal enough) but it's OSI approved so most arguments are vapour.

  27. Anti-SPAM Postfix, Amavisd-new, SpamAssassin by frankie_guasch · · Score: 2, Informative

    here is a fine guide to build a Fairly-Secure Anti-SPAM Gateway Using OpenBSD, Postfix, Amavisd-new, SpamAssassin, Razor and DCC.

    You can follow the steps and build it with Linux too. This entire procedure has been developed with security as a primary focus. These are the main tools it shows:

  28. Re:Postfix Enabler -- solution for free by davids-world.com · · Score: 3, Informative

    Mac OS X users could alternatively safe the money and read a description of how to enable postfix on OS X for free in ten minutes. In Panther, it's just one or two lines in configuration files, essentially. If you want SASL authentication and other things, the nicely-designed GUI of Postfix Enabler is probably worth a few bucks!