1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "https://www.w3.org/TR/html4/loose.dtd"> 3 4 <html> 5 6 <head> 7 8 <title>Postfix and Linux</title> 9 10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 11 <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 12 13 </head> 14 15 <body> 16 17 <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix and Linux</h1> 18 19 <hr> 20 21 <h2> Host lookup issues </h2> 22 23 <p> By default Linux /etc/hosts lookups do not support multiple IP 24 addresses per hostname. This causes warnings from the Postfix SMTP 25 server that "hostname XXX does not resolve to address YYY", and is 26 especially a problem with hosts that have both IPv4 and IPv6 27 addresses. To fix this, turn on support for multiple IP addresses: </p> 28 29 <blockquote> 30 <pre> 31 /etc/host.conf: 32 ... 33 # We have machines with multiple IP addresses. 34 multi on 35 ... 36 </pre> 37 </blockquote> 38 39 <p> Alternatively, specify the RESOLV_MULTI environment variable 40 in main.cf: </p> 41 42 <blockquote> 43 <pre> 44 /etc/postfix/main.cf: 45 import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C RESOLV_MULTI=on 46 </pre> 47 </blockquote> 48 49 <h2>Berkeley DB issues</h2> 50 51 <p> If you can't compile Postfix because the file "db.h" 52 isn't found, then you MUST install the Berkeley DB development 53 package (name: db???-devel-???) that matches your system library. 54 You can find out what is installed with the rpm command. For example: 55 </p> 56 57 <blockquote> 58 <pre> 59 $ <b>rpm -qf /usr/lib/libdb.so</b> 60 db4-4.3.29-2 61 </pre> 62 </blockquote> 63 64 <p> This means that you need to install db4-devel-4.3.29-2 (on 65 some systems, specify "<b>rpm -qf /lib/libdb.so</b>" instead). </p> 66 67 <p> DO NOT download some Berkeley DB version from the network. 68 Every Postfix program will dump core when it is built with a different 69 Berkeley DB version than the version that is used by the system 70 library routines. See the DB_README file for further information. 71 </p> 72 73 <h2>Procmail issues</h2> 74 75 <p> On RedHat Linux 7.1 and later <b>procmail</b> no longer has 76 permission 77 to write to the mail spool directory. Workaround: </p> 78 79 <blockquote> 80 <pre> 81 # chmod 1777 /var/spool/mail 82 </pre> 83 </blockquote> 84 85 <h2>Logging in a container</h2> 86 87 <p> When running Postfix inside a container, you can use stdout 88 logging as described in MAILLOG_README. Alternatives: run syslogd 89 inside the container, or mount the host's syslog socket inside the 90 container. </p> 91 92 <h2>Syslogd performance</h2> 93 94 <p> LINUX <b>syslogd</b> uses synchronous writes by default. Because 95 of this, <b>syslogd</b> can actually use more system resources than 96 Postfix. To avoid such badness, disable synchronous mail logfile 97 writes by editing /etc/syslog.conf and by prepending a - to the 98 logfile name: </p> 99 100 <blockquote> 101 <pre> 102 /etc/syslog.conf: 103 mail.* -/var/log/mail.log 104 </pre> 105 </blockquote> 106 107 <p> Send a "<b>kill -HUP</b>" to the <b>syslogd</b> to make the 108 change effective. </p> 109 110 <h2>Other logging performance issues</h2> 111 112 <p> LINUX <b>systemd</b> intercepts all logging and enforces its 113 own rate limits before handing off requests to a backend such as 114 <b>rsyslogd</b> or <b>syslog-ng</b>. On a busy mail server this can 115 result in information loss. As a workaround, you can use Postfix's 116 built-in logging as described in MAILLOG_README. </p> 117 118 </body> 119 120 </html> 121