1 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSA
\bAS
\bSL
\bL H
\bHo
\bow
\bwt
\bto
\bo
3 -------------------------------------------------------------------------------
5 W
\bWA
\bAR
\bRN
\bNI
\bIN
\bNG
\bG
7 People who go to the trouble of installing Postfix may have the expectation
8 that Postfix is more secure than some other mailers. The Cyrus SASL library is
9 a lot of code. With this, Postfix becomes as secure as other mail systems that
10 use the Cyrus SASL library. Dovecot provides an alternative that may be worth
13 H
\bHo
\bow
\bw P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx u
\bus
\bse
\bes
\bs S
\bSA
\bAS
\bSL
\bL a
\bau
\but
\bth
\bhe
\ben
\bnt
\bti
\bic
\bca
\bat
\bti
\bio
\bon
\bn i
\bin
\bnf
\bfo
\bor
\brm
\bma
\bat
\bti
\bio
\bon
\bn
15 Postfix SASL support (RFC 4954, formerly RFC 2554) can be used to authenticate
16 remote SMTP clients to the Postfix SMTP server, and to authenticate the Postfix
17 SMTP client to a remote SMTP server.
19 When receiving mail, the Postfix SMTP server logs the client-provided username,
20 authentication method, and sender address to the maillog file, and optionally
21 grants mail access via the permit_sasl_authenticated UCE restriction.
23 When sending mail, the Postfix SMTP client can look up the remote SMTP server
24 hostname or destination domain (the address right-hand part) in a SASL password
25 table, and if a username/password is found, it will use that username and
26 password to authenticate to the remote SMTP server. And as of version 2.3,
27 Postfix can be configured to search its SASL password table by the sender email
30 This document covers the following topics:
32 * What SASL implementations are supported
33 * Building Postfix with Dovecot SASL support
34 * Building the Cyrus SASL library
35 * Building Postfix with Cyrus SASL support
36 * Enabling SASL authentication in the Postfix SMTP server
37 * Dovecot SASL configuration for the Postfix SMTP server
38 * Cyrus SASL configuration for the Postfix SMTP server
39 * Testing SASL authentication in the Postfix SMTP server
40 * Trouble shooting the SASL internals
41 * Enabling SASL authentication in the Postfix SMTP client
42 * Supporting multiple ISP accounts in the Postfix SMTP client
45 W
\bWh
\bha
\bat
\bt S
\bSA
\bAS
\bSL
\bL i
\bim
\bmp
\bpl
\ble
\bem
\bme
\ben
\bnt
\bta
\bat
\bti
\bio
\bon
\bns
\bs a
\bar
\bre
\be s
\bsu
\bup
\bpp
\bpo
\bor
\brt
\bte
\bed
\bd
47 This document describes Postfix with the following SASL implementations:
49 * Cyrus SASL version 1 (client and server).
51 * Cyrus SASL version 2 (client and server).
53 * Dovecot protocol version 1 (server only, Postfix version 2.3 and later)
55 Postfix version 2.3 introduces a plug-in mechanism that provides support for
56 multiple SASL implementations. To find out what implementations are built into
57 Postfix, use the following commands:
59 % postconf -a (SASL support in the SMTP server)
60 % postconf -A (SASL support in the SMTP+LMTP client)
62 Needless to say, these commands are not available in earlier Postfix versions.
64 B
\bBu
\bui
\bil
\bld
\bdi
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx w
\bwi
\bit
\bth
\bh D
\bDo
\bov
\bve
\bec
\bco
\bot
\bt S
\bSA
\bAS
\bSL
\bL s
\bsu
\bup
\bpp
\bpo
\bor
\brt
\bt
66 These instructions assume that you build Postfix from source code as described
67 in the INSTALL document. Some modification may be required if you build Postfix
68 from a vendor-specific source package.
70 Support for the Dovecot version 1 SASL protocol is available in Postfix 2.3 and
71 later. At the time of writing, only server-side SASL support is available, so
72 you can't use it to authenticate to your network provider's server. Dovecot
73 uses its own daemon process for authentication. This keeps the Postfix build
74 process simple, because there is no need to link extra libraries into Postfix.
76 To generate the necessary Makefiles, execute the following in the Postfix top-
79 % make makefiles CCARGS='-DUSE_SASL_AUTH -
80 DDEF_SERVER_SASL_TYPE=\"dovecot\"'
82 After this, proceed with "make" as described in the INSTALL document.
86 * The "-DDEF_SERVER_SASL_TYPE" stuff is not necessary; it just makes Postfix
87 configuration a little more convenient because you don't have to specify
88 the SASL plug-in type in the Postfix main.cf file.
90 * If you also want support for LDAP or TLS, you will have to merge their
91 CCARGS and AUXLIBS into the above command line.
93 B
\bBu
\bui
\bil
\bld
\bdi
\bin
\bng
\bg t
\bth
\bhe
\be C
\bCy
\byr
\bru
\bus
\bs S
\bSA
\bAS
\bSL
\bL l
\bli
\bib
\bbr
\bra
\bar
\bry
\by
95 Postfix appears to work with cyrus-sasl-1.5.x or cyrus-sasl-2.1.x, which are
98 ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
100 IMPORTANT: if you install the Cyrus SASL libraries as per the default, you will
101 have to symlink /usr/lib/sasl -> /usr/local/lib/sasl for version 1.5.x or /usr/
102 lib/sasl2 -> /usr/local/lib/sasl2 for version 2.1.x.
104 Reportedly, Microsoft Outlook (Express) requires the non-standard LOGIN
105 authentication method. To enable this authentication method, specify ``./
106 configure --enable-login''.
108 B
\bBu
\bui
\bil
\bld
\bdi
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx w
\bwi
\bit
\bth
\bh C
\bCy
\byr
\bru
\bus
\bs S
\bSA
\bAS
\bSL
\bL s
\bsu
\bup
\bpp
\bpo
\bor
\brt
\bt
110 These instructions assume that you build Postfix from source code as described
111 in the INSTALL document. Some modification may be required if you build Postfix
112 from a vendor-specific source package.
114 The following assumes that the Cyrus SASL include files are in /usr/local/
115 include, and that the Cyrus SASL libraries are in /usr/local/lib.
117 On some systems this generates the necessary Makefile definitions:
119 (for Cyrus SASL version 1.5.x):
121 % make tidy # if you have left-over files from a previous build
122 % make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
123 -I/usr/local/include" AUXLIBS="-L/usr/local/lib -lsasl"
125 (for Cyrus SASL version 2.1.x):
127 % make tidy # if you have left-over files from a previous build
128 % make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
129 -I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lsasl2"
131 On Solaris 2.x you need to specify run-time link information, otherwise ld.so
132 will not find the SASL shared library:
134 (for Cyrus SASL version 1.5.x):
136 % make tidy # if you have left-over files from a previous build
137 % make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
138 -I/usr/local/include" AUXLIBS="-L/usr/local/lib \
139 -R/usr/local/lib -lsasl"
141 (for Cyrus SASL version 2.1.x):
143 % make tidy # if you have left-over files from a previous build
144 % make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
145 -I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib \
146 -R/usr/local/lib -lsasl2"
148 E
\bEn
\bna
\bab
\bbl
\bli
\bin
\bng
\bg S
\bSA
\bAS
\bSL
\bL a
\bau
\but
\bth
\bhe
\ben
\bnt
\bti
\bic
\bca
\bat
\bti
\bio
\bon
\bn i
\bin
\bn t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP s
\bse
\ber
\brv
\bve
\ber
\br
150 In order to enable SASL support in the Postfix SMTP server:
152 /etc/postfix/main.cf:
153 smtpd_sasl_auth_enable = yes
155 In order to allow mail relaying by authenticated remote SMTP clients:
157 /etc/postfix/main.cf:
158 smtpd_recipient_restrictions =
160 permit_sasl_authenticated
161 reject_unauth_destination
163 To report SASL login names in Received: message headers (Postfix version 2.3
166 /etc/postfix/main.cf:
167 smtpd_sasl_authenticated_header = yes
169 Note: the SASL login names will be shared with the entire world.
171 Older Microsoft SMTP client software implements a non-standard version of the
172 AUTH protocol syntax, and expects that the SMTP server replies to EHLO with
173 "250 AUTH=mechanism-list" instead of "250 AUTH mechanism-list". To accommodate
174 such clients (in addition to conformant clients) use the following:
176 /etc/postfix/main.cf:
177 broken_sasl_auth_clients = yes
179 D
\bDo
\bov
\bve
\bec
\bco
\bot
\bt S
\bSA
\bAS
\bSL
\bL c
\bco
\bon
\bnf
\bfi
\big
\bgu
\bur
\bra
\bat
\bti
\bio
\bon
\bn f
\bfo
\bor
\br t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP s
\bse
\ber
\brv
\bve
\ber
\br
181 Dovecot SASL support is available in Postfix 2.3 and later. On the Postfix side
182 you need to specify the location of the Dovecot authentication daemon socket.
183 We use a pathname relative to the Postfix queue directory, so that it will work
184 whether or not the Postfix SMTP server runs chrooted:
186 /etc/postfix/main.cf:
187 smtpd_sasl_type = dovecot
188 smtpd_sasl_path = private/auth
190 On the Dovecot side you also need to specify the Dovecot authentication daemon
191 socket. In this case we specify an absolute pathname. In the example we assume
192 that the Postfix queue is under /var/spool/postfix/.
194 /some/where/dovecot.conf:
196 mechanisms = plain login
203 path = /var/spool/postfix/private/auth
211 See the Dovecot documentation for how to configure and operate the Dovecot
212 authentication server.
214 C
\bCy
\byr
\bru
\bus
\bs S
\bSA
\bAS
\bSL
\bL c
\bco
\bon
\bnf
\bfi
\big
\bgu
\bur
\bra
\bat
\bti
\bio
\bon
\bn f
\bfo
\bor
\br t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP s
\bse
\ber
\brv
\bve
\ber
\br
216 You need to configure how the Cyrus SASL library should authenticate a remote
217 SMTP client's username and password. These settings must be stored in a
218 separate configuration file.
220 The name of the configuration file (default: smtpd.conf) will be constructed
221 from a value that the Postfix SMTP server sends to the Cyrus SASL library,
222 which adds the suffix .conf. The value is configured using one of the following
225 /etc/postfix/main.cf:
226 # Postfix 2.3 and later
227 smtpd_sasl_path = smtpd
229 smtpd_sasl_application_name = smtpd
231 Cyrus SASL searches for the configuration file in /usr/local/lib/sasl/ (Cyrus
232 SASL version 1.5.5) or /usr/local/lib/sasl2/ (Cyrus SASL version 2.1.x).
234 Note: some Postfix distributions are modified and look for the smtpd.conf file
235 in /etc/postfix/sasl.
237 Note: some Cyrus SASL distributions look for the smtpd.conf file in /etc/sasl2.
239 * To authenticate against the UNIX password database, use:
241 (Cyrus SASL version 1.5.x)
243 /usr/local/lib/sasl/smtpd.conf:
244 pwcheck_method: pwcheck
246 IMPORTANT: pwcheck establishes a UNIX domain socket in /var/pwcheck and
247 waits for authentication requests. The Postfix SMTP server must have
248 read+execute permission to this directory or authentication attempts
251 The pwcheck daemon is contained in the cyrus-sasl source tarball.
253 (Cyrus SASL version 1.5.26)
255 /usr/local/lib/sasl/smtpd.conf:
256 pwcheck_method: saslauthd
258 (Cyrus SASL version 2.1.x)
260 /usr/local/lib/sasl2/smtpd.conf:
261 pwcheck_method: saslauthd
262 mech_list: PLAIN LOGIN
264 The saslauthd daemon is also contained in the cyrus-sasl source tarball. It
265 is more flexible than the pwcheck daemon, in that it can authenticate
266 against PAM and various other sources. To use PAM, start saslauthd with "-
269 IMPORTANT: saslauthd usually establishes a UNIX domain socket in /var/run/
270 saslauthd and waits for authentication requests. The Postfix SMTP server
271 must have read+execute permission to this directory or authentication
274 Note: The directory where saslauthd puts the socket is configurable. See
275 the command-line option "-m /path/to/socket" in the saslauthd --help
278 * To authenticate against Cyrus SASL's own password database:
280 (Cyrus SASL version 1.5.x)
282 /usr/local/lib/sasl/smtpd.conf:
283 pwcheck_method: sasldb
285 (Cyrus SASL version 2.1.x)
287 /usr/local/lib/sasl2/smtpd.conf:
288 pwcheck_method: auxprop
289 auxprop_plugin: sasldb
290 mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
292 This will use the Cyrus SASL password file (default: /etc/sasldb in version
293 1.5.x, or /etc/sasldb2 in version 2.1.x), which is maintained with the
294 saslpasswd or saslpasswd2 command (part of the Cyrus SASL software). On
295 some poorly-supported systems the saslpasswd command needs to be run
296 multiple times before it stops complaining. The Postfix SMTP server needs
297 read access to the sasldb file - you may have to play games with group
298 access permissions. With the OTP authentication mechanism, the Postfix SMTP
299 server also needs WRITE access to /etc/sasldb2 or /etc/sasldb (or the back
300 end SQL database, if used).
302 IMPORTANT: To get sasldb running, make sure that you set the SASL domain
303 (realm) to a fully qualified domain name.
307 (Cyrus SASL version 1.5.x)
309 % saslpasswd -c -u `postconf -h myhostname` exampleuser
311 (Cyrus SASL version 2.1.x)
313 % saslpasswd2 -c -u `postconf -h myhostname` exampleuser
315 You can find out SASL's idea about the realms of the users in sasldb with
316 sasldblistusers (Cyrus SASL version 1.5.x) or sasldblistusers2 (Cyrus SASL
319 On the Postfix side, you can have only one realm per smtpd(8) instance, and
320 only the users belonging to that realm would be able to authenticate. The
321 Postfix variable smtpd_sasl_local_domain controls the realm used by smtpd
324 /etc/postfix/main.cf:
325 smtpd_sasl_local_domain = $myhostname
327 IMPORTANT: The Cyrus SASL password verification services pwcheck and saslauthd
328 can only support the plaintext mechanisms PLAIN or LOGIN. However, the Cyrus
329 SASL library doesn't know this, and will happily advertise other authentication
330 mechanisms that the SASL library implements, such as DIGEST-MD5. As a result,
331 if a remote SMTP client chooses any mechanism other than PLAIN or LOGIN while
332 pwcheck or saslauthd are used, authentication will fail. Thus you may need to
333 limit the list of mechanisms advertised by the Postfix SMTP server.
335 * With older Cyrus SASL versions you remove the corresponding library files
336 from the SASL plug-in directory (and again whenever the system is updated).
338 * With Cyrus SASL version 2.1.x or later the mech_list variable can specify a
339 list of authentication mechanisms that Cyrus SASL may offer:
341 /usr/local/lib/sasl2/smtpd.conf:
342 mech_list: plain login
344 For the same reasons you might want to limit the list of plugins used for
347 * With Cyrus SASL version 1.5.x your only choice is to delete the
348 corresponding library files from the SASL plug-in directory.
350 * With SASL version 2.1.x:
352 /usr/local/lib/sasl2/smtpd.conf:
353 pwcheck_method: auxprop
356 To run software chrooted with SASL support is an interesting exercise. It
357 probably is not worth the trouble.
359 T
\bTe
\bes
\bst
\bti
\bin
\bng
\bg S
\bSA
\bAS
\bSL
\bL a
\bau
\but
\bth
\bhe
\ben
\bnt
\bti
\bic
\bca
\bat
\bti
\bio
\bon
\bn i
\bin
\bn t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP s
\bse
\ber
\brv
\bve
\ber
\br
361 To test the server side, connect (for example, with telnet) to the Postfix SMTP
362 server port and you should be able to have a conversation as shown below.
363 Information sent by the client (that is, you) is shown in bold font.
365 $ t
\bte
\bel
\bln
\bne
\bet
\bt s
\bse
\ber
\brv
\bve
\ber
\br.
\b.e
\bex
\bxa
\bam
\bmp
\bpl
\ble
\be.
\b.c
\bco
\bom
\bm 2
\b25
\b5
367 220 server.example.com ESMTP Postfix
368 E
\bEH
\bHL
\bLO
\bO c
\bcl
\bli
\bie
\ben
\bnt
\bt.
\b.e
\bex
\bxa
\bam
\bmp
\bpl
\ble
\be.
\b.c
\bco
\bom
\bm
369 250-server.example.com
373 250-AUTH DIGEST-MD5 PLAIN CRAM-MD5
375 A
\bAU
\bUT
\bTH
\bH P
\bPL
\bLA
\bAI
\bIN
\bN A
\bAH
\bHR
\bRl
\blc
\bc3
\b3Q
\bQA
\bAd
\bdG
\bGV
\bVz
\bzd
\bdH
\bHB
\bBh
\bhc
\bc3
\b3M
\bM=
\b=
376 235 Authentication successful
378 Instead of AHRlc3QAdGVzdHBhc3M=, specify the base64 encoded form of
379 \0username\0password (the \0 is a null byte). The example above is for a user
380 named `test' with password `testpass'.
382 In order to generate base64 encoded authentication information you can use one
383 of the following commands:
385 % printf '\0username\0password' | mmencode
387 % perl -MMIME::Base64 -e \
388 'print encode_base64("\0username\0password");'
390 The mmencode command is part of the metamail software. MIME::Base64 is
391 available from http://www.cpan.org/.
393 Caution: when posting logs of the SASL negotiations to public lists, please
394 keep in mind that username/password information is trivial to recover from the
397 T
\bTr
\bro
\bou
\bub
\bbl
\ble
\be s
\bsh
\bho
\boo
\bot
\bti
\bin
\bng
\bg t
\bth
\bhe
\be S
\bSA
\bAS
\bSL
\bL i
\bin
\bnt
\bte
\ber
\brn
\bna
\bal
\bls
\bs
399 In the Cyrus SASL sources you'll find a subdirectory named "sample". Run make
400 there, then create a symbolic link from sample.conf to smtpd.conf in your Cyrus
401 SASL library directory /usr/local/lib/sasl2. "su" to the user postfix (or
402 whatever your mail_owner directive is set to):
406 then run the resulting sample Cyrus SASL server and client in separate
407 terminals. The sample applications send log messages to the syslog facility
408 auth. Check the log to fix the problem or run strace / ktrace / truss on the
409 server to see what makes it unhappy. Repeat the previous step until you can
410 successfully authenticate with the sample Cyrus SASL client. Only then get back
413 E
\bEn
\bna
\bab
\bbl
\bli
\bin
\bng
\bg S
\bSA
\bAS
\bSL
\bL a
\bau
\but
\bth
\bhe
\ben
\bnt
\bti
\bic
\bca
\bat
\bti
\bio
\bon
\bn i
\bin
\bn t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP c
\bcl
\bli
\bie
\ben
\bnt
\bt
415 Turn on client-side SASL authentication, and specify a table with per-host or
416 per-destination username and password information. The Postfix SMTP client
417 first searches the table for an entry with the remote SMTP server hostname; if
418 no entry is found, then the Postfix SMTP client searches the table for an entry
419 with the next-hop destination. Usually, that is the right-hand part of an email
420 address, but it can also be the information that is specified with the
421 relayhost parameter or with a transport(5) table.
423 /etc/postfix/main.cf:
424 smtp_sasl_auth_enable = yes
425 smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
426 smtp_sasl_type = cyrus
427 relayhost = [mail.myisp.net]
429 # relayhost = [mail.myisp.net]:submission
431 /etc/postfix/sasl_passwd:
432 [mail.myisp.net] username:password
433 [mail.myisp.net]:submission username:password
437 * The "submission" destination port tells Postfix to send mail via TCP
438 network port 587, which is normally reserved for email clients. The default
439 is to send mail to the "smtp" destination port (TCP port 25), which is used
440 for receiving mail across the internet. If you use an explicit destination
441 port in main.cf, then you must use the same form also in the
442 smtp_sasl_password_maps file.
444 * Postfix does not deliver mail via TCP port 465 (the obsolete "wrappermode"
445 protocol). See TLS_README for a solution that uses the "stunnel" command.
447 * The "[" and "]" prevent Postfix from looking up the MX (mail exchanger)
448 records for the enclosed name. If you use this form in main.cf, then you
449 must use the same form also in the smtp_sasl_password_maps file.
451 * The Postfix SMTP client opens the SASL client password file before entering
452 the optional chroot jail, so you can keep the file in /etc/postfix and set
453 permissions read / write only for root to keep the username:password
454 combinations away from other system users.
456 * Specify d
\bdb
\bbm
\bm instead of h
\bha
\bas
\bsh
\bh if your system uses d
\bdb
\bbm
\bm files instead of d
\bdb
\bb
457 files. To find out what lookup tables Postfix supports, use the command
458 "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
460 * Execute the command "p
\bpo
\bos
\bst
\btm
\bma
\bap
\bp /
\b/e
\bet
\btc
\bc/
\b/p
\bpo
\bos
\bst
\btf
\bfi
\bix
\bx/
\b/s
\bsa
\bas
\bsl
\bl_
\b_p
\bpa
\bas
\bss
\bsw
\bwd
\bd" whenever you change
461 the sasl_passwd table.
465 * Some remote SMTP servers support PLAIN or LOGIN authentication only. By
466 default, the Postfix SMTP client does not use authentication methods that
467 send plaintext passwords, and defers delivery with the following error
468 message: "Authentication failed: cannot SASL authenticate to server". To
469 enable plaintext authentication specify, for example:
471 /etc/postfix/main.cf:
472 smtp_sasl_security_options = noanonymous
474 * Some remote SMTP servers announce authentication mechanisms that don't
475 actually work. It is possible via the smtp_sasl_mechanism_filter parameter
476 to restrict the list of server mechanisms that the Postfix SMTP client will
477 take into consideration:
479 /etc/postfix/main.cf:
480 smtp_sasl_mechanism_filter = !gssapi, !external, static:all
482 In the above example, the Postfix SMTP client will decline to use
483 mechanisms that require special infrastructure such as Kerberos or TLS.
485 * The Postfix SMTP client is backwards compatible with SMTP servers that use
486 the non-standard "AUTH=method..." syntax in response to the EHLO command;
487 there is no Postfix client configuration needed to work around it.
489 S
\bSu
\bup
\bpp
\bpo
\bor
\brt
\bti
\bin
\bng
\bg m
\bmu
\bul
\blt
\bti
\bip
\bpl
\ble
\be I
\bIS
\bSP
\bP a
\bac
\bcc
\bco
\bou
\bun
\bnt
\bts
\bs i
\bin
\bn t
\bth
\bhe
\be P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSM
\bMT
\bTP
\bP c
\bcl
\bli
\bie
\ben
\bnt
\bt
491 Postfix version 2.3 supports multiple ISP accounts. This can be useful when one
492 person uses the same machine for work and for personal use, or when people with
493 different ISP accounts share the same Postfix server. To make this possible,
494 Postfix 2.3 supports per-sender SASL passwords and per-sender relay hosts. In
495 the example below, Postfix will search the SASL password file by sender before
496 it searches that same file by destination. Likewise, Postfix will search the
497 per-sender relayhost file, and use the default relayhost only as a final
500 /etc/postfix/main.cf:
501 smtp_sender_dependent_authentication = yes
502 sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
503 smtp_sasl_auth_enable = yes
504 smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
505 relayhost = [mail.myisp.net]
507 # relayhost = [mail.myisp.net]:submission
509 /etc/postfix/sasl_passwd:
510 # Per-sender authentication; see also /etc/postfix/sender_relay.
511 user1@example.com username2:password2
512 user2@example.net username2:password2
513 # Login information for the default relayhost.
514 [mail.myisp.net] username:password
515 [mail.myisp.net]:submission username:password
517 /etc/postfix/sender_relay:
518 # Per-sender provider; see also /etc/postfix/sasl_passwd.
519 user1@example.com [mail.example.com]:submission
520 user2@example.net [mail.example.net]
524 * If you are creative, then you can try to combine the two tables into one
525 single MySQL database, and configure different Postfix queries to extract
526 the appropriate information.
528 * Specify d
\bdb
\bbm
\bm instead of h
\bha
\bas
\bsh
\bh if your system uses d
\bdb
\bbm
\bm files instead of d
\bdb
\bb
529 files. To find out what lookup tables Postfix supports, use the command
530 "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
532 * Execute the command "p
\bpo
\bos
\bst
\btm
\bma
\bap
\bp /
\b/e
\bet
\btc
\bc/
\b/p
\bpo
\bos
\bst
\btf
\bfi
\bix
\bx/
\b/s
\bsa
\bas
\bsl
\bl_
\b_p
\bpa
\bas
\bss
\bsw
\bwd
\bd" whenever you change
533 the sasl_passwd table.
535 * Execute the command "p
\bpo
\bos
\bst
\btm
\bma
\bap
\bp /
\b/e
\bet
\btc
\bc/
\b/p
\bpo
\bos
\bst
\btf
\bfi
\bix
\bx/
\b/s
\bse
\ben
\bnd
\bde
\ber
\br_
\b_r
\bre
\bel
\bla
\bay
\by" whenever you change
536 the sender_relay table.
538 C
\bCr
\bre
\bed
\bdi
\bit
\bts
\bs
540 * Postfix SASL support was originally implemented by Till Franke of SuSE
542 * Wietse trimmed down the code to only the bare necessities.
543 * Support for Cyrus SASL version 2 was contributed by Jason Hoos.
544 * Liviu Daia added smtpd_sasl_application_name, split
545 reject_sender_login_mismatch into
546 reject_authenticated_sender_login_mismatch and
547 reject_unauthenticated_sender_login_mismatch, and revised the docs.
548 * Wietse made another iteration through the code to add plug-in support for
549 multiple SASL implementations, and changed smtpd_sasl_application_name into
551 * The Dovecot SMTP server-only plug-in was originally implemented by Timo
552 Sirainen of Procontrol, Finland.
553 * Patrick Ben Koetter revised this document for Postfix 2.4 and made much