Ask a Question Sign up for Free 106 Experts currently online. Ask Questions for Free!

Setting smtp_bind_address based on smtpd received address - PostFix

I've got a project coming up which needs some careful IP accounting for traffic into/out of the system. The trickiest part of this strikes me as being differentiating outbound SMTP data so that traffic from particular sources can be measured seperately. Outbound SMTP traffic will be submitted to mail.abc.com, mail.def.com, ...

Results 1 to 3 of 3

  1. #1

    Setting smtp_bind_address based on smtpd received address

    I've got a project coming up which needs some careful IP accounting for
    traffic into/out of the system. The trickiest part of this strikes me
    as being differentiating outbound SMTP data so that traffic from
    particular sources can be measured seperately.

    Outbound SMTP traffic will be submitted to mail.abc.com, mail.def.com,
    ...., mail.xyz.com depending on user in question. Mail.*.com will be a
    virtual server. The various mail.*.com virtual servers will all be
    served by the same set of real hosts behind a load-balancer.

    To keep traffic measurement simple I'd like to measure this traffic at
    an IP level - either from individual (sub-)interfaces, or from the
    load-balancer. My preference is the latter. In order to associate the
    outbound traffic with the correct virtual-server I'll need the outbound
    SMTP sessions, to originate connections from particular IP addresses.

    I can accomplish this by running multiple instances of postfix, each
    with its own configuration and queues, but I'd rather find a more elegant
    approach. What I ideally need is some may of setting the smtp_bind_address
    for a relayed message based on the interface upon which smtpd received the
    message.

    I've had a look at using one postfix instance, and binding smtpd on
    different addresses / ports, but I can't see how I can enfore a particular
    source address for outbound messages. I've tried '-o smtp_bind_address'
    in the master.cf definition of each smtpd listener, but it doesn't appear
    to work (not surprisingly, it's an SMTP client option, not a daemon
    option).

    Another possibility might be to try and put messages from each of the
    various smtpd listeners into different queues, which are then delivered
    by smtp clients configured with queue-specific source addresses, but I
    haven't looked into that properly yet.

    Just to complicate matters even more, content filtering will be thrown
    into the loop as well, but that's another story...

    Has anybody done this before? Are multiple postfix instances the only
    way to achieve it? Might something other than postfix be a better fit?

    Thanks in advance,


    -Ronan
    Ronan
  2. #2

    Re: Setting smtp_bind_address based on smtpd received address

    On Sunday, October 02, 2005 at 16:47 CEST,
    Ronan Mullally <ie> wrote:

    [...]
     

    Not possible with a single Postfix instance. Postfix supports routing
    based on the recipient address, nothing else.

    But sure, it might theoretically be possible with one or two Postfix
    instances using some really gross access map hacks, but then you'd be
    way better off with one instance per domain.
     

    Exactly.
     

    Do you by any chance have a sendmail background? Postfix doesn't have
    such a concept of multiple queues, so you don't have to look into it.

    [...]

    --
    Magnus Bäck
    lth.se

    Magnus
  3. #3

    Re: Setting smtp_bind_address based on smtpd received address

    On Sun, 2 Oct 2005, MagnusBäck wrote:
     

    Given a choice between gross hacks and multiple instances I'll be going
    with multiple instances (or extracting the info from the mail logs).
     

    I cut my teeth on sendmail 10+ years ago - last time I looked it didn't
    support multiple queues. Having re-looked, the multi-queue functionality
    it has does not support what I'm after - I'd still need to run multiple
    instances to ensure each domain's queue is processed with a different
    source IP address.


    -Ronan
    Ronan

Similar Threads

  1. Replies: 4
    Last Post: 08-28, 01:40 PM
  2. Replies: 7
    Last Post: 06-27, 08:42 PM
  3. Replies: 0
    Last Post: 06-24, 12:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
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