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

« back to all changes in this revision

Viewing changes to src/smtpstone/smtp-sink.c

  • 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:
96
96
/*      connections that \fBsmtp-sink\fR will handle. This prevents
97
97
/*      the process from running out of file descriptors. Excess
98
98
/*      connections will stay queued in the TCP/IP stack.
 
99
/* .IP "\fB-M \fIcount\fR"
 
100
/*      Terminate after receiving \fIcount\fR messages.
99
101
/* .IP "\fB-n \fIcount\fR"
100
 
/*      Terminate after \fIcount\fR sessions. This is for testing purposes.
 
102
/*      Terminate after \fIcount\fR sessions.
101
103
/* .IP \fB-p\fR
102
104
/*      Do not announce support for ESMTP command pipelining.
103
105
/* .IP \fB-P\fR
149
151
/* .IP "\fB-t \fItimeout\fR (default: 100)"
150
152
/*      Limit the time for receiving a command or sending a response.
151
153
/*      The time limit is specified in seconds.
 
154
/* .IP "\fB-T \fIwindowsize\fR"
 
155
/*      Override the default TCP window size. To work around
 
156
/*      broken TCP window scaling implementations, specify a
 
157
/*      value > 0 and < 65536.
152
158
/* .IP "\fB-u \fIusername\fR"
153
159
/*      Switch to the specified user privileges after opening the
154
160
/*      network socket and optionally changing the process root
333
339
static int quit_count;
334
340
static int mesg_count;
335
341
static int max_quit_count;
 
342
static int max_msg_quit_count;
336
343
static int disable_pipelining;
337
344
static int disable_8bitmime;
338
345
static int disable_esmtp;
880
887
            if (state->dump_file)
881
888
                mail_file_finish(state);
882
889
            mail_cmd_reset(state);
883
 
            if (count) {
 
890
            if (count || max_msg_quit_count > 0) {
884
891
                mesg_count++;
885
 
                do_stats();
 
892
                if (count)
 
893
                    do_stats();
 
894
                if (max_msg_quit_count > 0 && mesg_count >= max_msg_quit_count)
 
895
                    exit(0);
886
896
            }
887
897
            break;
888
898
        }
1357
1367
 
1358
1368
static void usage(char *myname)
1359
1369
{
1360
 
    msg_fatal("usage: %s [-468acCeEFLpPv] [-A abort_delay] [-f commands] [-h hostname] [-m max_concurrency] [-n quit_count] [-q commands] [-r commands] [-s commands] [-w delay] [-d dump-template] [-D dump-template] [-R root-dir] [-S start-string] [-u user_privs] [host]:port backlog", myname);
 
1370
    msg_fatal("usage: %s [-468acCeEFLpPv] [-A abort_delay] [-d dump-template] [-D dump-template] [-f commands] [-h hostname] [-m max_concurrency] [M message_quit_count] [-n quit_count] [-q commands] [-r commands] [-R root-dir] [-s commands] [-S start-string] [-u user_privs] [-w delay] [host]:port backlog", myname);
1361
1371
}
1362
1372
 
1363
1373
MAIL_VERSION_STAMP_DECLARE;
1389
1399
    /*
1390
1400
     * Parse JCL.
1391
1401
     */
1392
 
    while ((ch = GETOPT(argc, argv, "468aA:cCd:D:eEf:Fh:Ln:m:pPq:Q:r:R:s:S:t:u:vw:W:")) > 0) {
 
1402
    while ((ch = GETOPT(argc, argv, "468aA:cCd:D:eEf:Fh:Ln:m:M:pPq:Q:r:R:s:S:t:T:u:vw:W:")) > 0) {
1393
1403
        switch (ch) {
1394
1404
        case '4':
1395
1405
            protocols = INET_PROTO_NAME_IPV4;
1444
1454
            if ((max_client_count = atoi(optarg)) <= 0)
1445
1455
                msg_fatal("bad concurrency limit: %s", optarg);
1446
1456
            break;
 
1457
        case 'M':
 
1458
            if ((max_msg_quit_count = atoi(optarg)) <= 0)
 
1459
                msg_fatal("bad message quit count: %s", optarg);
 
1460
            break;
1447
1461
        case 'n':
1448
1462
            if ((max_quit_count = atoi(optarg)) <= 0)
1449
1463
                msg_fatal("bad quit count: %s", optarg);
1480
1494
            if ((var_tmout = atoi(optarg)) <= 0)
1481
1495
                msg_fatal("bad timeout: %s", optarg);
1482
1496
            break;
 
1497
        case 'T':
 
1498
            if ((inet_windowsize = atoi(optarg)) <= 0)
 
1499
                msg_fatal("bad TCP window size: %s", optarg);
 
1500
            break;
1483
1501
        case 'u':
1484
1502
            user_privs = optarg;
1485
1503
            break;