INSTALL.html 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  1. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Postfix Installation From Source Code </title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
  7. </head>
  8. <body>
  9. <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix
  10. Installation From Source Code </h1>
  11. <hr>
  12. <h2> <a name="1">1 - Purpose of this document</a> </h2>
  13. <p> If you are using a pre-compiled version of Postfix, you should
  14. start with <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> and the general documentation
  15. referenced by it. <a href="INSTALL.html">INSTALL</a> is only a bootstrap document to get
  16. Postfix up and running from scratch with the minimal number of
  17. steps; it should not be considered part of the general documentation.
  18. </p>
  19. <p> This document describes how to build, install and configure a
  20. Postfix system so that it can do one of the following: </p>
  21. <ul>
  22. <li> Send mail only, without changing an existing Sendmail
  23. installation.
  24. <li> Send and receive mail via a virtual host interface, still
  25. without any change to an existing Sendmail installation.
  26. <li> Run Postfix instead of Sendmail.
  27. </ul>
  28. <p> Topics covered in this document: </p>
  29. <ol>
  30. <li> <a href="#1">Purpose of this document</a>
  31. <li> <a href="#2">Typographical conventions</a>
  32. <li> <a href="#3">Documentation</a>
  33. <li> <a href="#4">Building on a supported system</a>
  34. <li> <a href="#5">Porting Postfix to an unsupported system</a>
  35. <li> <a href="#install">Installing the software after successful
  36. compilation </a>
  37. <li> <a href="#send_only">Configuring Postfix to send mail
  38. only </a>
  39. <li> <a href="#send_receive">Configuring Postfix to send and
  40. receive mail via virtual interface </a>
  41. <li> <a href="#replace">Running Postfix instead of Sendmail</a>
  42. <li> <a href="#mandatory">Mandatory configuration file edits</a>
  43. <li> <a href="#hamlet">To chroot or not to chroot</a>
  44. <li> <a href="#care">Care and feeding of the Postfix system</a>
  45. </ol>
  46. <h2> <a name="2">2 - Typographical conventions</a> </h2>
  47. <p> In the instructions below, a command written as </p>
  48. <blockquote>
  49. <pre>
  50. # command
  51. </pre>
  52. </blockquote>
  53. <p> should be executed as the superuser. </p>
  54. <p> A command written as </p>
  55. <blockquote>
  56. <pre>
  57. $ command
  58. </pre>
  59. </blockquote>
  60. <p> should be executed as an unprivileged user. </p>
  61. <h2> <a name="3">3 - Documentation</a> </h2>
  62. <p> Documentation is available as README files (start with the file
  63. README_FILES/AAAREADME), as HTML web pages (point your browser to
  64. "html/index.html") and as UNIX-style manual pages. </p>
  65. <p> You should view the README files with a pager such as more(1)
  66. or less(1), because the files use backspace characters in order to
  67. produce <b>bold</b> font. To print a README file without backspace
  68. characters, use the col(1) command. For example: </p>
  69. <blockquote>
  70. <pre>
  71. $ col -bx &lt;file | lpr
  72. </pre>
  73. </blockquote>
  74. <p> In order to view the manual pages before installing Postfix,
  75. point your MANPATH environment variable to the "man" subdirectory;
  76. be sure to use an absolute path. </p>
  77. <blockquote>
  78. <pre>
  79. $ export MANPATH; MANPATH="`pwd`/man:$MANPATH"
  80. $ setenv MANPATH "`pwd`/man:$MANPATH"
  81. </pre>
  82. </blockquote>
  83. <p> Of particular interest is the <a href="postconf.5.html">postconf(5)</a> manual page that
  84. lists all the 500+ configuration parameters. The HTML version of
  85. this text makes it easy to navigate around. </p>
  86. <p> All Postfix source files have their own built-in manual page.
  87. Tools to extract those embedded manual pages are available in the
  88. mantools directory. </p>
  89. <h2> <a name="4">4 - Building on a supported system</a> </h2>
  90. <p> Postfix development happens on FreeBSD and MacOS X, with regular
  91. tests on Linux (Fedora, Ubuntu) and Solaris. Support for other
  92. systems relies on feedback from their users, and may not always be
  93. up-to-date. </p>
  94. <p> OpenBSD is partially supported. The libc resolver does not
  95. implement the documented "internal resolver options which are [...]
  96. set by changing fields in the _res structure" (documented in the
  97. OpenBSD 5.6 resolver(3) manpage). This results in too many DNS
  98. queries, and false positives for queries that should fail. </p>
  99. <!--
  100. <p> At some point in time, a version of Postfix was supported on: </p>
  101. <blockquote>
  102. <p>
  103. AIX 3.2.5, 4.1.x, 4.2.0, 4.3.x, 5.2 <br>
  104. BSD/OS 2.x, 3.x, 4.x <br>
  105. FreeBSD 2.x .. 9.x <br>
  106. HP-UX 9.x, 10.x, 11.x <br>
  107. IRIX 5.x, 6.x <br>
  108. Linux Debian 1.3.1 and later <br>
  109. Linux RedHat 3.x (January 2004) and later <br>
  110. Linux Slackware 3.x and later <br>
  111. Linux SuSE 5.x and later <br>
  112. Linux Ubuntu 4.10 and later<br>
  113. Mac OS X <br>
  114. NEXTSTEP 3.x <br>
  115. NetBSD 1.x and later <br>
  116. OPENSTEP 4.x <br>
  117. OSF1.V3 - OSF1.V5 (Digital UNIX) <br>
  118. Reliant UNIX 5.x <br>
  119. SunOS 4.1.4 (March 2007) <br>
  120. SunOS 5.4 - 5.10 (Solaris 2.4..10) <br>
  121. Ultrix 4.x (well, that was long ago) <br>
  122. </p>
  123. </blockquote>
  124. <p> or something closely resemblant. </p>
  125. -->
  126. <p> Overview of topics: </p>
  127. <ul>
  128. <li><a href="#build_first">4.1 - Getting started</a>
  129. <li><a href="#build_cc">4.2 - What compiler to use</a>
  130. <li><a href="#build_pie">4.3 - Building with Postfix position-independent
  131. executables (Postfix &ge; 3.0)</a>
  132. <li><a href="#build_dll">4.4 - Building with Postfix dynamically-linked
  133. libraries and database plugins (Postfix &ge; 3.0)</a>
  134. <li><a href="#build_opt">4.5 - Building with optional features</a>
  135. <li><a href="#build_over">4.6 - Overriding built-in parameter default
  136. settings</a>
  137. <li><a href="#build_other">4.7 - Overriding other compile-time
  138. features</a>
  139. <li><a href="#build_proc">4.8 - Support for thousands of processes</a>
  140. <li><a href="#build_final">4.9 - Compiling Postfix, at last</a>
  141. </ul>
  142. <h3><a name="build_first">4.1 - Getting started</a> </h3>
  143. <p> On Solaris, the "make" command and other development utilities
  144. are in /usr/ccs/bin, so you MUST have /usr/ccs/bin in your command
  145. search path. If these files do not exist, you need to install the
  146. development packages first. </p>
  147. <p> If you need to build Postfix for multiple architectures from a
  148. single source-code tree, use the "lndir" command to build a shadow
  149. tree with symbolic links to the source files. </p>
  150. <p> If at any time in the build process you get messages like: "make:
  151. don't know how to ..." you should be able to recover by running
  152. the following command from the Postfix top-level directory: </p>
  153. <blockquote>
  154. <pre>
  155. $ make -f Makefile.init makefiles
  156. </pre>
  157. </blockquote>
  158. <p> If you copied the Postfix source code after building it on another
  159. machine, it is a good idea to cd into the top-level directory and
  160. first do this:</p>
  161. <blockquote>
  162. <pre>
  163. $ make tidy
  164. </pre>
  165. </blockquote>
  166. <p> This will get rid of any system dependencies left over from
  167. compiling the software elsewhere. </p>
  168. <h3><a name="build_cc">4.2 - What compiler to use</a></h3>
  169. <p> To build with GCC, or with the native compiler if people told me
  170. that is better for your system, just cd into the top-level Postfix
  171. directory of the source tree and type: </p>
  172. <blockquote>
  173. <pre>
  174. $ make
  175. </pre>
  176. </blockquote>
  177. <p> To build with a non-default compiler, you need to specify the name
  178. of the compiler. Here are a few examples: </p>
  179. <blockquote>
  180. <pre>
  181. $ make makefiles CC=/opt/SUNWspro/bin/cc (Solaris)
  182. $ make
  183. $ make makefiles CC="/opt/ansic/bin/cc -Ae" (HP-UX)
  184. $ make
  185. $ make makefiles CC="purify cc"
  186. $ make
  187. </pre>
  188. </blockquote>
  189. <p> and so on. In some cases, optimization will be turned off
  190. automatically. </p>
  191. <h3><a name="build_pie">4.3 - Building with Postfix position-independent
  192. executables (Postfix &ge; 3.0)</a> </h3>
  193. <p> On some systems Postfix can be built with Position-Independent
  194. Executables. PIE is used by the ASLR exploit mitigation technique
  195. (ASLR = Address-Space Layout Randomization): </p>
  196. <blockquote>
  197. <pre>
  198. $ make makefiles pie=yes ...other arguments...
  199. </pre>
  200. </blockquote>
  201. <p> (Specify "make makefiles pie=no" to explicitly disable Postfix
  202. position-independent executable support). </p>
  203. <p> Postfix PIE support appears to work on Fedora Core 20, Ubuntu
  204. 14.04, FreeBSD 9 and 10, and NetBSD 6 (all with the default system
  205. compilers). </p>
  206. <p> Whether the "pie=yes" above has any effect depends on the
  207. compiler. Some compilers always produce PIE executables, and some
  208. may even complain that the Postfix build option is redundant. </p>
  209. <h3><a name="build_dll">4.4 - Building with Postfix dynamically-linked
  210. libraries and database plugins (Postfix &ge; 3.0)</a> </h3>
  211. <p> Postfix dynamically-linked library and database plugin support
  212. exists for recent versions of Linux, FreeBSD and MacOS X.
  213. Dynamically-linked library builds may become the default at some
  214. point in the future. </p>
  215. <p> Overview of topics: </p>
  216. <ul>
  217. <li><a href="#shared_enable">4.4.1 Turning on Postfix dynamically-linked
  218. library support</a>
  219. <li><a href="#dynamicmaps_enable">4.4.2 Turning on Postfix database-plugin
  220. support</a>
  221. <li><a href="#shared_custom">4.4.3 Customizing Postfix dynamically-linked
  222. libraries and database plugins</a>
  223. <li><a href="#shared_tips">4.4.4 Tips for distribution maintainers</a>
  224. </ul>
  225. <p> Note: directories with Postfix dynamically-linked libraries
  226. or database plugins should contain only postfix-related files.
  227. Postfix dynamically-linked libraries and database plugins should
  228. not be installed in a "public" system directory such as /usr/lib
  229. or /usr/local/lib. Linking Postfix dynamically-linked library or
  230. database-plugin files into non-Postfix programs is not supported.
  231. Postfix dynamically-linked libraries and database plugins implement
  232. a Postfix-internal API that changes without maintaining compatibility.
  233. </p>
  234. <h4><a name="shared_enable"> 4.4.1 Turning on Postfix dynamically-linked
  235. library support </a></h4>
  236. <p> Postfix can be built with Postfix dynamically-linked libraries
  237. (files typically named <tt>libpostfix-*.so</tt>). Postfix
  238. dynamically-linked libraries add minor run-time overhead and result
  239. in significantly-smaller Postfix executable files. </p>
  240. <p> Specify "shared=yes" on the "make makefiles" command line to
  241. build Postfix with dynamically-linked library support. </p>
  242. <blockquote>
  243. <pre>
  244. $ make makefiles shared=yes ...other arguments...
  245. $ make
  246. </pre>
  247. </blockquote>
  248. <p> (Specify "make makefiles shared=no" to explicitly disable Postfix
  249. dynamically-linked library support). </p>
  250. <p> This installs dynamically-linked libraries in $<a href="postconf.5.html#shlib_directory">shlib_directory</a>,
  251. typically /usr/lib/postfix or /usr/local/lib/postfix, with file
  252. names libpostfix-<i>name</i>.so, where the <i>name</i> is a source-code
  253. directory name such as "util" or "global". </p>
  254. <p> See section 4.4.3 "<a href="#shared_custom">Customizing Postfix
  255. dynamically-linked libraries and database plugins</a>" below for
  256. how to customize the Postfix dynamically-linked library location,
  257. including support to upgrade a running mail system safely. </p>
  258. <h4><a name="dynamicmaps_enable"> 4.4.2 Turning on Postfix
  259. database-plugin support </a></h4>
  260. <p> Additionally, Postfix can be built to support dynamic loading
  261. of Postfix database clients (database plugins) with the Debian-style
  262. dynamicmaps feature. Postfix 3.0 supports dynamic loading of <a href="CDB_README.html">cdb</a>:,
  263. <a href="ldap_table.5.html">ldap</a>:, <a href="lmdb_table.5.html">lmdb</a>:, <a href="mysql_table.5.html">mysql</a>:, <a href="pcre_table.5.html">pcre</a>:, <a href="pgsql_table.5.html">pgsql</a>:, <a href="DATABASE_README.html#types">sdbm</a>:, and <a href="sqlite_table.5.html">sqlite</a>: database
  264. clients. Dynamic loading is useful when you distribute or install
  265. pre-compiled Postfix packages. </p>
  266. <p> Specify "dynamicmaps=yes" on the "make makefiles" command line
  267. to build Postfix with support to dynamically load Postfix database
  268. clients with the Debian-style dynamicmaps feature.
  269. </p>
  270. <blockquote>
  271. <pre>
  272. $ make makefiles dynamicmaps=yes ...other arguments...
  273. $ make
  274. </pre>
  275. </blockquote>
  276. <p> (Specify "make makefiles dynamicmaps=no" to explicitly disable
  277. Postfix database-plugin support). </p>
  278. <p> This implicitly enables dynamically-linked library support,
  279. installs the configuration file dynamicmaps.cf in $<a href="postconf.5.html#meta_directory">meta_directory</a>
  280. (usually, /etc/postfix or /usr/local/etc/postfix), and installs
  281. database plugins in $<a href="postconf.5.html#shlib_directory">shlib_directory</a> (see above). Database plugins
  282. are named postfix-<i>type</i>.so where the <i>type</i> is a database
  283. type such as "cdb" or "ldap". </p>
  284. <blockquote>
  285. <p> NOTE: The Postfix 3.0 build procedure expects that you specify
  286. database library dependencies with variables named <a href="CDB_README.html">AUXLIBS_CDB</a>,
  287. <a href="LDAP_README.html">AUXLIBS_LDAP</a>, etc. With Postfix 3.0 and later, the old AUXLIBS
  288. variable still supports building a statically-loaded database client,
  289. but only the new <a href="CDB_README.html">AUXLIBS_CDB</a> etc. variables support building a
  290. dynamically-loaded or statically-loaded CDB etc. database client.
  291. See <a href="CDB_README.html">CDB_README</a>, <a href="LDAP_README.html">LDAP_README</a>, etc. for details. </p>
  292. <p> Failure to follow this advice will defeat the purpose of dynamic
  293. database client loading. Every Postfix executable file will have
  294. database library dependencies. And that was exactly what dynamic
  295. database client loading was meant to avoid. </p>
  296. </blockquote>
  297. <p> See the next section for how to customize the location and
  298. version of Postfix database plugins and the location of the file
  299. dynamicmaps.cf. </p>
  300. <h4><a name="shared_custom"> 4.4.3 Customizing Postfix dynamically-linked
  301. libraries and database plugins </a></h4>
  302. <h5> Customizing build-time and run-time options for Postfix
  303. dynamically-linked libraries and database plugins </h5>
  304. <p> The build-time environment variables SHLIB_CFLAGS, SHLIB_RPATH,
  305. and SHLIB_SUFFIX provide control over how Postfix libraries and
  306. plugins are compiled, linked, and named.
  307. <blockquote>
  308. <pre>
  309. $ make makefiles SHLIB_CFLAGS=flags SHLIB_RPATH=rpath SHLIB_SUFFIX=suffix ...other arguments...
  310. $ make
  311. </pre>
  312. </blockquote>
  313. <p> See section 4.7 "<a href="#build_other">Overriding other
  314. compile-time features</a>" below for details. </p>
  315. <h5> Customizing the location of Postfix dynamically-linked libraries
  316. and database plugins </h5>
  317. <p> As a reminder, the directories with Postfix dynamically-linked
  318. libraries or database plugins should contain only Postfix-related
  319. files. Linking these files into other programs is not supported.
  320. </p>
  321. <p> To override the default location of Postfix dynamically-linked
  322. libraries and database plugins specify, for example: </p>
  323. <blockquote>
  324. <pre>
  325. $ make makefiles shared=yes <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix ...
  326. </pre>
  327. </blockquote>
  328. <p> If you intend to upgrade Postfix without stopping the mail
  329. system, then you should append the Postfix release version to the
  330. <a href="postconf.5.html#shlib_directory">shlib_directory</a> pathname, to eliminate the possibility that programs
  331. will link with dynamically-linked libraries or database plugins
  332. from the wrong Postfix version. For example: </p>
  333. <blockquote>
  334. <pre>
  335. $ make makefiles shared=yes \
  336. <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix/MAIL_VERSION ...
  337. </pre>
  338. </blockquote>
  339. <p> The command "make makefiles name=value..." will replace the
  340. string MAIL_VERSION at the end of a configuration parameter value
  341. with the Postfix release version. Do not try to specify something
  342. like $<a href="postconf.5.html#mail_version">mail_version</a> on this command line. This produces inconsistent
  343. results with different versions of the make(1) command. </p>
  344. <p> You can change the <a href="postconf.5.html#shlib_directory">shlib_directory</a> setting after Postfix is
  345. built, with "make install" or "make upgrade". However, you may have
  346. to run ldconfig if you change <a href="postconf.5.html#shlib_directory">shlib_directory</a> after Postfix is built
  347. (the symptom is that Postfix programs fail because the run-time
  348. linker cannot find the files libpostfix-*.so). No ldconfig command
  349. is needed if you keep the files libpostfix-*.so in the compiled-in
  350. default $<a href="postconf.5.html#shlib_directory">shlib_directory</a> location. </p>
  351. <blockquote>
  352. <pre>
  353. # make upgrade <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix ...
  354. # make install <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix ...
  355. </pre>
  356. </blockquote>
  357. <p> To append the Postfix release version to the pathname if you
  358. intend to upgrade Postfix without stopping the mail system: </p>
  359. <blockquote>
  360. <pre>
  361. # make upgrade <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix/MAIL_VERSION ...
  362. # make install <a href="postconf.5.html#shlib_directory">shlib_directory</a>=/usr/local/lib/postfix/MAIL_VERSION ...
  363. </pre>
  364. </blockquote>
  365. <p> See also the comments above for appending MAIL_VERSION with
  366. the "make makefiles" command. </p>
  367. <h5> Customizing the location of dynamicmaps.cf and other files
  368. </h5>
  369. <p> The <a href="postconf.5.html#meta_directory">meta_directory</a> parameter has the same default setting as
  370. the <a href="postconf.5.html#config_directory">config_directory</a> parameter, typically /etc/postfix or
  371. /usr/local/etc/postfix. </p>
  372. <p> You can override the default <a href="postconf.5.html#meta_directory">meta_directory</a> location at compile
  373. time or after Postfix is built. To override the default location
  374. at compile time specify, for example: </p>
  375. <blockquote>
  376. <pre>
  377. % make makefiles <a href="postconf.5.html#meta_directory">meta_directory</a>=/usr/libexec/postfix ...
  378. </pre>
  379. </blockquote>
  380. <p> Here is a tip if you want to make a pathname dependent on the
  381. Postfix release version: the command "make makefiles name=value..."
  382. will replace the string MAIL_VERSION at the end of a configuration
  383. parameter value with the Postfix release version. Do not try to
  384. specify something like $<a href="postconf.5.html#mail_version">mail_version</a> on this command line. This
  385. produces inconsistent results with different versions of the make(1)
  386. command. </p>
  387. <p> You can override the <a href="postconf.5.html#meta_directory">meta_directory</a> setting after Postfix is
  388. built, with "make install" or "make upgrade". </p>
  389. <blockquote>
  390. <pre>
  391. # make upgrade <a href="postconf.5.html#meta_directory">meta_directory</a>=/usr/libexec/postfix ...
  392. # make install <a href="postconf.5.html#meta_directory">meta_directory</a>=/usr/libexec/postfix ...
  393. </pre>
  394. </blockquote>
  395. <p> As with the command "make makefiles, the command "make
  396. install/upgrade name=value..." will replace the string MAIL_VERSION
  397. at the end of a configuration parameter value with the Postfix
  398. release version. Do not try to specify something like $<a href="postconf.5.html#mail_version">mail_version</a>
  399. on this command line. This produces inconsistent results with
  400. different versions of the make(1) command. </p>
  401. <h4><a name="shared_tips"> 4.4.4 Tips for distribution maintainers
  402. </a></h4>
  403. <ul>
  404. <li> <p> The <a href="postconf.5.html#shlib_directory">shlib_directory</a> parameter setting also provides the
  405. default directory for database plugin files with a relative pathname
  406. in the file dynamicmaps.cf. </p>
  407. <li> <p> The <a href="postconf.5.html#meta_directory">meta_directory</a> parameter specifies the location of the
  408. files dynamicmaps.cf, postfix-files, and some multi-instance template
  409. files. The <a href="postconf.5.html#meta_directory">meta_directory</a> parameter has the same default value as
  410. the <a href="postconf.5.html#config_directory">config_directory</a> parameter (typically, /etc/postfix or
  411. /usr/local/etc/postfix). For backwards compatibility with Postfix
  412. 2.6 .. 2.11, specify "<a href="postconf.5.html#meta_directory">meta_directory</a> = $<a href="postconf.5.html#daemon_directory">daemon_directory</a>" in <a href="postconf.5.html">main.cf</a>
  413. before installing or upgrading Postfix, or specify "<a href="postconf.5.html#meta_directory">meta_directory</a>
  414. = /path/name" on the "make makefiles", "make install" or "make
  415. upgrade" command line. </p>
  416. <li> <p> The configuration file dynamicmaps.cf will automatically
  417. include files under the directory dynamicmaps.cf.d, just like the
  418. configuration file postfix-files will automatically include files
  419. under the directory postfix-files.d. Thanks to this, you can install
  420. or deinstall a database plugin package without having to edit
  421. postfix-files or dynamicmaps.cf. Instead, you give that plugin its
  422. own configuration files under dynamicmaps.cf.d and postfix-files.d, and
  423. you add or remove those configuration files along with the database
  424. plugin dynamically-linked object. </p>
  425. <li> <p> Each configuration file under the directory dynamicmaps.cf.d
  426. must have the same format as the configuration file dynamicmaps.cf.
  427. There is no requirement that these configuration file *names* have a
  428. specific format. </p>
  429. <li> <p> Each configuration file under the directory postfix-files.d
  430. must have the same format as the configuration file postfix-files.
  431. There is no requirement that these configuration file *names* have a
  432. specific format. </p>
  433. </ul>
  434. <h3><a name="build_opt">4.5 - Building with optional features</a></h3>
  435. By default, Postfix builds as a mail system with relatively few
  436. bells and whistles. Support for third-party databases etc.
  437. must be configured when Postfix is compiled. The following documents
  438. describe how to build Postfix with support for optional features:
  439. <blockquote>
  440. <table border="1">
  441. <tr> <th>Optional feature </th> <th>Document </th> <th>Availability</th>
  442. </tr>
  443. <tr> <td> Berkeley DB database</td> <td><a href="DB_README.html">DB_README</a></td> <td> Postfix
  444. 1.0 </td> </tr>
  445. <tr> <td> LMDB database</td> <td><a href="LMDB_README.html">LMDB_README</a></td> <td> Postfix
  446. 2.11 </td> </tr>
  447. <tr> <td> LDAP database</td> <td><a href="LDAP_README.html">LDAP_README</a></td> <td> Postfix
  448. 1.0 </td> </tr>
  449. <tr> <td> MySQL database</td> <td><a href="MYSQL_README.html">MYSQL_README</a></td> <td> Postfix
  450. 1.0 </td> </tr>
  451. <tr> <td> Perl compatible regular expression</td> <td><a href="PCRE_README.html">PCRE_README</a></td>
  452. <td> Postfix 1.0 </td> </tr>
  453. <tr> <td> PostgreSQL database</td> <td><a href="PGSQL_README.html">PGSQL_README</a></td> <td>
  454. Postfix 2.0 </td> </tr>
  455. <tr> <td> SASL authentication </td> <td><a href="SASL_README.html">SASL_README</a></td> <td>
  456. Postfix 1.0 </td> </tr>
  457. <tr> <td> SQLite database</td> <td><a href="SQLITE_README.html">SQLITE_README</a></td> <td> Postfix
  458. 2.8 </td> </tr>
  459. <tr> <td> STARTTLS session encryption </td> <td><a href="TLS_README.html">TLS_README</a></td> <td>
  460. Postfix 2.2 </td> </tr>
  461. </table>
  462. </blockquote>
  463. <p> Note: IP version 6 support is compiled into Postfix on operating
  464. systems that have IPv6 support. See the <a href="IPV6_README.html">IPV6_README</a> file for details.
  465. </p>
  466. <h3><a name="build_over">4.6 - Overriding built-in parameter default
  467. settings</a></h3>
  468. <h4>4.6.1 - Postfix 3.0 and later </h4>
  469. <p> All Postfix configuration parameters can be changed by editing
  470. a Postfix configuration file, except for one: the parameter that
  471. specifies the location of Postfix configuration files. In order to
  472. build Postfix with a configuration directory other than /etc/postfix,
  473. use: </p>
  474. <blockquote>
  475. <pre>
  476. $ make makefiles <a href="postconf.5.html#config_directory">config_directory</a>=/some/where ...other arguments...
  477. $ make
  478. </pre>
  479. </blockquote>
  480. <p> The command "make makefiles name=value ..." will replace the
  481. string MAIL_VERSION at the end of a configuration parameter value
  482. with the Postfix release version. Do not try to specify something
  483. like $<a href="postconf.5.html#mail_version">mail_version</a> on this command line. This produces inconsistent
  484. results with different versions of the make(1) command. </p>
  485. <p> Parameters whose defaults can be specified in this way are
  486. listed below. See the <a href="postconf.5.html">postconf(5)</a> manpage for a description
  487. (command: "<tt>nroff -man man/man5/postconf.5 | less</tt>"). </p>
  488. <blockquote>
  489. <table border="1">
  490. <tr> <th>parameter name</th> <th>typical default</th> </tr>
  491. <tr> <td><a href="postconf.5.html#command_directory">command_directory</a></td> <td>/usr/sbin</td> </tr>
  492. <tr> <td><a href="postconf.5.html#config_directory">config_directory</a></td> <td>/etc/postfix</td> </tr>
  493. <tr> <td><a href="postconf.5.html#default_database_type">default_database_type</a></td> <td>hash</td> </tr>
  494. <tr> <td><a href="postconf.5.html#daemon_directory">daemon_directory</a></td> <td>/usr/libexec/postfix</td> </tr>
  495. <tr> <td><a href="postconf.5.html#data_directory">data_directory</a></td> <td>/var/lib/postfix</td> </tr>
  496. <tr> <td><a href="postconf.5.html#html_directory">html_directory</a></td> <td>no</td> </tr>
  497. <tr> <td><a href="postconf.5.html#mail_spool_directory">mail_spool_directory</a></td> <td>/var/mail</td> </tr>
  498. <tr> <td><a href="postconf.5.html#mailq_path">mailq_path</a></td> <td>/usr/bin/mailq</td> </tr>
  499. <tr> <td><a href="postconf.5.html#manpage_directory">manpage_directory</a></td> <td>/usr/local/man</td> </tr>
  500. <tr> <td><a href="postconf.5.html#meta_directory">meta_directory</a></td> <td>/etc/postfix</td> </tr>
  501. <tr> <td><a href="postconf.5.html#newaliases_path">newaliases_path</a></td> <td>/usr/bin/newaliases</td> </tr>
  502. <tr> <td><a href="postconf.5.html#openssl_path">openssl_path</a></td> <td>openssl</td> </tr>
  503. <tr> <td><a href="postconf.5.html#queue_directory">queue_directory</a></td> <td>/var/spool/postfix</td> </tr>
  504. <tr> <td><a href="postconf.5.html#readme_directory">readme_directory</a></td> <td>no</td> </tr>
  505. <tr> <td><a href="postconf.5.html#sendmail_path">sendmail_path</a></td> <td>/usr/sbin/sendmail</td> </tr>
  506. <tr> <td><a href="postconf.5.html#shlib_directory">shlib_directory</a></td> <td>/usr/lib/postfix</td> </tr>
  507. </table>
  508. </blockquote>
  509. <h4>4.6.2 - All Postfix versions </h4>
  510. <p> All Postfix configuration parameters can be changed by editing
  511. a Postfix configuration file, except for one: the parameter that
  512. specifies the location of Postfix configuration files. In order to
  513. build Postfix with a configuration directory other than /etc/postfix,
  514. use: </p>
  515. <blockquote>
  516. <pre>
  517. $ make makefiles CCARGS='-DDEF_CONFIG_DIR=\"/some/where\"'
  518. $ make
  519. </pre>
  520. </blockquote>
  521. <p> IMPORTANT: Be sure to get the quotes right. These details matter
  522. a lot. </p>
  523. <p> Parameters whose defaults can be specified in this way are
  524. listed below. See the <a href="postconf.5.html">postconf(5)</a> manpage for a description
  525. (command: "<tt>nroff -man man/man5/postconf.5 | less</tt>"). </p>
  526. <blockquote>
  527. <table border="1">
  528. <tr><th> Macro name </th> <th>default value for</th> <th>typical
  529. default</th> </tr>
  530. <tr> <td>DEF_COMMAND_DIR</td> <td><a href="postconf.5.html#command_directory">command_directory</a></td>
  531. <td>/usr/sbin</td> </tr>
  532. <tr> <td>DEF_CONFIG_DIR</td> <td><a href="postconf.5.html#config_directory">config_directory</a></td>
  533. <td>/etc/postfix</td> </tr>
  534. <tr> <td>DEF_DB_TYPE</td> <td><a href="postconf.5.html#default_database_type">default_database_type</a></td>
  535. <td>hash</td> </tr>
  536. <tr> <td>DEF_DAEMON_DIR</td> <td><a href="postconf.5.html#daemon_directory">daemon_directory</a></td>
  537. <td>/usr/libexec/postfix</td> </tr>
  538. <tr> <td>DEF_DATA_DIR</td> <td><a href="postconf.5.html#data_directory">data_directory</a></td>
  539. <td>/var/lib/postfix</td> </tr>
  540. <tr> <td>DEF_MAILQ_PATH</td> <td><a href="postconf.5.html#mailq_path">mailq_path</a></td> <td>/usr/bin/mailq</td>
  541. </tr>
  542. <tr> <td>DEF_HTML_DIR</td> <td><a href="postconf.5.html#html_directory">html_directory</a></td>
  543. <td>no</td> </tr>
  544. <tr> <td>DEF_MANPAGE_DIR</td> <td><a href="postconf.5.html#manpage_directory">manpage_directory</a></td>
  545. <td>/usr/local/man</td> </tr>
  546. <tr> <td>DEF_NEWALIAS_PATH</td> <td><a href="postconf.5.html#newaliases_path">newaliases_path</a></td>
  547. <td>/usr/bin/newaliases</td> </tr>
  548. <tr> <td>DEF_QUEUE_DIR</td> <td><a href="postconf.5.html#queue_directory">queue_directory</a></td>
  549. <td>/var/spool/postfix</td> </tr>
  550. <tr> <td>DEF_README_DIR</td> <td><a href="postconf.5.html#readme_directory">readme_directory</a></td>
  551. <td>no</td> </tr>
  552. <tr> <td>DEF_SENDMAIL_PATH</td> <td><a href="postconf.5.html#sendmail_path">sendmail_path</a></td>
  553. <td>/usr/sbin/sendmail</td> </tr>
  554. </table>
  555. </blockquote>
  556. <p> Note: the <a href="postconf.5.html#data_directory">data_directory</a> parameter (for caches and pseudo-random
  557. numbers) was introduced with Postfix version 2.5. </p>
  558. <h3><a name="build_other">4.7 - Overriding other compile-time
  559. features</a></h3>
  560. <p> The general method to override Postfix compile-time features
  561. is as follows: </p>
  562. <blockquote>
  563. <pre>
  564. $ make makefiles name=value name=value...
  565. $ make
  566. </pre>
  567. </blockquote>
  568. <p> The following is an extensive list of names and values. </p>
  569. <table border="1">
  570. <tr> <th colspan="2"> Name/Value </th> <th> Description </th> </tr>
  571. <tr> <td colspan="2"> AUXLIBS="object_library..."</td> <td> Specifies
  572. one or more non-default object libraries. Postfix 3.0 and later
  573. specify some of their database library dependencies with <a href="CDB_README.html">AUXLIBS_CDB</a>,
  574. <a href="LDAP_README.html">AUXLIBS_LDAP</a>, <a href="LMDB_README.html">AUXLIBS_LMDB</a>, <a href="MYSQL_README.html">AUXLIBS_MYSQL</a>, <a href="PCRE_README.html">AUXLIBS_PCRE</a>, <a href="PGSQL_README.html">AUXLIBS_PGSQL</a>,
  575. <a href="SDBM_README.html">AUXLIBS_SDBM</a>, and <a href="SQLITE_README.html">AUXLIBS_SQLITE</a>, respectively. </td> </tr>
  576. <tr> <td colspan="2"> CC=compiler_command</td> <td> Specifies a
  577. non-default compiler. On many systems, the default is <tt>gcc</tt>.
  578. </td> </tr>
  579. <tr> <td colspan="2"> CCARGS="compiler_arguments..."</td> <td>
  580. Specifies non-default compiler arguments, for example, a non-default
  581. <tt>include</tt> directory. The following directives turn
  582. off Postfix features at compile time:</td> </tr>
  583. <tr> <td> </td> <td> -DNO_DB </td> <td> Do not build with Berkeley
  584. DB support. By default, Berkeley DB support is compiled in on
  585. platforms that are known to support this feature. If you override
  586. this, then you probably should also override DEF_DB_TYPE as described
  587. in section 4.6. </td> </tr>
  588. <tr> <td> </td> <td> -DNO_DNSSEC </td> <td> Do not build with DNSSEC
  589. support, even if the resolver library appears to support it. </td>
  590. </tr>
  591. <tr> <td> </td> <td> -DNO_DEVPOLL </td> <td> Do not build with
  592. Solaris <tt>/dev/poll</tt> support. By default, <tt>/dev/poll</tt>
  593. support is compiled in on Solaris versions that are known to support
  594. this feature. </td> </tr>
  595. <tr> <td> </td> <td> -DNO_EPOLL </td> <td> Do not build with Linux
  596. EPOLL support. By default, EPOLL support is compiled in on platforms
  597. that are known to support this feature. </td> </tr>
  598. <tr> <td> </td> <td> -DNO_EAI </td> <td> Do not build with EAI
  599. (SMTPUTF8) support. By default, EAI support is compiled in when
  600. the "icuuc" library and header files are found. </td> </tr>
  601. <tr> <td> </td> <td> -DNO_INLINE </td> <td> Do not require support
  602. for C99 "inline" functions. Instead, implement argument typechecks
  603. for non-printf/scanf-like functions with ternary operators and
  604. unreachable code. </td> </tr>
  605. <tr> <td> </td> <td> -DNO_IPV6 </td> <td> Do not build with IPv6
  606. support. By default, IPv6 support is compiled in on platforms that
  607. are known to have IPv6 support. Note: this directive is for debugging
  608. And testing only. It is not guaranteed to work on all platforms.
  609. If you don't want IPv6 support, set "<a href="postconf.5.html#inet_protocols">inet_protocols</a> = ipv4" in
  610. <a href="postconf.5.html">main.cf</a>.
  611. </td> </tr>
  612. <tr> <td> </td> <td> -DNO_KQUEUE </td> <td> Do not build with FreeBSD
  613. / NetBSD / OpenBSD / MacOSX KQUEUE support. By default, KQUEUE
  614. support is compiled in on platforms that are known to support it.
  615. </td> </tr>
  616. <tr> <td> </td> <td> -DNO_NIS </td> <td> Do not build with NIS or
  617. NISPLUS support. NIS is not available on some recent Linux
  618. distributions. </td> </tr>
  619. <tr> <td> </td> <td> -DNO_NISPLUS </td> <td> Do not build with
  620. NISPLUS support. NISPLUS is not available on some recent Solaris
  621. distributions. </td> </tr>
  622. <tr> <td> </td> <td> -DNO_PCRE </td> <td> Do not build with PCRE
  623. support. By default, PCRE support is compiled in when the
  624. <tt>pcre-config</tt> utility is installed. </td> </tr>
  625. <tr> <td> </td> <td> -DNO_POSIX_GETPW_R </td> <td> Disable support
  626. for POSIX <tt>getpwnam_r/getpwuid_r</tt>. By default Postfix uses
  627. these where they are known to be available. </td> </tr>
  628. <tr> <td> </td> <td> -DNO_SIGSETJMP </td> <td> Use
  629. <tt>setjmp()/longjmp()</tt> instead of <tt>sigsetjmp()/siglongjmp()</tt>.
  630. By default, Postfix uses <tt>sigsetjmp()/siglongjmp()</tt> when
  631. they are known to be available. </td> </tr>
  632. <tr> <td> </td> <td> -DNO_SNPRINTF </td> <td> Use <tt>sprintf()</tt>
  633. instead of <tt>snprintf()</tt>. By default, Postfix uses
  634. <tt>snprintf()</tt> except on ancient systems. </td> </tr>
  635. <tr> <td colspan="2"> DEBUG=debug_level </td> <td> Specifies a
  636. non-default compiler debugging level. The default is "<tt>-g</tt>".
  637. Specify DEBUG= to turn off debugging. </td> </tr>
  638. <tr> <td colspan="2"> OPT=optimization_level </td> <td> Specifies
  639. a non-default optimization level. The default is "<tt>-O</tt>".
  640. Specify OPT= to turn off optimization. </td> </tr>
  641. <tr> <td colspan="2"> POSTFIX_INSTALL_OPTS=-option... </td> <td>
  642. Specifies options for the <tt>postfix-install</tt> command, separated
  643. by whitespace. Currently, the only supported option is
  644. "<tt>-keep-build-mtime</tt>". </td> </tr>
  645. <tr> <td colspan="2"> SHLIB_CFLAGS=flags </td> <td> Specifies
  646. non-default compiler options for building Postfix dynamically-linked
  647. libraries and database plugins. The typical default is "-fPIC".
  648. </td> </tr>
  649. <tr> <td colspan="2"> SHLIB_RPATH=rpath </td> <td> Specifies
  650. a non-default runpath for Postfix dynamically-linked libraries. The
  651. typical default is "'-Wl,-rpath,${SHLIB_DIR}'". </td> </tr>
  652. <tr> <td colspan="2"> SHLIB_SUFFIX=suffix </td> <td> Specifies
  653. a non-default suffix for Postfix dynamically-linked libraries and
  654. database plugins. The typical default is "<tt>.so</tt>". </td>
  655. </tr>
  656. <tr> <td colspan="2"> WARN="warning_flags..." </td> <td> Specifies
  657. non-default compiler warning options for use when "<tt>make</tt>"
  658. is invoked in a source subdirectory only. </td>
  659. </tr>
  660. </table>
  661. <h3><a name="build_proc">4.8 - Support for thousands of processes</a></h3>
  662. <p> The number of connections that Postfix can manage simultaneously
  663. is limited by the number of processes that it can run. This number
  664. in turn is limited by the number of files and sockets that a single
  665. process can open. For example, the Postfix queue manager has a
  666. separate connection to each delivery process, and the <a href="anvil.8.html">anvil(8)</a>
  667. server has one connection per <a href="smtpd.8.html">smtpd(8)</a> process. </p>
  668. <p> Postfix version 2.4 and later have no built-in limits on the
  669. number of open files or sockets, when compiled on systems that
  670. support one of the following: </p>
  671. <ul>
  672. <li> BSD kqueue(2) (FreeBSD 4.1, NetBSD 2.0, OpenBSD 2.9),
  673. <li> Solaris 8 /dev/poll,
  674. <li> Linux 2.6 epoll(4).
  675. </ul>
  676. <p> With other Postfix versions or operating systems, the number
  677. of file descriptors per process is limited by the value of the
  678. FD_SETSIZE macro. If you expect to run more than 1000 mail delivery
  679. processes, you may need to override the definition of the FD_SETSIZE
  680. macro to make select() work correctly: </p>
  681. <blockquote>
  682. <pre>
  683. $ make makefiles CCARGS=-DFD_SETSIZE=2048
  684. </pre>
  685. </blockquote>
  686. <p> Warning: the above has no effect on some Linux versions.
  687. Apparently, on these systems the FD_SETSIZE value can be changed
  688. only by using undocumented interfaces. Currently, that means
  689. including &lt;bits/types.h&gt; directly (which is not allowed) and
  690. overriding the __FD_SETSIZE macro. Beware, undocumented interfaces
  691. can change at any time and without warning. </p>
  692. <p> But wait, there is more: none of this will work unless the
  693. operating system is configured to handle thousands of connections.
  694. See the <a href="TUNING_README.html">TUNING_README</a> guide for examples of how to increase the
  695. number of open sockets or files. </p>
  696. <h3><a name="build_final">4.9 - Compiling Postfix, at last</a></h3>
  697. <p> If the command </p>
  698. <blockquote>
  699. <pre>
  700. $ make
  701. </pre>
  702. </blockquote>
  703. <p> is successful, then you can proceed to <a href="#install">install</a>
  704. Postfix (section 6).
  705. <p> If the command produces compiler error messages, it may be time
  706. to search the web or to ask the postfix-users@postfix.org mailing
  707. list, but be sure to search the mailing list archives first. Some
  708. mailing list archives are linked from <a href="http://www.postfix.org/">http://www.postfix.org/</a>. </p>
  709. <h2> <a name="5">5 - Porting Postfix to an unsupported system</a> </h2>
  710. <p> Each system type that Postfix knows is identified by a unique
  711. name. Examples: SUNOS5, FREEBSD4, and so on. When porting Postfix
  712. to a new system, the first step is to choose a SYSTEMTYPE name for
  713. the new system. You must use a name that includes at least the
  714. major version of the operating system (such as SUNOS4 or LINUX2),
  715. so that different releases of the same system can be supported
  716. without confusion. </p>
  717. <p> Add a case statement to the "makedefs" shell script in the
  718. source code top-level directory that recognizes the new system
  719. reliably, and that emits the right system-specific information.
  720. Be sure to make the code robust against user PATH settings; if the
  721. system offers multiple UNIX flavors (e.g. BSD and SYSV) be sure to
  722. build for the native flavor, instead of the emulated one. </p>
  723. <p> Add an "#ifdef SYSTEMTYPE" section to the central util/sys_defs.h
  724. include file. You may have to invent new feature macro names.
  725. Please choose sensible feature macro names such as HAS_DBM or
  726. FIONREAD_IN_SYS_FILIO_H.
  727. <p> I strongly recommend against using "#ifdef SYSTEMTYPE" in
  728. individual source files. While this may look like the quickest
  729. solution, it will create a mess when newer versions of the same
  730. SYSTEMTYPE need to be supported. You're likely to end up placing
  731. "#ifdef" sections all over the source code again. </p>
  732. <h2><a name="install">6 - Installing the software after successful
  733. compilation</a></h2>
  734. <p> This text describes how to install Postfix from source code.
  735. See the <a href="PACKAGE_README.html">PACKAGE_README</a> file if you are building a package for
  736. distribution to other systems. </p>
  737. <h3>6.1 - Save existing Sendmail binaries</h3>
  738. <p> <a name="save">IMPORTANT</a>: if you are REPLACING an existing
  739. Sendmail installation with Postfix, you may need to keep the old
  740. sendmail program running for some time in order to flush the mail
  741. queue. </p>
  742. <ul>
  743. <li> <p> Some systems implement a mail switch mechanism where
  744. different MTAs (Postfix, Sendmail, etc.) can be installed at the
  745. same time, while only one of them is actually being used. Examples
  746. of such switching mechanisms are the FreeBSD mailwrapper(8) or the
  747. Linux mail switch. In this case you should try to "flip" the switch
  748. to "Postfix" before installing Postfix. </p>
  749. <li> <p> If your system has no mail switch mechanism, execute the
  750. following commands (your sendmail, newaliases and mailq programs
  751. may be in a different place): </p>
  752. <pre>
  753. # mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
  754. # mv /usr/bin/newaliases /usr/bin/newaliases.OFF
  755. # mv /usr/bin/mailq /usr/bin/mailq.OFF
  756. # chmod 755 /usr/sbin/sendmail.OFF /usr/bin/newaliases.OFF \
  757. /usr/bin/mailq.OFF
  758. </pre>
  759. </ul>
  760. <h3>6.2 - Create account and groups</h3>
  761. <p> Before you install Postfix for the first time you need to
  762. create an account and a group:</p>
  763. <ul>
  764. <li> <p> Create a user account "postfix" with a user id and group
  765. id that are not used by any other user account. Preferably, this
  766. is an account that no-one can log into. The account does not need
  767. an executable login shell, and needs no existing home directory.
  768. My password and group file entries look like this: </p>
  769. <blockquote>
  770. <pre>
  771. /etc/passwd:
  772. postfix:*:12345:12345:postfix:/no/where:/no/shell
  773. /etc/group:
  774. postfix:*:12345:
  775. </pre>
  776. </blockquote>
  777. <p> Note: there should be no whitespace before "postfix:". </p>
  778. <li> <p> Create a group "postdrop" with a group id that is not used
  779. by any other user account. Not even by the postfix user account.
  780. My group file entry looks like:
  781. <blockquote>
  782. <pre>
  783. /etc/group:
  784. postdrop:*:54321:
  785. </pre>
  786. </blockquote>
  787. <p> Note: there should be no whitespace before "postdrop:". </p>
  788. </ul>
  789. <h3>6.3 - Install Postfix</h3>
  790. <p> To install or upgrade Postfix from compiled source code, run
  791. one of the following commands as the super-user:</p>
  792. <blockquote>
  793. <pre>
  794. # make install (interactive version, first time install)
  795. # make upgrade (non-interactive version, for upgrades)
  796. </pre>
  797. </blockquote>
  798. <ul>
  799. <li> <p> The interactive version ("make install") asks for pathnames
  800. for Postfix data and program files, and stores your preferences in
  801. the <a href="postconf.5.html">main.cf</a> file. <b> If you don't want Postfix to overwrite
  802. non-Postfix "sendmail", "mailq" and "newaliases" files, specify
  803. pathnames that end in ".postfix"</b>. </p>
  804. <li> <p> The non-interactive version ("make upgrade") needs the
  805. /etc/postfix/<a href="postconf.5.html">main.cf</a> file from a previous installation. If the file
  806. does not exist, use interactive installation ("make install")
  807. instead. </p>
  808. <li> <p> If you specify name=value arguments on the "make install"
  809. or "make upgrade" command line, then these will take precedence
  810. over compiled-in default settings or <a href="postconf.5.html">main.cf</a> settings. </p>
  811. <p> The command "make install/upgrade name=value ..." will replace
  812. the string MAIL_VERSION at the end of a configuration parameter
  813. value with the Postfix release version. Do not try to specify
  814. something like $<a href="postconf.5.html#mail_version">mail_version</a> on this command line. This produces
  815. inconsistent results with different versions of the make(1) command.
  816. </p>
  817. </ul>
  818. <h3>6.4 - Configure Postfix</h3>
  819. <p> Proceed to the section on how you wish to run Postfix on
  820. your particular machine: </p>
  821. <ul>
  822. <li> <p> <a href="#send_only">Send</a> mail only, without changing
  823. an existing Sendmail installation (section 7). </p>
  824. <li> <p> <a href="#send_receive">Send and receive</a> mail via a
  825. virtual host interface, still without any change to an existing
  826. Sendmail installation (section 8). </p>
  827. <li> <p> Run Postfix <a href="#replace">instead of</a> Sendmail
  828. (section 9). </p>
  829. </ul>
  830. <h2><a name="send_only">7 - Configuring Postfix to send mail
  831. only</a></h2>
  832. <p> If you are going to use Postfix to send mail only, there is no
  833. need to change your existing sendmail setup. Instead, set up your
  834. mail user agent so that it calls the Postfix sendmail program
  835. directly. </p>
  836. <p> Follow the instructions in the "<a href="#mandatory">Mandatory
  837. configuration file edits</a>" in section 10, and review the "<a
  838. href="#hamlet">To chroot or not to chroot</a>" text in section
  839. 11. </p>
  840. <p> You MUST comment out the "smtp inet" entry in /etc/postfix/<a href="master.5.html">master.cf</a>,
  841. in order to avoid conflicts with the real sendmail. Put a "#"
  842. character in front of the line that defines the smtpd service: </p>
  843. <blockquote>
  844. <pre>
  845. /etc/postfix/<a href="master.5.html">master.cf</a>:
  846. #smtp inet n - n - - smtpd
  847. </pre>
  848. </blockquote>
  849. <p> Start the Postfix system: </p>
  850. <blockquote>
  851. <pre>
  852. # postfix start
  853. </pre>
  854. </blockquote>
  855. <p> or, if you feel nostalgic, use the Postfix sendmail command: </p>
  856. <blockquote>
  857. <pre>
  858. # sendmail -bd -qwhatever
  859. </pre>
  860. </blockquote>
  861. <p> and watch your maillog file for any error messages. The pathname
  862. is /var/log/maillog, /var/log/mail, /var/log/syslog, or something
  863. else. Typically, the pathname is defined in the /etc/syslog.conf
  864. file. </p>
  865. <blockquote>
  866. <pre>
  867. $ egrep '(reject|warning|error|fatal|panic):' /some/log/file
  868. </pre>
  869. </blockquote>
  870. <p> Note: the most important error message is logged first. Later
  871. messages are not as useful. </p>
  872. <p> In order to inspect the mail queue, use one of the following
  873. commands: </p>
  874. <blockquote>
  875. <pre>
  876. $ mailq
  877. $ sendmail -bp
  878. $ postqueue -p
  879. </pre>
  880. </blockquote>
  881. <p> See also the "<a href="#care">Care and feeding</a>" section 12
  882. below. </p>
  883. <h2><a name="send_receive">8 - Configuring Postfix to send and
  884. receive mail via virtual interface</a></h2>
  885. <p> Alternatively, you can use the Postfix system to send AND
  886. receive mail while leaving your Sendmail setup intact, by running
  887. Postfix on a virtual interface address. Simply configure your mail
  888. user agent to directly invoke the Postfix sendmail program. </p>
  889. <p> To create a virtual network interface address, study your
  890. system ifconfig manual page. The command syntax could be any
  891. of: </p>
  892. <blockquote>
  893. <pre>
  894. # <b>ifconfig le0:1 &lt;address&gt; netmask &lt;mask&gt; up</b>
  895. # <b>ifconfig en0 alias &lt;address&gt; netmask 255.255.255.255</b>
  896. </pre>
  897. </blockquote>
  898. <p> In the /etc/postfix/<a href="postconf.5.html">main.cf</a> file, I would specify </p>
  899. <blockquote>
  900. <pre>
  901. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  902. <a href="postconf.5.html#myhostname">myhostname</a> = virtual.host.tld
  903. <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = $<a href="postconf.5.html#myhostname">myhostname</a>
  904. <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a>
  905. </pre>
  906. </blockquote>
  907. <p> Follow the instructions in the "<a href="#mandatory">Mandatory
  908. configuration file edits</a>" in section 10, and review the "<a
  909. name="#hamlet">To chroot or not to chroot</a>" text in section
  910. 11. </p>
  911. <p> Start the Postfix system: </p>
  912. <blockquote>
  913. <pre>
  914. # postfix start
  915. </pre>
  916. </blockquote>
  917. <p> or, if you feel nostalgic, use the Postfix sendmail command: </p>
  918. <blockquote>
  919. <pre>
  920. # sendmail -bd -qwhatever
  921. </pre>
  922. </blockquote>
  923. <p> and watch your maillog file for any error messages. The pathname
  924. is /var/log/maillog, /var/log/mail, /var/log/syslog, or something
  925. else. Typically, the pathname is defined in the /etc/syslog.conf
  926. file. </p>
  927. <blockquote>
  928. <pre>
  929. $ egrep '(reject|warning|error|fatal|panic):' /some/log/file
  930. </pre>
  931. </blockquote>
  932. <p> Note: the most important error message is logged first. Later
  933. messages are not as useful. </p>
  934. <p> In order to inspect the mail queue, use one of the following
  935. commands: </p>
  936. <blockquote>
  937. <pre>
  938. $ mailq
  939. $ sendmail -bp
  940. $ postqueue -p
  941. </pre>
  942. </blockquote>
  943. <p> See also the "<a href="#care">Care and feeding</a>" section 12
  944. below. </p>
  945. <h2><a name="replace">9 - Running Postfix instead of Sendmail</a></h2>
  946. <p> Prior to installing Postfix you should <a href="#save">save</a>
  947. any existing sendmail program files as described in section 6. Be
  948. sure to keep the old sendmail running for at least a couple days
  949. to flush any unsent mail. To do so, stop the sendmail daemon and
  950. restart it as: </p>
  951. <blockquote>
  952. <pre>
  953. # /usr/sbin/sendmail.OFF -q
  954. </pre>
  955. </blockquote>
  956. <p> Note: this is old sendmail syntax. Newer versions use separate
  957. processes for mail submission and for running the queue. </p>
  958. <p> After you have visited the "<a href="#mandatory">Mandatory
  959. configuration file edits</a>" section below, you can start the
  960. Postfix system with: </p>
  961. <blockquote>
  962. <pre>
  963. # postfix start
  964. </pre>
  965. </blockquote>
  966. <p> or, if you feel nostalgic, use the Postfix sendmail command: </p>
  967. <blockquote>
  968. <pre>
  969. # sendmail -bd -qwhatever
  970. </pre>
  971. </blockquote>
  972. <p> and watch your maillog file for any error messages. The pathname
  973. is /var/log/maillog, /var/log/mail, /var/log/syslog, or something
  974. else. Typically, the pathname is defined in the /etc/syslog.conf
  975. file. </p>
  976. <blockquote>
  977. <pre>
  978. $ egrep '(reject|warning|error|fatal|panic):' /some/log/file
  979. </pre>
  980. </blockquote>
  981. <p> Note: the most important error message is logged first. Later
  982. messages are not as useful. </p>
  983. <p> In order to inspect the mail queue, use one of the following
  984. commands: </p>
  985. <blockquote>
  986. <pre>
  987. $ mailq
  988. $ sendmail -bp
  989. $ postqueue -p
  990. </pre>
  991. </blockquote>
  992. <p> See also the "<a href="#care">Care and feeding</a>" section 12
  993. below. </p>
  994. <h2><a name="mandatory">10 - Mandatory configuration file edits</a></h2>
  995. <p> Note: the material covered in this section is covered in more
  996. detail in the <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> document. The information
  997. presented below is targeted at experienced system administrators.
  998. </p>
  999. <h3>10.1 - Postfix configuration files</h3>
  1000. <p> By default, Postfix configuration files are in /etc/postfix.
  1001. The two most important files are <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a>; these files
  1002. must be owned by root. Giving someone else write permission to
  1003. <a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a> (or to their parent directories) means giving
  1004. root privileges to that person. </p>
  1005. <p> In /etc/postfix/<a href="postconf.5.html">main.cf</a>, you will have to set up a minimal number
  1006. of configuration parameters. Postfix configuration parameters
  1007. resemble shell variables, with two important differences: the first
  1008. one is that Postfix does not know about quotes like the UNIX shell
  1009. does.</p>
  1010. <p> You specify a configuration parameter as: </p>
  1011. <blockquote>
  1012. <pre>
  1013. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1014. parameter = value
  1015. </pre>
  1016. </blockquote>
  1017. <p> and you use it by putting a "$" character in front of its name: </p>
  1018. <blockquote>
  1019. <pre>
  1020. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1021. other_parameter = $parameter
  1022. </pre>
  1023. </blockquote>
  1024. <p> You can use $parameter before it is given a value (that is the
  1025. second main difference with UNIX shell variables). The Postfix
  1026. configuration language uses lazy evaluation, and does not look at
  1027. a parameter value until it is needed at runtime. </p>
  1028. <p> Whenever you make a change to the <a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a> file,
  1029. execute the following command in order to refresh a running mail
  1030. system: </p>
  1031. <blockquote>
  1032. <pre>
  1033. # postfix reload
  1034. </pre>
  1035. </blockquote>
  1036. <h3>10.2 - Default domain for unqualified addresses</h3>
  1037. <p> First of all, you must specify what domain will be appended to an
  1038. unqualified address (i.e. an address without @domain.tld). The
  1039. "<a href="postconf.5.html#myorigin">myorigin</a>" parameter defaults to the local hostname, but that is
  1040. probably OK only for very small sites. </p>
  1041. <p> Some examples (use only one): </p>
  1042. <blockquote>
  1043. <pre>
  1044. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1045. <a href="postconf.5.html#myorigin">myorigin</a> = $<a href="postconf.5.html#myhostname">myhostname</a> (send mail as "user@$<a href="postconf.5.html#myhostname">myhostname</a>")
  1046. <a href="postconf.5.html#myorigin">myorigin</a> = $<a href="postconf.5.html#mydomain">mydomain</a> (send mail as "user@$<a href="postconf.5.html#mydomain">mydomain</a>")
  1047. </pre>
  1048. </blockquote>
  1049. <h3>10.3 - What domains to receive locally</h3>
  1050. <p> Next you need to specify what mail addresses Postfix should deliver
  1051. locally. </p>
  1052. <p> Some examples (use only one): </p>
  1053. <blockquote>
  1054. <pre>
  1055. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1056. <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a>, localhost.$<a href="postconf.5.html#mydomain">mydomain</a>, localhost
  1057. <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a>, localhost.$<a href="postconf.5.html#mydomain">mydomain</a>, localhost, $<a href="postconf.5.html#mydomain">mydomain</a>
  1058. <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a>
  1059. </pre>
  1060. </blockquote>
  1061. <p>The first example is appropriate for a workstation, the second
  1062. is appropriate for the mailserver for an entire domain. The third
  1063. example should be used when running on a virtual host interface.</p>
  1064. <h3>10.4 - Proxy/NAT interface addresses </h3>
  1065. <p> The <a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> parameter specifies all network addresses
  1066. that Postfix receives mail on by way of a proxy or network address
  1067. translation unit. You may specify symbolic hostnames instead of
  1068. network addresses. </p>
  1069. <p> IMPORTANT: You must specify your proxy/NAT external addresses
  1070. when your system is a backup MX host for other domains, otherwise
  1071. mail delivery loops will happen when the primary MX host is down.
  1072. </p>
  1073. <p> Example: host behind NAT box running a backup MX host. </p>
  1074. <blockquote>
  1075. <pre>
  1076. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1077. <a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> = 1.2.3.4 (the proxy/NAT external network address)
  1078. </pre>
  1079. </blockquote>
  1080. <h3>10.5 - What local clients to relay mail from </h3>
  1081. <p> If your machine is on an open network then you must specify
  1082. what client IP addresses are authorized to relay their mail through
  1083. your machine into the Internet. The default setting includes all
  1084. subnetworks that the machine is attached to. This may give relay
  1085. permission to too many clients. My own settings are: </p>
  1086. <blockquote>
  1087. <pre>
  1088. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1089. <a href="postconf.5.html#mynetworks">mynetworks</a> = 168.100.189.0/28, 127.0.0.0/8
  1090. </pre>
  1091. </blockquote>
  1092. <h3>10.6 - What relay destinations to accept from strangers </h3>
  1093. <p> If your machine is on an open network then you must also specify
  1094. whether Postfix will forward mail from strangers. The default
  1095. setting will forward mail to all domains (and subdomains of) what
  1096. is listed in $<a href="postconf.5.html#mydestination">mydestination</a>. This may give relay permission for
  1097. too many destinations. Recommended settings (use only one): </p>
  1098. <blockquote>
  1099. <pre>
  1100. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1101. <a href="postconf.5.html#relay_domains">relay_domains</a> = (do not forward mail from strangers)
  1102. <a href="postconf.5.html#relay_domains">relay_domains</a> = $<a href="postconf.5.html#mydomain">mydomain</a> (my domain and subdomains)
  1103. <a href="postconf.5.html#relay_domains">relay_domains</a> = $<a href="postconf.5.html#mydomain">mydomain</a>, other.domain.tld, ...
  1104. </pre>
  1105. </blockquote>
  1106. <h3>10.7 - Optional: configure a smart host for remote delivery</h3>
  1107. <p> If you're behind a firewall, you should set up a <a href="postconf.5.html#relayhost">relayhost</a>. If
  1108. you can, specify the organizational domain name so that Postfix
  1109. can use DNS lookups, and so that it can fall back to a secondary
  1110. MX host when the primary MX host is down. Otherwise just specify
  1111. a hard-coded hostname. </p>
  1112. <p> Some examples (use only one): </p>
  1113. <blockquote>
  1114. <pre>
  1115. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1116. <a href="postconf.5.html#relayhost">relayhost</a> = $<a href="postconf.5.html#mydomain">mydomain</a>
  1117. <a href="postconf.5.html#relayhost">relayhost</a> = [mail.$<a href="postconf.5.html#mydomain">mydomain</a>]
  1118. </pre>
  1119. </blockquote>
  1120. <p> The form enclosed with <tt>[]</tt> eliminates DNS MX lookups. </p>
  1121. <p> By default, the SMTP client will do DNS lookups even when you
  1122. specify a <a href="postconf.5.html#relayhost">relay host</a>. If your machine has no access to a DNS server,
  1123. turn off SMTP client DNS lookups like this: </p>
  1124. <blockquote>
  1125. <pre>
  1126. /etc/postfix/<a href="postconf.5.html">main.cf</a>:
  1127. <a href="postconf.5.html#disable_dns_lookups">disable_dns_lookups</a> = yes
  1128. </pre>
  1129. </blockquote>
  1130. <p> The <a href="STANDARD_CONFIGURATION_README.html">STANDARD_CONFIGURATION_README</a> file has more hints and tips for
  1131. firewalled and/or dial-up networks. </p>
  1132. <h3>10.8 - Create the aliases database</h3>
  1133. <p> Postfix uses a Sendmail-compatible <a href="aliases.5.html">aliases(5)</a> table to redirect
  1134. mail for <a href="local.8.html">local(8)</a> recipients. Typically, this information is kept
  1135. in two files: in a text file /etc/aliases and in an indexed file
  1136. /etc/aliases.db. The command "postconf <a href="postconf.5.html#alias_maps">alias_maps</a>" will tell you
  1137. the exact location of the text file. </p>
  1138. <p> First, be sure to update the text file with aliases for root,
  1139. postmaster and "postfix" that forward mail to a real person. Postfix
  1140. has a sample aliases file /etc/postfix/aliases that you can adapt
  1141. to local conditions. </p>
  1142. <blockquote>
  1143. <pre>
  1144. /etc/aliases:
  1145. root: you
  1146. postmaster: root
  1147. postfix: root
  1148. bin: root
  1149. <i>etcetera...</i>
  1150. </pre>
  1151. </blockquote>
  1152. <p> Note: there should be no whitespace before the ":". </p>
  1153. <p> Finally, build the indexed aliases file with one of the
  1154. following commands: </p>
  1155. <blockquote>
  1156. <pre>
  1157. # newaliases
  1158. # sendmail -bi
  1159. </pre>
  1160. </blockquote>
  1161. <h2><a name="hamlet">11 - To chroot or not to chroot</a></h2>
  1162. <p> Postfix daemon processes can be configured (via <a href="master.5.html">master.cf</a>) to
  1163. run in a chroot jail. The processes run at a fixed low privilege
  1164. and with access only to the Postfix queue directories (/var/spool/postfix).
  1165. This provides a significant barrier against intrusion. The barrier
  1166. is not impenetrable, but every little bit helps. </p>
  1167. <p> With the exception of Postfix daemons that deliver mail locally
  1168. and/or that execute non-Postfix commands, every Postfix daemon can
  1169. run chrooted. </p>
  1170. <p> Sites with high security requirements should consider to chroot
  1171. all daemons that talk to the network: the <a href="smtp.8.html">smtp(8)</a> and <a href="smtpd.8.html">smtpd(8)</a>
  1172. processes, and perhaps also the <a href="lmtp.8.html">lmtp(8)</a> client. The author's own
  1173. porcupine.org mail server runs all daemons chrooted that can be
  1174. chrooted. </p>
  1175. <p> The default /etc/postfix/<a href="master.5.html">master.cf</a> file specifies that no
  1176. Postfix daemon runs chrooted. In order to enable chroot operation,
  1177. edit the file /etc/postfix/<a href="master.5.html">master.cf</a>. Instructions are in the file.
  1178. </p>
  1179. <p> Note that a chrooted daemon resolves all filenames relative to
  1180. the Postfix queue directory (/var/spool/postfix). For successful
  1181. use of a chroot jail, most UNIX systems require you to bring in
  1182. some files or device nodes. The examples/chroot-setup directory
  1183. in the source code distribution has a collection of scripts that
  1184. help you set up Postfix chroot environments on different operating
  1185. systems. </p>
  1186. <p> Additionally, you almost certainly need to configure syslogd
  1187. so that it listens on a socket inside the Postfix queue directory.
  1188. Examples for specific systems: </p>
  1189. <dl>
  1190. <dt> FreeBSD: </dt>
  1191. <dd> <pre>
  1192. # mkdir -p /var/spool/postfix/var/run
  1193. # syslogd -l /var/spool/postfix/var/run/log
  1194. </pre> </dd>
  1195. <dt> Linux, OpenBSD: </dt>
  1196. <dd> <pre>
  1197. # mkdir -p /var/spool/postfix/dev
  1198. # syslogd -a /var/spool/postfix/dev/log
  1199. </pre> </dd>
  1200. </dl>
  1201. <h2><a name="care">12 - Care and feeding of the Postfix system</a></h2>
  1202. <p> Postfix daemon processes run in the background, and log problems
  1203. and normal activity to the syslog daemon. The names of logfiles
  1204. are specified in /etc/syslog.conf. At the very least you need
  1205. something like: </p>
  1206. <blockquote>
  1207. <pre>
  1208. /etc/syslog.conf:
  1209. mail.err /dev/console
  1210. mail.debug /var/log/maillog
  1211. </pre>
  1212. </blockquote>
  1213. <p> IMPORTANT: the syslogd will not create files. You must create
  1214. them before (re)starting syslogd. </p>
  1215. <p> IMPORTANT: on Linux you need to put a "-" character before
  1216. the pathname, e.g., -/var/log/maillog, otherwise the syslogd
  1217. will use more system resources than Postfix does. </p>
  1218. <p> Hopefully, the number of problems will be small, but it is a good
  1219. idea to run every night before the syslog files are rotated: </p>
  1220. <blockquote>
  1221. <pre>
  1222. # postfix check
  1223. # egrep '(reject|warning|error|fatal|panic):' /some/log/file
  1224. </pre>
  1225. </blockquote>
  1226. <ul>
  1227. <li> <p> The first line (postfix check) causes Postfix to report
  1228. file permission/ownership discrepancies. </p>
  1229. <li> <p> The second line looks for problem reports from the mail
  1230. software, and reports how effective the relay and junk mail access
  1231. blocks are. This may produce a lot of output. You will want to
  1232. apply some postprocessing to eliminate uninteresting information.
  1233. </p>
  1234. </ul>
  1235. <p> The <a href="DEBUG_README.html#logging"> DEBUG_README </a>
  1236. document describes the meaning of the "warning" etc. labels in
  1237. Postfix logging. </p>
  1238. </body>
  1239. </html>