xref: /freebsd/contrib/sendmail/mail.local/README (revision ee7b0571c2c18bdec848ed2044223cc88db29bd8)
1c2aa98e2SPeter WemmThis directory contains the source files for mail.local.
2c2aa98e2SPeter Wemm
3c2aa98e2SPeter WemmThis is not intended to be used on *stock* System V derived systems such as
4c2aa98e2SPeter WemmSolaris or HP-UX, since they use a totally different approach to mailboxes
540266059SGregory Neil Shapiro(essentially, they have a set-group-ID program rather than set-user-ID, and
640266059SGregory Neil Shapirothey rely on the ability to "give away" files to do their work).
7c2aa98e2SPeter Wemm
8c2aa98e2SPeter WemmIf you choose to run *this* mail.local on these systems then you may also
9c2aa98e2SPeter Wemmneed to replace the existing MUAs, as well as IMAP and POP servers, with
10c2aa98e2SPeter Wemmones that are compatible with the BSD interface.  You have been warned!
1106f25ae9SGregory Neil Shapiro
1206f25ae9SGregory Neil ShapiroFor systems with maillock() support, compile with -DMAILLOCK and link with
1306f25ae9SGregory Neil Shapiro-lmail to use the maillock() routines.  This can be accomplished in your
1406f25ae9SGregory Neil Shapirosite.config.m4 file with:
1506f25ae9SGregory Neil Shapiro
1606f25ae9SGregory Neil Shapiro	APPENDDEF(`conf_mail_local_ENVDEF', `-DMAILLOCK')
1706f25ae9SGregory Neil Shapiro	APPENDDEF(`conf_mail_local_LIBS', `-lmail')
1806f25ae9SGregory Neil Shapiro
1906f25ae9SGregory Neil ShapiroDefining CONTENTLENGTH (-DCONTENTLENGTH) will build a mail.local which
2006f25ae9SGregory Neil Shapirooutputs a Content-Length: header.  Solaris 2.3 and later will automatically
2106f25ae9SGregory Neil Shapiroinclude Content-Length: support.  This can be accomplished in your
2206f25ae9SGregory Neil Shapirosite.config.m4 file with:
2306f25ae9SGregory Neil Shapiro
2406f25ae9SGregory Neil Shapiro	APPENDDEF(`conf_mail_local_ENVDEF', `-DCONTENTLENGTH')
2506f25ae9SGregory Neil Shapiro
2606f25ae9SGregory Neil ShapiroDefining MAILGID to a 'gid' (-DMAILGID=6) will cause mailboxes to be
2706f25ae9SGregory Neil Shapirowritten group writable and with group 'gid'.  This can be accomplished in
2806f25ae9SGregory Neil Shapiroyour site.config.m4 file with:
2906f25ae9SGregory Neil Shapiro
3006f25ae9SGregory Neil Shapiro	APPENDDEF(`conf_mail_local_ENVDEF', `-DMAILGID=6')
3106f25ae9SGregory Neil Shapiro
3240266059SGregory Neil Shapiromail.local will not be installed set-user-ID root. To use it as local
3306f25ae9SGregory Neil Shapirodelivery agent without LMTP mode, use:
3406f25ae9SGregory Neil Shapiro
3506f25ae9SGregory Neil Shapiro	 MODIFY_MAILER_FLAGS(`LOCAL', `+S')
3606f25ae9SGregory Neil Shapiro
3706f25ae9SGregory Neil Shapiroin the .mc file.
3806f25ae9SGregory Neil Shapiro
39e92d3f3fSGregory Neil ShapiroDefining HASHSPOOL (-DHASHSPOOL) will build a mail.local which supports
40e92d3f3fSGregory Neil Shapirodelivering to subdirectories of the mail spool, based on a hash of the
41e92d3f3fSGregory Neil Shapirousername (i.e., a hash depth of 2 and a username of "user" will result in
42e92d3f3fSGregory Neil Shapiro/var/spool/mail/u/s/user).  If the hash depth is greater than the length
43e92d3f3fSGregory Neil Shapiroof the username, "_" will be used.  The necessary subdirectories must
44e92d3f3fSGregory Neil Shapiroexist; mail.local will not create them.  Use the "-H" option to set the
45e92d3f3fSGregory Neil Shapirohash type and depth (like "-H u2" for a username hash two levels deep).
46e92d3f3fSGregory Neil Shapiro
47e92d3f3fSGregory Neil ShapiroThe HASHSPOOL option also adds two other options: "-p path" to specify
48e92d3f3fSGregory Neil Shapiroan alternate mail spool path (i.e., "-p /local/mail") and "-n" to specify
49e92d3f3fSGregory Neil Shapirothat mail.local should not strip the @domain part of recipient addresses
50e92d3f3fSGregory Neil Shapiroin LMTP mode.
51e92d3f3fSGregory Neil Shapiro
52e92d3f3fSGregory Neil ShapiroIn addition to HASHSPOOL, defining HASHSPOOLMD5 and linking against
53e92d3f3fSGregory Neil Shapirolibcrypto from OpenSSL like:
54e92d3f3fSGregory Neil Shapiro
55e92d3f3fSGregory Neil Shapiro	APPENDDEF(`conf_mail_local_ENVDEF', `-DHASHSPOOL -DHASHSPOOLMD5')
56e92d3f3fSGregory Neil Shapiro	APPENDDEF(`conf_mail_local_LIBS', `-lcrypto')
57e92d3f3fSGregory Neil Shapiro
58e92d3f3fSGregory Neil Shapirowill offer an alternate hash, using a base64 encoding (changing / to _)
59e92d3f3fSGregory Neil Shapiroof an MD5 hash of the username.  This results in a more balanced
60e92d3f3fSGregory Neil Shapirosubdirectory tree.  The subdirectories will be named with A-Z, a-z, 0-9,
61e92d3f3fSGregory Neil Shapiro+, and _.  The hash type is "m", so use "-H m3" to get a three level MD5
62e92d3f3fSGregory Neil Shapirobased hash.
63e92d3f3fSGregory Neil Shapiro
64*4313cc83SGregory Neil Shapiro$Revision: 8.11 $, Last updated $Date: 2003-10-20 20:19:13 $
65