1 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx S
\bSt
\bta
\ban
\bnd
\bda
\bar
\brd
\bd C
\bCo
\bon
\bnf
\bfi
\big
\bgu
\bur
\bra
\bat
\bti
\bio
\bon
\bn E
\bEx
\bxa
\bam
\bmp
\bpl
\ble
\bes
\bs
3 -------------------------------------------------------------------------------
5 P
\bPu
\bur
\brp
\bpo
\bos
\bse
\be o
\bof
\bf t
\bth
\bhi
\bis
\bs d
\bdo
\boc
\bcu
\bum
\bme
\ben
\bnt
\bt
7 This document presents a number of typical Postfix configurations. This
8 document should be reviewed after you have followed the basic configuration
9 steps as described in the BASIC_CONFIGURATION_README document. In particular,
10 do not proceed here if you don't already have Postfix working for local mail
11 submission and for local mail delivery.
13 The first part of this document presents standard configurations that each
14 solve one specific problem.
16 * Postfix on a stand-alone Internet host
17 * Postfix on a null client
18 * Postfix on a local network
19 * Postfix email firewall/gateway
21 The second part of this document presents additional configurations for hosts
22 in specific environments.
24 * Delivering some but not all accounts locally
25 * Running Postfix behind a firewall
26 * Configuring Postfix as primary or backup MX host for a remote site
27 * Postfix on a dialup machine
28 * Postfix on hosts without a real Internet hostname
30 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx o
\bon
\bn a
\ba s
\bst
\bta
\ban
\bnd
\bd-
\b-a
\bal
\blo
\bon
\bne
\be I
\bIn
\bnt
\bte
\ber
\brn
\bne
\bet
\bt h
\bho
\bos
\bst
\bt
32 Postfix should work out of the box without change on a stand-alone machine that
33 has direct Internet access. At least, that is how Postfix installs when you
34 download the Postfix source code via http://www.postfix.org/.
36 You can use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-n
\bn" to find out what settings are overruled
37 by your main.cf. Besides a few pathname settings, few parameters should be set
38 on a stand-alone box, beyond what is covered in the BASIC_CONFIGURATION_README
42 # Optional: send mail as user@domainname instead of user@hostname.
45 # Optional: specify NAT/proxy external address.
46 #proxy_interfaces = 1.2.3.4
48 # Alternative 1: don't relay mail from other hosts.
49 mynetworks_style = host
52 # Alternative 2: relay mail from local clients only.
53 # mynetworks = 192.168.1.0/28
56 See also the section "Postfix on hosts without a real Internet hostname" if
57 this is applicable to your configuration.
59 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx o
\bon
\bn a
\ba n
\bnu
\bul
\bll
\bl c
\bcl
\bli
\bie
\ben
\bnt
\bt
61 A null client is a machine that can only send mail. It receives no mail from
62 the network, and it does not deliver any mail locally. A null client typically
63 uses POP, IMAP or NFS for mailbox access.
65 In this example we assume that the Internet domain name is "example.com" and
66 that the machine is named "nullclient.example.com". As usual, the examples show
67 only parameters that are not left at their default settings.
69 1 /etc/postfix/main.cf:
70 2 myorigin = $mydomain
71 3 relayhost = $mydomain
72 4 inet_interfaces = loopback-only
73 5 local_transport = error:local delivery is disabled
75 7 /etc/postfix/master.cf:
76 8 Comment out the local delivery agent entry
80 * Line 2: Send mail as "user@example.com" (instead of
81 "user@nullclient.example.com"), so that nothing ever has a reason to send
82 mail to "user@nullclient.example.com".
84 * Line 3: Forward all mail to the mail server that is responsible for the
85 "example.com" domain. This prevents mail from getting stuck on the null
86 client if it is turned off while some remote destination is unreachable.
88 * Line 4: Do not accept mail from the network.
90 * Lines 5-8: Disable local mail delivery. All mail goes to the mail server as
93 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx o
\bon
\bn a
\ba l
\blo
\boc
\bca
\bal
\bl n
\bne
\bet
\btw
\bwo
\bor
\brk
\bk
95 This section describes a local area network environment of one main server and
96 multiple other systems that send and receive email. As usual we assume that the
97 Internet domain name is "example.com". All systems are configured to send mail
98 as "user@example.com", and all systems receive mail for
99 "user@hostname.example.com". The main server also receives mail for
100 "user@example.com". We call this machine by the name of mailhost.example.com.
102 A drawback of sending mail as "user@example.com" is that mail for "root" and
103 other system accounts is also sent to the central mailhost. See the section
104 "Delivering some but not all accounts locally" below for possible solutions.
106 As usual, the examples show only parameters that are not left at their default
109 First we present the non-mailhost configuration, because it is the simpler one.
110 This machine sends mail as "user@example.com" and is final destination for
111 "user@hostname.example.com".
113 1 /etc/postfix/main.cf:
114 2 myorigin = $mydomain
115 3 mynetworks = 127.0.0.0/8 10.0.0.0/24
117 5 # Optional: forward all non-local mail to mailhost
118 6 #relayhost = $mydomain
122 * Line 2: Send mail as "user@example.com".
124 * Line 3: Specify the trusted networks.
126 * Line 4: This host does not relay mail from untrusted networks.
128 * Line 6: This is needed if no direct Internet access is available. See also
129 below, "Postfix behind a firewall".
131 Next we present the mailhost configuration. This machine sends mail as
132 "user@example.com" and is final destination for "user@hostname.example.com" as
133 well as "user@example.com".
136 2 example.com IN MX 10 mailhost.example.com.
138 4 /etc/postfix/main.cf:
139 5 myorigin = $mydomain
140 6 mydestination = $myhostname localhost.$mydomain localhost $mydomain
141 7 mynetworks = 127.0.0.0/8 10.0.0.0/24
143 9 # Optional: forward all non-local mail to firewall
144 10 #relayhost = [firewall.example.com]
148 * Line 2: Send mail for the domain "example.com" to the machine
149 mailhost.example.com. Remember to specify the "." at the end of the line.
151 * Line 5: Send mail as "user@example.com".
153 * Line 6: This host is the final mail destination for the "example.com"
154 domain, in addition to the names of the machine itself.
156 * Line 7: Specify the trusted networks.
158 * Line 8: This host does not relay mail from untrusted networks.
160 * Line 10: This is needed only when the mailhost has to forward non-local
161 mail via a mail server on a firewall. The [] forces Postfix to do no MX
164 In an environment like this, users access their mailbox in one or more of the
167 * Mailbox access via NFS or equivalent.
169 * Mailbox access via POP or IMAP.
171 * Mailbox on the user's preferred machine.
173 In the latter case, each user has an alias on the mailhost that forwards mail
174 to her preferred machine:
177 joe: joe@joes.preferred.machine
178 jane: jane@janes.preferred.machine
180 On some systems the alias database is not in /etc/aliases. To find out the
181 location for your system, execute the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf a
\bal
\bli
\bia
\bas
\bs_
\b_m
\bma
\bap
\bps
\bs".
183 Execute the command "n
\bne
\bew
\bwa
\bal
\bli
\bia
\bas
\bse
\bes
\bs" whenever you change the aliases file.
185 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx e
\bem
\bma
\bai
\bil
\bl f
\bfi
\bir
\bre
\bew
\bwa
\bal
\bll
\bl/
\b/g
\bga
\bat
\bte
\bew
\bwa
\bay
\by
187 The idea is to set up a Postfix email firewall/gateway that forwards mail for
188 "example.com" to an inside gateway machine but rejects mail for
189 "anything.example.com". There is only one problem: with "relay_domains =
190 example.com", the firewall normally also accepts mail for
191 "anything.example.com". That would not be right.
193 Note: this example requires Postfix version 2.0 and later. To find out what
194 Postfix version you have, execute the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf m
\bma
\bai
\bil
\bl_
\b_v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn".
196 The solution is presented in multiple parts. This first part gets rid of local
197 mail delivery on the firewall, making the firewall harder to break.
199 1 /etc/postfix/main.cf:
200 2 myorigin = example.com
202 4 local_recipient_maps =
203 5 local_transport = error:local mail delivery is disabled
205 7 /etc/postfix/master.cf:
206 8 Comment out the local delivery agent
210 * Line 2: Send mail from this machine as "user@example.com", so that no
211 reason exists to send mail to "user@firewall.example.com".
213 * Lines 3-8: Disable local mail delivery on the firewall machine.
215 For the sake of technical correctness the firewall must be able to receive mail
216 for postmaster@[firewall ip address]. Reportedly, some things actually expect
217 this ability to exist. The second part of the solution therefore adds support
218 for postmaster@[firewall ip address], and as a bonus we do abuse@[firewall ip
219 address] as well. All the mail to these two accounts is forwarded to an inside
222 1 /etc/postfix/main.cf:
223 2 virtual_alias_maps = hash:/etc/postfix/virtual
225 4 /etc/postfix/virtual:
226 5 postmaster postmaster@example.com
227 6 abuse abuse@example.com
231 * Because mydestination is empty (see the previous example), only address
232 literals matching $inet_interfaces or $proxy_interfaces are deemed local.
233 So "localpart@[a.d.d.r]" can be matched as simply "localpart" in canonical
234 (5) and virtual(5). This avoids the need to specify firewall IP addresses
235 into Postfix configuration files.
237 The last part of the solution does the email forwarding, which is the real
238 purpose of the firewall email function.
240 1 /etc/postfix/main.cf:
241 2 mynetworks = 127.0.0.0/8 12.34.56.0/24
242 3 relay_domains = example.com
243 4 parent_domain_matches_subdomains =
244 5 debug_peer_list smtpd_access_maps
245 6 smtpd_recipient_restrictions =
246 7 permit_mynetworks reject_unauth_destination
248 9 relay_recipient_maps = hash:/etc/postfix/relay_recipients
249 10 transport_maps = hash:/etc/postfix/transport
251 12 /etc/postfix/relay_recipients:
252 13 user1@example.com x
253 14 user2@example.com x
256 17 /etc/postfix/transport:
257 18 example.com smtp:[inside-gateway.example.com]
261 * Lines 1-7: Accept mail from local systems in $mynetworks, and accept mail
262 from outside for "user@example.com" but not for
263 "user@anything.example.com". The magic is in lines 4-5.
265 * Lines 9, 12-14: Define the list of valid addresses in the "example.com"
266 domain that can receive mail from the Internet. This prevents the mail
267 queue from filling up with undeliverable MAILER-DAEMON messages. If you
268 can't maintain a list of valid recipients then you must specify
269 "relay_recipient_maps =" (that is, an empty value), or you must specify an
270 "@example.com x" wild-card in the relay_recipients table.
272 * Lines 10, 17-18: Route mail for "example.com" to the inside gateway
273 machine. The [] forces Postfix to do no MX lookup.
275 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 files.
276 To find out what lookup tables Postfix supports, use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
278 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/r
\bre
\bel
\bla
\bay
\by_
\b_r
\bre
\bec
\bci
\bip
\bpi
\bie
\ben
\bnt
\bts
\bs" whenever you change
279 the relay_recipients table.
281 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/t
\btr
\bra
\ban
\bns
\bsp
\bpo
\bor
\brt
\bt" whenever you change the
284 In some installations, there may be separate instances of Postfix processing
285 inbound and outbound mail on a multi-homed firewall. The inbound Postfix
286 instance has an SMTP server listening on the external firewall interface, and
287 the outbound Postfix instance has an SMTP server listening on the internal
288 interface. In such a configuration is it is tempting to configure
289 $inet_interfaces in each instance with just the corresponding interface
292 In most cases, using inet_interfaces in this way will not work, because as
293 documented in the $inet_interfaces reference manual, the smtp(8) delivery agent
294 will also use the specified interface address as the source address for
295 outbound connections and will be unable to reach hosts on "the other side" of
296 the firewall. The symptoms are that the firewall is unable to connect to hosts
297 that are in fact up. See the inet_interfaces parameter documentation for
298 suggested work-arounds.
300 D
\bDe
\bel
\bli
\biv
\bve
\ber
\bri
\bin
\bng
\bg s
\bso
\bom
\bme
\be b
\bbu
\but
\bt n
\bno
\bot
\bt a
\bal
\bll
\bl a
\bac
\bcc
\bco
\bou
\bun
\bnt
\bts
\bs l
\blo
\boc
\bca
\bal
\bll
\bly
\by
302 A drawback of sending mail as "user@example.com" (instead of
303 "user@hostname.example.com") is that mail for "root" and other system accounts
304 is also sent to the central mailhost. In order to deliver such accounts
305 locally, you can set up virtual aliases as follows:
307 1 /etc/postfix/main.cf:
308 2 virtual_alias_maps = hash:/etc/postfix/virtual
310 4 /etc/postfix/virtual:
311 5 root root@localhost
316 * Line 5: As described in the virtual(5) manual page, the bare name "root"
317 matches "root@site" when "site" is equal to $myorigin, when "site" is
318 listed in $mydestination, or when it matches $inet_interfaces or
321 R
\bRu
\bun
\bnn
\bni
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx b
\bbe
\beh
\bhi
\bin
\bnd
\bd a
\ba f
\bfi
\bir
\bre
\bew
\bwa
\bal
\bll
\bl
323 The simplest way to set up Postfix on a host behind a firewalled network is to
324 send all mail to a gateway host, and to let that mail host take care of
325 internal and external forwarding. Examples of that are shown in the local area
326 network section above. A more sophisticated approach is to send only external
327 mail to the gateway host, and to send intranet mail directly. That's what
330 Note: this example requires Postfix version 2.0 and later. To find out what
331 Postfix version you have, execute the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf m
\bma
\bai
\bil
\bl_
\b_v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn".
333 The following example presents additional configuration. You need to combine
334 this with basic configuration information as discussed the first half of this
337 1 /etc/postfix/main.cf:
338 2 transport_maps = hash:/etc/postfix/transport
340 4 # Optional for a machine that isn't "always on"
341 5 #fallback_relay = [gateway.example.com]
343 7 /etc/postfix/transport:
344 8 # Internal delivery.
347 11 # External delivery.
348 12 * smtp:[gateway.example.com]
352 * Lines 2, 7-12: Request that intranet mail is delivered directly, and that
353 external mail is given to a gateway. Obviously, this example assumes that
354 the organization uses DNS MX records internally. The [] forces Postfix to
357 * Line 3: IMPORTANT: do not specify a relayhost in main.cf.
359 * Line 5: This prevents mail from being stuck in the queue when the machine
360 is turned off. Postfix tries to deliver mail directly, and gives
361 undeliverable mail to a gateway.
363 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 files.
364 To find out what lookup tables Postfix supports, use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
366 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/t
\btr
\bra
\ban
\bns
\bsp
\bpo
\bor
\brt
\bt" whenever you edit the
369 C
\bCo
\bon
\bnf
\bfi
\big
\bgu
\bur
\bri
\bin
\bng
\bg P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx a
\bas
\bs p
\bpr
\bri
\bim
\bma
\bar
\bry
\by o
\bor
\br b
\bba
\bac
\bck
\bku
\bup
\bp M
\bMX
\bX h
\bho
\bos
\bst
\bt f
\bfo
\bor
\br a
\ba r
\bre
\bem
\bmo
\bot
\bte
\be s
\bsi
\bit
\bte
\be
371 This section presents additional configuration. You need to combine this with
372 basic configuration information as discussed the first half of this document.
374 When your system is SECONDARY MX host for a remote site this is all you need:
377 2 the.backed-up.domain.tld IN MX 100 your.machine.tld.
379 4 /etc/postfix/main.cf:
380 5 relay_domains = . . . the.backed-up.domain.tld
381 6 smtpd_recipient_restrictions =
382 7 permit_mynetworks reject_unauth_destination
384 9 # You must specify your NAT/proxy external address.
385 10 #proxy_interfaces = 1.2.3.4
387 12 relay_recipient_maps = hash:/etc/postfix/relay_recipients
389 14 /etc/postfix/relay_recipients:
390 15 user1@the.backed-up.domain.tld x
391 16 user2@the.backed-up.domain.tld x
394 When your system is PRIMARY MX host for a remote site you need the above, plus:
396 18 /etc/postfix/main.cf:
397 19 transport_maps = hash:/etc/postfix/transport
399 21 /etc/postfix/transport:
400 22 the.backed-up.domain.tld relay:[their.mail.host.tld]
404 * Do not list the.backed-up.domain.tld in mydestination.
406 * Do not list the.backed-up.domain.tld in virtual_alias_domains.
408 * Do not list the.backed-up.domain.tld in virtual_mailbox_domains.
410 * Lines 1-7: Forward mail from the Internet for "the.backed-up.domain.tld" to
411 the primary MX host for that domain.
413 * Line 10: This is a must if Postfix receives mail via a NAT relay or proxy
414 that presents a different IP address to the world than the local machine.
416 * Lines 12-16: Define the list of valid addresses in the "the.backed-
417 up.domain.tld" domain. This prevents your mail queue from filling up with
418 undeliverable MAILER-DAEMON messages. If you can't maintain a list of valid
419 recipients then you must specify "relay_recipient_maps =" (that is, an
420 empty value), or you must specify an "@the.backed-up.domain.tld x" wild-
421 card in the relay_recipients table.
423 * Line 22: The [] forces Postfix to do no MX lookup.
425 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 files.
426 To find out what lookup tables Postfix supports, use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
428 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/t
\btr
\bra
\ban
\bns
\bsp
\bpo
\bor
\brt
\bt" whenever you change the
431 NOTE for Postfix < 2.2: Do not use the fallback_relay feature when relaying
432 mail for a backup or primary MX domain. Mail would loop between the Postfix MX
433 host and the fallback_relay host when the final destination is unavailable.
435 * In main.cf specify "relay_transport = relay",
436 * In master.cf specify "-o fallback_relay =" at the end of the relay entry.
437 * In transport maps, specify "relay:nexthop..." as the right-hand side for
438 backup or primary MX domain entries.
440 These are default settings in Postfix version 2.2 and later.
442 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx o
\bon
\bn a
\ba d
\bdi
\bia
\bal
\blu
\bup
\bp m
\bma
\bac
\bch
\bhi
\bin
\bne
\be
444 This section applies to dialup connections that are down most of the time. For
445 dialup connections that are up 24x7, see the local area network section above.
447 This section presents additional configuration. You need to combine this with
448 basic configuration information as discussed the first half of this document.
450 If you do not have your own hostname and IP address (usually with dialup, cable
451 TV or DSL connections) then you should also study the section on "Postfix on
452 hosts without a real Internet hostname".
454 * Route all outgoing mail to your network provider.
455 If your machine is disconnected most of the time, there isn't a lot of
456 opportunity for Postfix to deliver mail to hard-to-reach corners of the
457 Internet. It's better to give the mail to a machine that is connected all
458 the time. In the example below, the [] prevents Postfix from trying to look
461 /etc/postfix/main.cf:
462 relayhost = [smtprelay.someprovider.com]
464 * Disable spontaneous SMTP mail delivery (if using on-demand dialup IP only).
466 Normally, Postfix attempts to deliver outbound mail at its convenience. If
467 your machine uses on-demand dialup IP, this causes your system to place a
468 telephone call whenever you submit new mail, and whenever Postfix retries
469 to deliver delayed mail. To prevent such telephone calls from being placed,
470 disable spontaneous SMTP mail deliveries.
472 /etc/postfix/main.cf:
473 defer_transports = smtp (Only for on-demand dialup IP hosts)
475 * Disable SMTP client DNS lookups (dialup LAN only).
477 /etc/postfix/main.cf:
478 disable_dns_lookups = yes (Only for on-demand dialup IP hosts)
480 * Flush the mail queue whenever the Internet link is established.
481 Put the following command into your PPP or SLIP dialup scripts:
483 /usr/sbin/sendmail -q (whenever the Internet link is up)
485 The exact location of the Postfix sendmail command is system-specific. Use
486 the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf s
\bse
\ben
\bnd
\bdm
\bma
\bai
\bil
\bl_
\b_p
\bpa
\bat
\bth
\bh" to find out where the Postfix sendmail
487 command is located on your machine.
489 In order to find out if the mail queue is flushed, use something like:
493 # Start mail deliveries.
494 /usr/sbin/sendmail -q
496 # Allow deliveries to start.
499 # Loop until all messages have been tried at least once.
500 while mailq | grep '^[^ ]*\*' >/dev/null
505 If you have disabled spontaneous SMTP mail delivery, you also need to run
506 the "s
\bse
\ben
\bnd
\bdm
\bma
\bai
\bil
\bl -
\b-q
\bq" command every now and then while the dialup link is up,
507 so that newly-posted mail is flushed from the queue.
509 P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx o
\bon
\bn h
\bho
\bos
\bst
\bts
\bs w
\bwi
\bit
\bth
\bho
\bou
\but
\bt a
\ba r
\bre
\bea
\bal
\bl I
\bIn
\bnt
\bte
\ber
\brn
\bne
\bet
\bt h
\bho
\bos
\bst
\btn
\bna
\bam
\bme
\be
511 This section is for hosts that don't have their own Internet hostname.
512 Typically these are systems that get a dynamic IP address via DHCP or via
513 dialup. Postfix will let you send and receive mail just fine between accounts
514 on a machine with a fantasy name. However, you cannot use a fantasy hostname in
515 your email address when sending mail into the Internet, because no-one would be
516 able to reply to your mail. In fact, more and more sites refuse mail addresses
517 with non-existent domain names.
519 Note: the following information is Postfix version dependent. To find out what
520 Postfix version you have, execute the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf m
\bma
\bai
\bil
\bl_
\b_v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn".
522 S
\bSo
\bol
\blu
\but
\bti
\bio
\bon
\bn 1
\b1:
\b: P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn 2
\b2.
\b.2
\b2 a
\ban
\bnd
\bd l
\bla
\bat
\bte
\ber
\br
524 Postfix 2.2 uses the generic(5) address mapping to replace local fantasy email
525 addresses by valid Internet addresses. This mapping happens ONLY when mail
526 leaves the machine; not when you send mail between users on the same machine.
528 The following example presents additional configuration. You need to combine
529 this with basic configuration information as discussed the first half of this
532 1 /etc/postfix/main.cf:
533 2 smtp_generic_maps = hash:/etc/postfix/generic
535 4 /etc/postfix/generic:
536 5 his@localdomain.local hisaccount@hisisp.example
537 6 her@localdomain.local heraccount@herisp.example
538 7 @localdomain.local hisaccount+local@hisisp.example
540 When mail is sent to a remote host via SMTP:
542 * Line 5 replaces his@localdomain.local by his ISP mail address,
544 * Line 6 replaces her@localdomain.local by her ISP mail address, and
546 * Line 7 replaces other local addresses by his ISP account, with an address
547 extension of +local (this example assumes that the ISP supports "+" style
550 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 files.
551 To find out what lookup tables Postfix supports, use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
553 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/g
\bge
\ben
\bne
\ber
\bri
\bic
\bc" whenever you change the
556 S
\bSo
\bol
\blu
\but
\bti
\bio
\bon
\bn 2
\b2:
\b: P
\bPo
\bos
\bst
\btf
\bfi
\bix
\bx v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn 2
\b2.
\b.1
\b1 a
\ban
\bnd
\bd e
\bea
\bar
\brl
\bli
\bie
\ber
\br
558 The solution with older Postfix systems is to use valid Internet addresses
559 where possible, and to let Postfix map valid Internet addresses to local
560 fantasy addresses. With this, you can send mail to the Internet and to local
561 fantasy addresses, including mail to local fantasy addresses that don't have a
562 valid Internet address of their own.
564 The following example presents additional configuration. You need to combine
565 this with basic configuration information as discussed the first half of this
568 1 /etc/postfix/main.cf:
569 2 myhostname = hostname.localdomain
570 3 mydomain = localdomain
572 5 canonical_maps = hash:/etc/postfix/canonical
574 7 virtual_alias_maps = hash:/etc/postfix/virtual
576 9 /etc/postfix/canonical:
577 10 your-login-name your-account@your-isp.com
579 12 /etc/postfix/virtual:
580 13 your-account@your-isp.com your-login-name
584 * Lines 2-3: Substitute your fantasy hostname here. Do not use a domain name
585 that is already in use by real organizations on the Internet. See RFC 2606
586 for examples of domain names that are guaranteed not to be owned by anyone.
588 * Lines 5, 9, 10: This provides the mapping from "your-login-
589 name@hostname.localdomain" to "your-account@your-isp.com". This part is
592 * Lines 7, 12, 13: Deliver mail for "your-account@your-isp.com" locally,
593 instead of sending it to the ISP. This part is not required but is
596 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 files.
597 To find out what lookup tables Postfix supports, use the command "p
\bpo
\bos
\bst
\btc
\bco
\bon
\bnf
\bf -
\b-m
\bm".
599 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/c
\bca
\ban
\bno
\bon
\bni
\bic
\bca
\bal
\bl" whenever you change the
602 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/v
\bvi
\bir
\brt
\btu
\bua
\bal
\bl" whenever you change the