Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

Selection of outgoing IP address

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


JSL-QMail at LoveSong

Oct 13, 2003, 2:28 PM

Post #1 of 3 (1390 views)
Permalink
Selection of outgoing IP address

How does the mail relay decide who it is going to be if it has
a choice of IP addresses to send from? On my system, it appears
to choose one at random. I'd like to have some control over
this.

I have been looking at the code in qmail-remote.c which appears
to set up the IP connection to deliver outgoing SMTP mail and I
don't fully understand enough of the Unix underpinnings yet to
quite grok it. I'm running 1.03 on a Debian Linux as nearly out
of the box as possible, but with a peculiar local setup.

I have a small webhosting business and a bunch of virtual hosts
on one server, with one IP address per customer and a variable
number of web sites per IP address. These web sites are all on
20 or so externally routable IP addresses attached to a DSL
line.

The server has as its primary identity, however, an interface
which is connected to a different ethernet port with an
internal-only IP address, 192.168.1.252. The name in
/etc/qmail/me is associated by my DNS with that internal
address, so when it goes to look for an IP address to choose on
the external interface, there is none that resolves to the name
in /etc/qmail/me.

This is a conjecture because I observe that all the outgoing
e-mail from the server which hosts my account at pair Networks
emanates from a single IP address, the one which I expect is in
/etc/qmail/me.

Ideally, I would like the outgoing e-mail to leave from the IP
address associated with the customer whose e-mail it is
associated with, which can be deduced from the IP address it
arrived on, since each customer has an MX record pointing to a
name on their IP address. I can see that this might be too
hard, but I am stumped at figuring out where in the
documentation to look for advice on this matter.

One thing I really like about qmail (vs sendmail) is that it
records which interface (IP address) the e-mail arrives on.
Doing something with this by parsing the header is probably too
hairy, but considering the tricks that can be done with
RELAYCLIENT, I thought perhaps there would be a way to do this,
too.

-- Spencer


maex-qmail at Space

Oct 13, 2003, 5:31 PM

Post #2 of 3 (1302 views)
Permalink
Re: Selection of outgoing IP address [In reply to]

On Mon, Oct 13, 2003 at 05:28:27PM -0400, J. Spencer Love wrote:
> How does the mail relay decide who it is going to be if it has
> a choice of IP addresses to send from? On my system, it appears
> to choose one at random. I'd like to have some control over
> this.

There is a patch on qmail.org for qmail-1.03 to assign a fixed IP
address. Other than that it will typically use 0.0.0.0 which often
maps to the first interface found.

There is no way for what you want to do with stock qmail.

You can however use (in Linux) e.g.
http://www.solucorp.qc.ca/miscprj/s_context.hc
and have each virtual server run it's own qmail.

\Maex

--
SpaceNet AG | Joseph-Dollinger-Bogen 14 | Fon: +49 (89) 32356-0
Research & Development | D-80807 Muenchen | Fax: +49 (89) 32356-299
"The security, stability and reliability of a computer system is reciprocally
proportional to the amount of vacuity between the ears of the admin"


nelson at crynwr

Oct 13, 2003, 8:44 PM

Post #3 of 3 (1286 views)
Permalink
Re: Selection of outgoing IP address [In reply to]

J. Spencer Love writes:
> Ideally, I would like the outgoing e-mail to leave from the IP
> address associated with the customer whose e-mail it is
> associated with, which can be deduced from the IP address it
> arrived on, since each customer has an MX record pointing to a
> name on their IP address. I can see that this might be too
> hard, but I am stumped at figuring out where in the
> documentation to look for advice on this matter.

You're not the first person to want this, but nobody has ever written
the necessary code, nor to fund development of it. Markus Stumpf
wrote something related to what you want. You'd have to patch
qmail-remote to do a DNS lookup of the sender as well as of the
recipient.

--
--My blog is at angry-economist.russnelson.com | Can I recommend python?
Crynwr sells support for free software | PGPok | Just a thought.
521 Pleasant Valley Rd. | +1 315 268 1925 voice | -Dr. Jamey Hicks
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX |

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.