~ubuntu-branches/ubuntu/maverick/postfix/maverick-security

« back to all changes in this revision

Viewing changes to proto/SMTPD_POLICY_README.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2009-06-03 14:17:08 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603141708-o9u59xlor7nmd2x1
[Wietse Venema]

* New upstream release: 2.6.2~rc1

[LaMont Jones]

* move postfix-add-{filter,policy} manpages to section 8, and deliver
* provide: default-mta on ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
    an empty value ("name="), or sends a zero value ("name=0") in
127
127
    the case of a numerical attribute. </p>
128
128
 
129
 
    <li> <p> The "recipient" attribute is available only in the
130
 
    "RCPT TO" stage, and in the "DATA" and "END-OF-MESSAGE" stages
131
 
    when Postfix accepted only one recipient for the current message.
132
 
    </p>
 
129
    <li> <p> The "recipient" attribute is available in the "RCPT
 
130
    TO" stage. It is also available in the "DATA" and "END-OF-MESSAGE"
 
131
    stages if Postfix accepted only one recipient for the current
 
132
    message.  </p>
133
133
 
134
134
    <li> <p> The "recipient_count" attribute (Postfix 2.3 and later)
135
135
    is non-zero only in the "DATA" and "END-OF-MESSAGE" stages. It
149
149
    and an attribute value must not contain null or newline. </p>
150
150
 
151
151
    <li> <p> The "instance" attribute value can be used to correlate
152
 
    different requests regarding the same message delivery. </p>
 
152
    different requests regarding the same message delivery. These
 
153
    requests are sent over the same policy connection (unless the
 
154
    policy daemon terminates the connection).  Once Postfix sends
 
155
    a query with a different instance attribute over that same
 
156
    policy connection, the previous message delivery is either
 
157
    completed or aborted. </p>
153
158
 
154
159
    <li> <p> The "size" attribute value specifies the message size
155
160
    that the client specified in the MAIL FROM command (zero if
168
173
    These attributes are empty in case of no certificate authentication.
169
174
    As of Postfix 2.2.11 these attribute values are encoded as
170
175
    xtext: some characters are represented by +XX, where XX is the
171
 
    two-digit hexadecimal representation of the character value.
172
 
    </p>
 
176
    two-digit hexadecimal representation of the character value. With
 
177
    Postfix 2.6 and later, the decoded string is an UTF-8 string
 
178
    without non-printable ASCII characters.  </p>
173
179
 
174
180
    <li> <p> The "encryption_*" attributes (Postfix 2.3 and later)
175
181
    specify information about how the connection is encrypted. With
265
271
 
266
272
<li> <p> Lines 2, 11: the Postfix spawn(8) daemon by default kills
267
273
its child process after 1000 seconds.  This is too short for a
268
 
policy daemon that may run for as long as an SMTP client is connected
269
 
to an SMTP server process. The default time limit is overruled in
 
274
policy daemon that may need to run for as long as the SMTP server
 
275
process that talks to it. The default time limit is overruled in
270
276
main.cf with an explicit "policy_time_limit" setting.  The name of
271
277
the parameter is the name of the master.cf entry ("policy")
272
 
concatenated with the "_time_limit" suffix.  </p>
 
278
concatenated with the "_time_limit" suffix. See spawn(8) for
 
279
more information about the time limit parameter.  </p>
273
280
 
274
281
<li> <p> Line 2: specify a "0" process limit instead of the default
275
282
"-", to avoid "connection refused" and other problems when the smtpd
550
557
$greylist_delay=60;
551
558
 
552
559
#
 
560
# Auto-whitelist threshold. Specify 0 to disable, or the number of
 
561
# successful "come backs" after which a client is no longer subject
 
562
# to greylisting.
 
563
#
 
564
$auto_whitelist_threshold = 10;
 
565
 
 
566
#
553
567
# Demo SMTPD access policy routine. The result is an action just like
554
568
# it would be specified on the right-hand side of a Postfix access
555
569
# table.  Request attributes are available via the %attr hash.
560
574
    # Open the database on the fly.
561
575
    open_database() unless $database_obj;
562
576
 
 
577
    # Search the auto-whitelist.
 
578
    if ($auto_whitelist_threshold &gt; 0) {
 
579
        $count = read_database($attr{"client_address"});
 
580
        if ($count &gt; $auto_whitelist_threshold) {
 
581
            return "dunno";
 
582
        }
 
583
    }
 
584
 
563
585
    # Lookup the time stamp for this client/sender/recipient.
564
586
    $key =
565
587
        lc $attr{"client_address"}."/".$attr{"sender"}."/".$attr{"recipient"};
584
606
    #
585
607
    syslog $syslog_priority, "request age %d", $now - $time_stamp if $verbose;
586
608
    if ($now - $time_stamp &gt; $greylist_delay) {
 
609
        # Update the auto-whitelist.
 
610
        if ($auto_whitelist_threshold &gt; 0) {
 
611
            update_database($attr{"client_address"}, $count + 1);
 
612
        }
587
613
        return "dunno";
588
614
    } else {
589
615
        return "defer_if_permit Service temporarily unavailable";