summaryrefslogtreecommitdiff
path: root/gnu/dist/postfix/html/uce.html
blob: ce35418fba43b77eb7eec18ada8c7247f40fcebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
<html>

<head>

<title> Postfix Configuration - UCE Controls</title>

</head>

<body>

<h1><a href="big-picture.html"><img src="small-picture.gif" width="115" height="45"></a>
Postfix Configuration - UCE Controls</h1>

<hr>

<a href="index.html">Up one level</a> | <a href="basic.html">Basic
Configuration</a> | UCE Controls | <a href="rate.html">Rate
Controls</a> | <a href="resource.html">Resource Controls</a> | <a
href="rewrite.html">Address Manipulation </a>

<h2> Introduction</h2>

Postfix offers a variety of parameters that limit the delivery of
unsolicited commercial email (UCE).

<p>

By default, the Postfix <a href="smtpd.8.html">SMTP server</a> will
accept mail only from or to the local network or domain, or to
domains that are hosted by Postfix, so that your system can't be
used as a mail relay to forward bulk mail from random strangers.

<p>

The text in this document describes how you can set up more detailed
anti-UCE policies that prevent delivery of unwanted email altogether,
for example with sendmail-style <b>access</b> lists or with <b>RBL</b>
(real-time blackhole list) name servers.

<p> Unless indicated otherwise, all parameters described here are
in the <b>main.cf</b> file. If you change parameters of a running
Postfix system, don't forget to issue a <b>postfix reload</b>
command.

<ul>

<li> <a href="#header_checks">Header filtering</a>

<p>

<li> <a href="#smtpd_client_restrictions">Client hostname/address
restrictions</a>

<p>

<li> <a href="#smtpd_helo_required">Require HELO (EHLO) command </a>

<p>

<li> <a href="#smtpd_helo_restrictions">HELO (EHLO) hostname
restrictions</a>

<p>

<li> <a href="#strict_rfc821_envelopes">Require strict RFC 821-style
envelope addresses </a>

<p>

<li> <a href="#smtpd_sender_restrictions">Sender address restrictions
</a>

<p>

<li> <a href="#smtpd_recipient_restrictions">Recipient address
restrictions</a>

<p>

<li> <a href="#smtpd_etrn_restrictions">ETRN command restrictions</a>

<p>

<li> <a href="#generic">Generic restrictions</a>

<p>

<li> <a href="#additional">Additional UCE control parameters</a>

</ul>

<a name="header_checks">

<h2> Header filtering</h2>

The <b>header_checks</b> parameter restricts what
is allowed in message headers.

<p>

<dl>

<dt>Default:

<dd>Allow anything in message headers.

<p>

<dt>Syntax:

<dd>Specify a list of zero or more lookup tables. Whenever a header
matches a table, a REJECT result means reject the message. 

<p>

<i>At present, specifying a header pattern with OK serves no useful
purpose. A rule ending in OK affects only the header being matched.
The next header may still result in a REJECT match, causing the
mail still to be rejected.</i>

</dl>

<p>

<dt>Examples (main.cf):

<dd> <b>header_checks = regexp:/etc/postfix/header_checks</b>

<dd> <b>header_checks = pcre:/etc/postfix/header_checks</b>

<p>

<dt>Example (header_checks):

<dd> /^to: *friend@public\.com$/ REJECT

<p>

<a name="smtpd_client_restrictions">

<h2> Client hostname/address restrictions</h2>

The <b>smtpd_client_restrictions</b> parameter restricts what
clients this system accepts SMTP connections from.

<p>

<dl>

<dt>Default:

<dd><b>smtpd_client_restrictions =</b>

<p>

<dd>Allow SMTP connections from any client.

<p>

<dt>Syntax:

<dd>Specify a list of zero or more restrictions, separated by
whitespace or commas. Restrictions are applied in the order as
specified; the first restriction that matches wins.

<p>

<dt>Examples:

<dd> <b>smtpd_client_restrictions = hash:/etc/postfix/access,
reject_maps_rbl</b>

<dd> <b>smtpd_client_restrictions = permit_mynetworks,
reject_unknown_client</b>

<p>

<dt> Restrictions:

<p>

<dl>

<a name="reject_unknown_client">

<dt> <b>reject_unknown_client</b> <dd> Reject the request when the
client IP address has no PTR record in the DNS.  The
<b>unknown_client_reject_code</b> parameter specifies the response
code to rejected requests (default:  <b>450</b>).

<p>

<a name="permit_mynetworks">

<dt> <b>permit_mynetworks</b> <dd> Permit the request when the
client IP address matches any network listed in <a
href="basic.html#mynetworks"> $mynetworks</a>.

<p>

<a name="check_client_access">

<dt> <b>check_client_access</b> <i>maptype</i>:<i>mapname</i>

<dt> <i>maptype</i>:<i>mapname</i> <dd> Search the named <a
href="access.5.html">access database</a> for the client hostname, parent
domains, client IP address, or networks obtained by stripping least
significant octets.  Reject the request if the result is <b>REJECT</b>
or "[<b>45</b>]<i>XX text</i>". Permit the request if the result
is <b>OK</b> or <b>RELAY</b> or all-numerical. Otherwise, treat the
result as another list of UCE restrictions.  The
<b>access_map_reject_code</b> parameter specifies the response code for
<b>REJECT</b> results (default:  <b>554</b>).

<p>

<a name="reject_maps_rbl">

<dt> <b>reject_maps_rbl</b> <dd> Reject the request when the client
network address is listed under any of the domains listed in <a
href="#maps_rbl_domains">$maps_rbl_domains</a>. The <b>
maps_rbl_reject_code</b> parameter specifies the response code for
rejected requests (default: <b>554</b>).

<p>

<dt> <b><a href="#permit">permit</a></b>

<dt> <b><a href="#reject">reject</a></b>

<dt> <b><a href="#reject_unauth_pipelining">reject_unauth_pipelining</a></b>

<dd> See generic restrictions.

</dl>

</dl>

<a name="smtpd_helo_required">

<h2> Require HELO (EHLO) command</h2>

The <b>smtpd_helo_required</b> parameter determines if clients must
send a <b>HELO</b> (or <b>EHLO</b>) command at the beginning of an
SMTP session.  Requiring this will stop some UCE software.

<p>

<dl>

<dt>Default:

<dd><b>smtpd_helo_required = no</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
does not require the use of <b>HELO</b> (<b>EHLO</b>).

<p>

<dt>Syntax:

<dd>Specify <b>yes</b> or <b>no</b>.

<p>

<dt>Example:

<dd> <b>smtpd_helo_required = yes</b>

</dl>

<a name="smtpd_helo_restrictions">

<h2> HELO (EHLO) hostname restrictions</h2>

The <b>smtpd_helo_restrictions</b> parameter restricts what hostnames
clients may send with the <b>HELO</b> (<b>EHLO</b>) command.  Some
UCE software can be stopped by being strict here.

<dl>

<dt>Default:

<dd><b>smtpd_helo_restrictions =</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
accepts any garbage in the <b>HELO</b> (<b>EHLO</b>) command. There
is a lot of broken or misconfigured software on the Internet.

<p>

<dt>Syntax:

<dd>Specify a list of zero or more restrictions, separated by
whitespace or commas.  Restrictions are applied in the order as
specified; the first restriction that matches wins.

<p>

In addition to restrictions that are specific to HELO (EHLO)
command parameters, you can also specify restrictions based
on the client hostname or network address.

<p>

<dt>Example:

<dd> <b>smtpd_helo_restrictions = permit_mynetworks,
reject_invalid_hostname</b>

<p>

<dt> Restrictions:

<p>

<dl>

<a name="reject_invalid_hostname">

<dt> <b>reject_invalid_hostname</b> <dd> Reject the request when
the client HELO or EHLO parameter has a bad hostname syntax. The
<b>invalid_hostname_reject_code</b> specifies the response code to
rejected requests (default:  501).

<p>

<a name="permit_naked_ip_address">

<dt> <b>permit_naked_ip_address</b> <dd> Permit the request when
the client HELO (EHLO) command contains a naked IP address without
the enclosing <b>[]</b> brackets that the RFC requires. Unfortunately,
some popular PC mail clients send <b>HELO</b> greetings in this
manner.

<p>

<a name="reject_unknown_hostname">

<dt> <b>reject_unknown_hostname</b> <dd> Reject the request when
the hostname in the client HELO (EHLO) command has no DNS A or MX
record. The <b>unknown_hostname_reject_code</b> specifies the
response code to rejected requests (default:  <b>450</b>).

<p>

<a name="reject_non_fqdn_hostname">

<dt> <b>reject_non_fqdn_hostname</b> <dd> Reject the request when
the hostname in the client HELO (EHLO) command is not in fully-qualified
domain form, as required by the RFC. The <b>non_fqdn_reject_code</b>
specifies the response code to rejected requests (default:
<b>504</b>).

<p>

<a name="check_helo_access">

<dt> <b>check_helo_access</b> <i>maptype</i>:<i>mapname</i>

<dt> <i>maptype</i>:<i>mapname</i> <dd> Search the named <a
href="access.5.html">access database</a> for the <b>HELO</b> hostname
or parent domains in the specified table.  Reject the request if
the result is <b>REJECT</b> or "[<b>45</b>]<i>XX text</i>". Permit
the request when the result is <b>OK</b> or <b>RELAY</b> or
all-numerical. Otherwise, treat the result as another list of UCE
restrictions.  The <b>access_map_reject_code </b> parameter specifies
the response code for <b>REJECT</b> results (default:  <b>554</b>).

<p>

<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>

<dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>

<dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>

<dt> <b><a href="#check_client_access">check_client_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See client hostname/address restrictions.

<p>

<dt> <b><a href="#permit">permit</a></b>

<dt> <b><a href="#reject">reject</a></b>

<dt> <b><a href="#reject_unauth_pipelining">reject_unauth_pipelining</a></b>

<dd> See generic restrictions.

</dl>

</dl>

<a name="strict_rfc821_envelopes">

<h2> Require strict RFC 821-style envelope addresses </h2>

The <b>strict_rfc821_envelopes</b> parameter controls how tolerant
Postfix is with respect to addresses given in MAIL FROM or RCPT TO
commands. Unfortunately, the widely-used Sendmail program tolerates
lots of non-standard behavior, so a lot of software expects to get
away with it.  Being strict to the RFC not only stops unwanted
mail, it also blocks legitimate mail from poorly-written mail
applications.

<p>

<dl>

<dt> Default:

<dd><b>strict_rfc821_envelopes = no</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
accepts any address form that it can make sense of, including
address forms that contain RFC 822-style comments, or addresses
not enclosed in &lt;&gt;. There is a lot of broken or misconfigured
software out there on the Internet.

<p>

<dt> Example:

<dd><b>strict_rfc821_envelopes = yes</b>

</dl>

<a name="smtpd_sender_restrictions">

<h2> Sender address restrictions</h2>

The <b>smtpd_sender_restrictions</b> parameter restricts what sender
addresses this system accepts in MAIL FROM commands.

<p>

<dl>

<dt> Default:

<dd><b>smtpd_sender_restrictions =</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
accepts any sender address.

<p>

<dt>Syntax:

<dd>Specify a list of zero or more restrictions, separated by
whitespace or commas. Restrictions are applied in the order as
specified; the first restriction that matches wins.

<p>

In addition to restrictions that are specific to sender mail
addresses, you can also specify restrictions based on the information
passed with the HELO/EHLO command, and on the client hostname or
network address.

<p>

<dt> Example:

<dd> <b>smtpd_sender_restrictions = hash:/etc/postfix/access,
reject_unknown_sender_domain</b>

<p>

<dt> Restrictions:

<dl compact>

<a name="reject_unknown_sender_domain">

<dt> <b>reject_unknown_sender_domain</b> <dd> Reject the request
when the sender mail address has no DNS A or MX record. The
<b>unknown_address_reject_code </b> parameter specifies the response
code for rejected requests (default:  <b>450</b>).  The response
is always <b>450</b> in case of a temporary DNS error.

<p>

<a name="check_sender_access">

<dt> <b>check_sender_access</b> <i>maptype</i>:<i>mapname</i>

<dt> <i>maptype</i>:<i>mapname</i> <dd> Search the named <a
href="access.5.html">access database</a> for the sender mail address,
parent domain, or <i>localpart</i>@. Reject the request if the
result is <b>REJECT</b> or "[<b>45</b>]<i>XX text</i>". Permit the
request if the result is <b>OK</b> or <b>RELAY</b> or all-numerical.
Otherwise, treat the result as another list of UCE restrictions.  The
<b>access_map_reject_code </b> parameter specifies the result code for
rejected requests (default: <b>554</b>).

<p>

<a name="reject_non_fqdn_sender">

<dt> <b>reject_non_fqdn_sender</b> <dd> Reject the request when
the address in the client MAIL FROM command is not in fully-qualified
domain form. The <b>non_fqdn_reject_code</b> specifies the
response code to rejected requests (default:  <b>504</b>).

<p>

<dt> <b><a href="#permit_naked_ip_address">permit_naked_ip_address</a></b>

<dt> <b><a href="#reject_invalid_hostname">reject_invalid_hostname</a></b>

<dt> <b><a href="#reject_unknown_hostname">reject_unknown_hostname</a></b>

<dt> <b><a href="#reject_non_fqdn_hostname">reject_non_fqdn_hostname</a></b>

<dt> <b><a href="#check_helo_access">check_helo_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See HELO (EHLO) hostname restrictions.

<p>

<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>

<dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>

<dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>

<dt> <b><a href="#check_client_access">check_client_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See client hostname/address restrictions.

<p>

<dt> <b><a href="#permit">permit</a></b>

<dt> <b><a href="#reject">reject</a></b>

<dt> <b><a href="#reject_unauth_pipelining">reject_unauth_pipelining</a></b>

<dd> See generic restrictions.

</dl>

</dl>

<a name="smtpd_recipient_restrictions">

<h2> Recipient address restrictions</h2>

The <b>smtpd_recipient_restrictions</b> parameter restricts what
recipient addresses this system accepts in RCPT TO commands.

<dl>

<dt>Default: 

<dd><b>smtpd_recipient_restrictions = permit_mynetworks, check_relay_domains</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
relays mail:

<p>

<ul>

<li>from trusted clients whose IP address matches <a
href="basic.html#mynetworks">$mynetworks</a>,

<li>from trusted clients whose hostname matches <a
href="#relay_domains">$relay_domains</a> or a subdomain thereof,

<li>from untrusted clients to destinations that match <a
href="#relay_domains"> $relay_domains</a> or a subdomain thereof,
except for addresses that contain sender-specified routing
(<i>user@elsewhere@domain</i>).

</ul>

<p>

In addition to the above, the Postfix <a href="smtpd.8.html">SMTP
server</a> by default accepts mail for which Postfix is the final
destination:

<p>

<ul>

<li>to destinations that match <a
href="basic.html#inet_interfaces">$inet_interfaces</a>,

<li>to destinations that match <a
href="basic.html#mydestination">$mydestination</a>,

<li>to destinations that match <a href="virtual.5.html">$virtual_maps</a>.

</ul>

<p>

<dt>Syntax:

<dd>Specify a list of zero or more restrictions, separated by
whitespace or commas. Restrictions are applied in the order as
specified; the first restriction that matches wins.

<p>

In addition to restrictions that are specific to recipient mail
addresses, you can also specify restrictions based on the sender mail
address, on the information passed with the HELO/EHLO command, and
on the client hostname or network address.

<p>

<dt> Example:

<dd> <b>smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination</b>

<p>

<dd><i>Note: you must specify at least one of the following
restrictions: </i><b>reject</b>, <b>check_relay_domains</b> <i>or</i>
<b>reject_unauth_destination</b>. <i>Postfix will refuse to receive
mail otherwise. </i>

<p>

<dt> Restrictions:

<dl>

<a name="check_relay_domains">

<dt> <b>check_relay_domains</b> <dd> Permit the request when 
one of the following is true:

<ul>

<li>the client hostname matches <a href="#relay_domains">$relay_domains</a>
or a subdomain thereof,

<li>the resolved destination address matches <a
href="#relay_domains">$relay_domains</a> or a subdomain thereof,
and the address contains no sender-specified routing
(<i>user@elsewhere@domain</i>),

<li>Postfix is the final destination:  any destination that matches
<a href="basic.html#mydestination">$mydestination</a>, <a
href="basic.html#inet_interfaces">$inet_interfaces</a> or <a
href="virtual.5.html">$virtual_maps</a>.

</ul>

Otherwise reject the request.  The <b>relay_domains_reject_code</b>
parameter specifies the response code for rejected requests (default:
<b>554</b>).

<p>

<a name="permit_auth_destination">

<dt> <b>permit_auth_destination</b> <dd> Ignore the client hostname.
Permit the request when one of the following is true:

<ul>

<li>the resolved destination address matches <a
href="#relay_domains">$relay_domains</a> or a subdomain thereof,
and the address contains no sender-specified routing
(<i>user@elsewhere@domain</i>),

<li>Postfix is the final destination:  any destination that matches
<a href="basic.html#mydestination">$mydestination</a>, <a
href="basic.html#inet_interfaces">$inet_interfaces</a> or <a
href="virtual.5.html">$virtual_maps</a>.

</ul>

Otherwise proceed with the next restriction. 

<p>

<a name="reject_unauth_destination">

<dt> <b>reject_unauth_destination</b> <dd> Ignore the client
hostname.  Reject the request unless one of the following is true:

<ul>

<li>the resolved destination address matches <a
href="#relay_domains">$relay_domains</a> or a subdomain thereof,
and the address contains no sender-specified routing
(<i>user@elsewhere@domain</i>),

<li>Postfix is the final destination:  any destination that matches
<a href="basic.html#mydestination">$mydestination</a>, <a
href="basic.html#inet_interfaces">$inet_interfaces</a> or <a
href="virtual.5.html">$virtual_maps</a>.

</ul>

The <b>relay_domains_reject_code</b> parameter specifies the response
code for rejected requests (default:  <b>554</b>).

<p>

<a name="permit_mx_backup">

<dt> <b>permit_mx_backup</b> <dd> Permit the request when the local
mail system is MX host for the resolved destination. This includes
the case that the local mail system is the final destination.
However, the SMTP server will not forward mail with addresses that
have sender-specified routing information (example:
<i>user@elsewhere@domain</i>),

<p>

Relevant configuration parameters:  <a href="basic.html#mydestination">
$mydestination</a>, <a href="basic.html#inet_interfaces">
$inet_interfaces</a>.

<p>

<dt> <b>check_recipient_access</b> <i>maptype</i>:<i>mapname</i>

<dt> <i>maptype</i>:<i>mapname</i> <dd> Search the named <a
href="access.5.html">access database</a> for the resolved destination
address, parent domain, or <i>localpart</i>@. Reject the request if the
result is <b>REJECT</b> or "[<b>45</b>]<i>XX text</i>".  Permit the
request if the result is <b>OK</b> or <b>RELAY</b> or all-numerical.
Otherwise, treat the result as another list of UCE restrictions.  The
<b>access_map_reject_code </b> parameter specifies the result code for
rejected requests (default: <b>554</b>).

<p>

<a name="reject_unknown_recipient_domain">

<dt> <b>reject_unknown_recipient_domain</b> <dd> Reject the request
when the recipient mail address has no DNS A or MX record. The
<b>unknown_address_reject_code </b> parameter specifies the response
code for rejected requests (default:  <b>450</b>).  The response
is always <b>450</b> in case of a temporary DNS error.

<p>

<a name="reject_non_fqdn_recipient">

<dt> <b>reject_non_fqdn_recipient</b> <dd> Reject the request when
the address in the client RCPT TO command is not in fully-qualified
domain form. The <b>non_fqdn_reject_code</b> specifies the
response code to rejected requests (default:  <b>504</b>).

<p>

<dt> <b><a href="#reject_unknown_sender_domain">reject_unknown_sender_domain</a></b>

<dt> <b><a href="#reject_non_fqdn_sender">reject_non_fqdn_sender</a></b>

<dt> <b><a href="#check_sender_access">check_sender_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See sender address restrictions.

<p>

<dt> <b><a href="#permit_naked_ip_address">permit_naked_ip_address</a></b>

<dt> <b><a href="#reject_invalid_hostname">reject_invalid_hostname</a></b>

<dt> <b><a href="#reject_unknown_hostname">reject_unknown_hostname</a></b>

<dt> <b><a href="#reject_non_fqdn_hostname">reject_non_fqdn_hostname</a></b>

<dt> <b><a href="#check_helo_access">check_helo_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See HELO (EHLO) hostname restrictions.

<p>

<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>

<dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>

<dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>

<dt> <b><a href="#check_client_access">check_client_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See client hostname/address restrictions.

<p>

<dt> <b><a href="#permit">permit</a></b>

<dt> <b><a href="#reject">reject</a></b>

<dt> <b><a href="#reject_unauth_pipelining">reject_unauth_pipelining</a></b>

<dd> See generic restrictions.

</dl>

</dl>

<a name="smtpd_etrn_restrictions">

<h2> ETRN command restrictions</h2>

Not really an UCE restriction, the <b>smtpd_etrn_restrictions</b>
parameter restricts what domains can be specified in ETRN commands,
and what clients can issue ETRN commands.

<dl>

<dt>Default:

<dd><b>smtpd_etrn_restrictions =</b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
accepts any ETRN command from any client.

<p>

<dt>Syntax:

<dd>Specify a list of zero or more restrictions, separated by
whitespace or commas. Restrictions are applied in the order as
specified; the first restriction that matches wins.

<p>

In addition to restrictions that are specific to ETRN domain names,
you can also specify restrictions based on the information passed
with the HELO/EHLO command, and on the client hostname or network
address.

<p>

<dt> Example:

<dd> <b>smtpd_etrn_restrictions = permit_mynetworks,
hash:/etc/postfix/etrn_access, reject</b>

<p>

<dt> Restrictions:

<dl>

<a name="check_etrn_access">

<dt> <b>check_etrn_access</b> <i>maptype</i>:<i>mapname</i>

<dt> <i>maptype</i>:<i>mapname</i> <dd> Search the named <a
href="access.5.html">access database</a> for the domain specified
in the ETRN command, or its parent domains. Reject the request if
the result is <b>REJECT</b> or "[<b>45</b>]<i>XX text</i>".  Permit
the request if the result is <b>OK</b> or <b>RELAY</b> or
all-numerical. Otherwise, treat the result as another list of UCE
restrictions.  The <b>access_map_reject_code </b> parameter specifies
the result code for rejected requests (default: <b>554</b>).

<p>

<dt> <b><a href="#permit_naked_ip_address">permit_naked_ip_address</a></b>

<dt> <b><a href="#reject_invalid_hostname">reject_invalid_hostname</a></b>

<dt> <b><a href="#reject_unknown_hostname">reject_unknown_hostname</a></b>

<dt> <b><a href="#check_helo_access">check_helo_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See HELO (EHLO) hostname restrictions.

<p>

<dt> <b><a href="#reject_maps_rbl">reject_maps_rbl</a></b>

<dt> <b><a href="#reject_unknown_client">reject_unknown_client</a></b>

<dt> <b><a href="#permit_mynetworks">permit_mynetworks</a></b>

<dt> <b><a href="#check_client_access">check_client_access</a></b> <i>maptype</i>:<i>mapname</i>

<dd> See client hostname/address restrictions.

<p>

<dt> <b><a href="#permit">permit</a></b>

<dt> <b><a href="#reject">reject</a></b>

<dt> <b><a href="#reject_unauth_pipelining">reject_unauth_pipelining</a></b>

<dd> See generic restrictions.

</dl>

</dl>

<a name="generic">

<h2> Generic restrictions</h2>

The following restrictions can use used for client hostnames or
addresses, for HELO (EHLO) hostnames, for sender mail addresses
and for recipient mail addresses.

<dl>

Restrictions:

<p>

<dl>

<a name="permit">

<dt> <b>permit</b> <dd> Permit the request. This restriction
is useful at the end of a restriction list, to make the default
policy explicit. 

<p>

<a name="reject">

<dt> <b>reject</b> <dd> Reject the request. This restriction
is useful at the end of a restriction list, to make the default
policy explicit. The <b>reject_code</b> configuration parameter
specifies the response code to rejected requests (default:
<b>554</b>).

<p>

<a name="reject_unauth_pipelining">

<dt> <b>reject_unauth_pipelining</b> <dd> Reject the request when
the client sends SMTP commands ahead of time without knowing that
Postfix actually supports SMTP command pipelining.  This stops mail
from bulk mail software that improperly uses SMTP command pipelining
to speed up deliveries.

</dl>

</dl>

<a name="additional">

<h2> Additional UCE control parameters</h2>

<dl>

<a name="maps_rbl_domains">

<dt> <b>maps_rbl_domains</b>

<dd>This parameter controls the behavior of the <a
href="#reject_maps_rbl">reject_maps_rbl</a> restriction that can
appear as part of a client hostname/address restriction list.

<p>

<dl>

<dt>Default:

<dd><b>maps_rbl_domains = rbl.maps.vix.com, dul.maps.vix.com</b>

<p>

Note: RBL lookups are disabled by default.

<p>

<dt>Syntax:

<dd> Zero or more DNS domains that blacklist client IP addresses.  A
host is blacklisted when its reversed IP address is listed as a
subdomain under any of the domains listed in <b>$maps_rbl_domains.</b>

</dl>

<p>

<a name="relay_domains">

<dt> <b>relay_domains</b>

<dd> This parameter controls the behavior of the <a
href="#check_relay_domains"> check_relay_domains</a>, <a
href="#reject_unauth_destination"> reject_unauth_destination</a>
and <a href="#permit_auth_destination"> permit_auth_destination</a>
restrictions that can appear as part of a recipient address
restriction list.

<p>

<dl>

<dt>Default:

<dd><b>relay_domains = <a href="basic.html#mydestination">
$mydestination</a></b>

<p>

<dd>By default, the Postfix <a href="smtpd.8.html">SMTP server</a>
relays mail:

<p>

<ul>

<li>from trusted clients whose IP address matches <a
href="basic.html#mynetworks">$mynetworks</a>,

<li>from trusted clients whose hostname matches <a
href="#relay_domains">$relay_domains</a> or a subdomain thereof,

<li>from untrusted clients to destinations that match <a
href="#relay_domains"> $relay_domains</a> or a subdomain thereof,
except for addresses that contain sender-specified routing
(<i>user@elsewhere@domain</i>).

</ul>

<p>

<dt>Syntax:

<dd> Specify zero or more domain names, <i>/file/name</i> patterns
and/or <i>type</i>:<i>name</i> lookup tables, separated by whitespace
and/or commas.  A <i>/file/name</i> is replaced by its contents;
<i>type</i>:<i>name</i> requests that table lookup is done instead
of string comparison.

</dl>

<p>

A host or destination address matches <b>$relay_domains</b> when
its name or parent domain matches any of the names, files or lookup
tables listed in <b>$relay_domains.</b>

</dl>

<hr>

<a href="index.html">Up one level</a> | <a href="basic.html">Basic
Configuration</a> | UCE Controls | <a href="rate.html">Rate
Controls</a> | <a href="resource.html">Resource Controls</a> | <a
href="rewrite.html">Address Manipulation </a>

</body>

</html>