~ubuntu-branches/ubuntu/natty/postfix/natty-security

« back to all changes in this revision

Viewing changes to src/smtpd/smtpd_proxy.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2011-02-22 05:26:41 UTC
  • mfrom: (1.1.27 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222052641-l05d2bsz2kka0yca
Tags: 2.8.0-1~build1
natty version

Show diffs side-by-side

added added

removed removed

Lines of Context:
325
325
        XFORWARD_PORT, SMTPD_PROXY_XFORWARD_PORT,
326
326
        XFORWARD_PROTO, SMTPD_PROXY_XFORWARD_PROTO,
327
327
        XFORWARD_HELO, SMTPD_PROXY_XFORWARD_HELO,
 
328
        XFORWARD_IDENT, SMTPD_PROXY_XFORWARD_IDENT,
328
329
        XFORWARD_DOMAIN, SMTPD_PROXY_XFORWARD_DOMAIN,
329
330
        0, 0,
330
331
    };
349
350
    /*
350
351
     * Connect to proxy.
351
352
     */
352
 
    if ((fd = connect_fn(endpoint, BLOCKING, proxy->timeout)) < 0)
 
353
    if ((fd = connect_fn(endpoint, BLOCKING, proxy->timeout)) < 0) {
 
354
        msg_warn("connect to proxy filter %s: %m", proxy->service_name);
353
355
        return (smtpd_proxy_rdwr_error(state, 0));
 
356
    }
354
357
    proxy->service_stream = vstream_fdopen(fd, O_RDWR);
355
358
    /* Needed by our DATA-phase record emulation routines. */
356
359
    vstream_control(proxy->service_stream, VSTREAM_CTL_CONTEXT,
357
360
                    (char *) state, VSTREAM_CTL_END);
 
361
    /* Avoid poor performance when TCP MSS > VSTREAM_BUFSIZE. */
 
362
    if (connect_fn == inet_connect)
 
363
        vstream_tweak_tcp(proxy->service_stream);
358
364
    smtp_timeout_setup(proxy->service_stream, proxy->timeout);
359
365
 
360
366
    /*
426
432
                 && smtpd_proxy_xforward_send(state, buf, XFORWARD_HELO,
427
433
                                  IS_AVAIL_CLIENT_HELO(FORWARD_HELO(state)),
428
434
                                              FORWARD_HELO(state)))
 
435
             || ((server_xforward_features & SMTPD_PROXY_XFORWARD_IDENT)
 
436
                 && smtpd_proxy_xforward_send(state, buf, XFORWARD_IDENT,
 
437
                                  IS_AVAIL_CLIENT_IDENT(FORWARD_IDENT(state)),
 
438
                                              FORWARD_IDENT(state)))
429
439
             || ((server_xforward_features & SMTPD_PROXY_XFORWARD_PROTO)
430
440
                 && smtpd_proxy_xforward_send(state, buf, XFORWARD_PROTO,
431
441
                                IS_AVAIL_CLIENT_PROTO(FORWARD_PROTO(state)),