I recently ran into problems with postfix running inside of a FreeBSD jail. It would constantly report "file too large" errors, and other errors in that vein. Since there appears to be no documentation for FreeBSD "newbies" on fixing this problem, it seems like most people default back to sendmail or exim, rather than using the excellent Postfix MTA on their virtual file systems.
I love postfix, so that is a situation I'd like to change! Here are the directions on how to get postfix working inside a FreeBSD "jail" system.
Well, the basic problem with Postfix in a FreeBSD 4.8 jail is the disconnect in the setrlimit() call in Postfix versus the kernel. You end up with spurious "file too large" errors when sending and receiving messages, which just sucks.
There's a patch at http://www.kozubik.com/published/misc/postfix_patch_fbsd45jail
Here's how I do this without using the above patch:
IMPORTANT NOTE: A generous reader left a clarification in a comment below this entry that may be more useful for you. My procedure works fine because you're running "make clean" inside the postfix work directory -- using Postfix's built-in Makefile -- and thus not destroying the source file you're going to edit. However, running "make clean" from the /usr/ports/mail/postfix-current/ directory would blow away your work/ directory, nullifying the effort you're putting into patching :)
1. cd usr/ports/mail/postfix-current
2. Run "make" -- I normally just leave it alone and let Postfix go ahead and build itself. Not a big deal.
3. cd work/postfix-(version)/src/util
4. using your favorite text editor, open "file_limit.c", and go to the SECOND instance of this line:
struct rlimit rlim;
(This is the one followed by "rlim.rlim_cur = rlim.rlim_max = limit;" -- if you don't see that, you're at the wrong one)
5. Paste this line immediately after the "struct rlimit rlim" declaration, then save and exit:
limit = RLIM_INFINITY;
6. Now cd /usr/ports/mail/postfix-current/work/postfix-(version) again.
7. run "make clean"
8. run "make"
9. cd ../.. (or /usr/ports/mail/postfix-current)
10. If you've already installed postfix, then run "postfix stop" and "make deinstall". Otherwise, just run "make" and then "make install" and YOU ARE DONE!