Re: smtp on a specific IP

2001-06-03 Thread Ross Davis

Thanks to all that helped.  After seeing what would be involved, I think I
will just report from the log files.

Thanks again.





Re: smtp on a specific IP

2001-06-03 Thread Henning Brauer

On Sun, Jun 03, 2001 at 09:55:46AM -0700, Ross Davis wrote:
> I still can't believe that after all this time, I am the only one that wants
> to control what ip a domain sends mail out on.

Why should anyone care? For most of us the machine qmail runs on differs
from the one the webserver runs on, so it's another IP anyways. Do
accounting based on qmail's logfiles.

> Is it physically possible to control the IP that qmail-remote uses to send
> from?

Well, you can patch qmail-remote of course. There's a patch floating around
to let qmail-remote bind to ONE specific IP. If you still insist on your
idea it may be possible to modify this one. But be warned: parsing the
sender's address, getting the domaina nd looking up a IP for it adds a lot
of cruft to the code. This _may_ result in security problems, bad
performance, instability and so on.

-- 
* Henning Brauer, [EMAIL PROTECTED], http://www.bsws.de *
* Roedingsmarkt 14, 20459 Hamburg, Germany   *
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)



Re: smtp on a specific IP

2001-06-03 Thread Russell Nelson

Ross Davis writes:
 > I still can't believe that after all this time, I am the only one that wants
 > to control what ip a domain sends mail out on.

Quoting from www.qmail.org:

http:[EMAIL PROTECTED]";>Markus
Stumpf has a http://www.lamer.de/maex/creative/software/qmail/";>pair of qmail
patches, one to cause qmail-smtpd to log its disposition of mail,
and another to convince qmail-remote to use a fixed IP address other
than the one you get without binding to an address.  Andy Repton has
ported the fixed IP address patch to
qmail 1.03.  Damir Cifer has better instructions for his http://tycho.edico.si/linuxtnt/#qmail-patch";>port.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | Microsoft rivets everything.
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Linux has some loose screws.
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX  | You own a screwdriver.



Re: smtp on a specific IP

2001-06-03 Thread Ross Davis

Thank you for correcting me on what is doing the sending.

I still can't believe that after all this time, I am the only one that wants
to control what ip a domain sends mail out on.

Is it physically possible to control the IP that qmail-remote uses to send
from?

- Original Message -
From: "Henning Brauer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 03, 2001 2:28 AM
Subject: Re: smtp on a specific IP


> On Sat, Jun 02, 2001 at 05:41:51PM -0700, Ross Davis wrote:
> > There has to be some kind of config file that tells qmail-smtpd what
domains
> > to send for.
>
> qmail-smtpd does not send mail. It receives mails via smtp.
> qmail-send takes care of sending and starts qmail-remote for off-site
> deliveries. qmail-remote does not bind to a specific IP at all.
>
> --
> * Henning Brauer, [EMAIL PROTECTED], http://www.bsws.de *
> * Roedingsmarkt 14, 20459 Hamburg, Germany   *
> Unix is very simple, but it takes a genius to understand the simplicity.
> (Dennis Ritchie)




Re: smtp on a specific IP

2001-06-03 Thread Henning Brauer

On Sat, Jun 02, 2001 at 05:41:51PM -0700, Ross Davis wrote:
> There has to be some kind of config file that tells qmail-smtpd what domains
> to send for.  

qmail-smtpd does not send mail. It receives mails via smtp.
qmail-send takes care of sending and starts qmail-remote for off-site
deliveries. qmail-remote does not bind to a specific IP at all. 

-- 
* Henning Brauer, [EMAIL PROTECTED], http://www.bsws.de *
* Roedingsmarkt 14, 20459 Hamburg, Germany   *
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)



Re: smtp on a specific IP

2001-06-02 Thread Ross Davis

I don't think that will help me yet (Maybe I am being really stupid or
missing something) How does qmail know that mail that is from domain
mail.domain1.com is to be delivered on IP xxx.xxx.xxx.xxx and that mail from
mail.domain2.com is to be delivered using IP yyy.yyy.yyy.yyy.

At the point that qmail is sending out mail via smtp it no longer knows what
domain it is send out mail for does it?

There has to be some kind of config file that tells qmail-smtpd what domains
to send for.  I would expect something like this would have to be done.
A file called smtpddomain1
mail.domain1.com

Another file called smtpdotherdomains
mail.domain2.com
mail.domain3.com
...etc

(I know that the above doesn't exist - just dreaming)

Another thought would be if I could use the domain name on the program line
as below. (That would be a pain to have to add a new smtp file for every
domain that I want to be unique)

> #!/bin/sh
> QMAILDUID=`id -u qmaild`
> NOFILESGID=`id -g qmaild`
> MAXSMTPD=`/bin/cat /var/qmail/control/concurrencyincoming`
> exec /usr/local/bin/softlimit -m 200 /usr/local/bin/tcpserver \
> -vPHR -c "$MAXSMTPD" -x /var/qmail/cdb/smtp.cdb \
> -u "$QMAILDUID" -g "$NOFILESGID" mail.domain1.com smtp
/var/qmail/bin/qmail-smtpd 2>&1
>
^^

> run file for mail2.example.com:
>
> #!/bin/sh
> QMAILDUID=`id -u qmaild`
> NOFILESGID=`id -g qmaild`
> MAXSMTPD=`/bin/cat /var/qmail/control/concurrencyincoming`
> exec /usr/local/bin/softlimit -m 200 /usr/local/bin/tcpserver \
> -vPHR -c "$MAXSMTPD" -x /var/qmail/cdb/smtp.cdb \
> -u "$QMAILDUID" -g "$NOFILESGID" mail.domain2.com smtp
/var/qmail/bin/qmail-smtpd 2>&1
>
^^





Re: smtp on a specific IP

2001-06-01 Thread Kourosh Ghassemieh

At 12:36 PM 5/31/2001 -0700, you wrote:
>My server is running vpopmail.  I also have Multiple IP address' aliased off
>of one network card.
>
>I can do traffic analysis through my router by IP address and this works
>fine for incoming mail.  The problem that I have is the outgoing mail all is
>going out through one IP.  I need to be able to charge my customers for
>traffic.
>
>Is there any way to make different domains send out on their own IP address?
>
>here is my smtpd run from the supervise directory
>  /var/qmail/bin/qmail-smtpd 2>&1
>env - PATH="/var/qmail/bin:/usr/local/bin" \
>tcpserver -v -p -u vpopmail -g vchkpw 0 smtp /var/qmail/bin/qmail-smtpd 2>&1


It may be easier to log all smtp activity and simply parse the logs to
determine the number of mails sent out.  I believe there are patches
out there to allow more detailed logging, possibly also logging the mail
size.  I've followed this thread for a bit and if I understand correctly stock
qmail doesn't have the ability to send mail out through a particular IP and
making it do so is not trivial.

Regards.


-

Kourosh Ghassemieh
MindWare Information Systems & Technologies
9255 Sunset Blvd, Penthouse
West Hollywood CA 90069
(310) 729-1784
[EMAIL PROTECTED]

Networking Solutions for Your Business





Re: smtp on a specific IP

2001-06-01 Thread Greg White

On Fri, Jun 01, 2001 at 08:48:42AM -0700, Ross Davis - Data Anywhere wrote:
> >>
> >> here is my smtpd run from the supervise directory
> >>  /var/qmail/bin/qmail-smtpd 2>&1
> >> env - PATH="/var/qmail/bin:/usr/local/bin" \
> >> tcpserver -v -p -u vpopmail -g vchkpw 0 smtp /var/qmail/bin/qmail-smtpd
> 2>&1
>> attribution Re-added by GW: Karsten W. Rohrbach wrote:
> >^
> >this is the address to bind to.
> >http://cr.yp.to/ucspi-tcp/tcpserver.html
> >
> >cheers
> >/k
> 
> I must be missing something then.  I see that I can tell it what IP to send
> out on for all domains, but how do I tell mail.domain1.com to use IP
> xxx.xxx.xxx.xxx and mail.domain2.com to use yyy.yyy.yyy.yyy
> 
> That is the part I don't understand.
> 

You misunderstand the tcpserver options. Karsten has supplied the
correct answer above. When an address is supplied in place of the '0'
option to tcpserver, that is the address that the child process binds
to. You have no control whatsoever as to which IP is used to send
outbound mail*. Simply run two qmail-smtpd's, one each bound to the two
IPs in question. I think that to get what you seem to want, you may have
to run a second copy of qmail -- if you simply run two different
qmail-smtpds, both will use the same control files. Depends on why you
want separate instances of qmail-smtpd.

Examples:

Where mail1.example.com is IP 192.168.0.1 and mail2.example.com is
172.16.0.1, with appropriate MX records:

run file for mail1.example.com:

#!/bin/sh 
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`/bin/cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 200 /usr/local/bin/tcpserver \
-vPHR -c "$MAXSMTPD" -x /var/qmail/cdb/smtp.cdb \
-u "$QMAILDUID" -g "$NOFILESGID" 192.168.0.1 smtp /var/qmail/bin/qmail-smtpd 
2>&1


run file for mail2.example.com:

#!/bin/sh 
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`/bin/cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 200 /usr/local/bin/tcpserver \
-vPHR -c "$MAXSMTPD" -x /var/qmail/cdb/smtp.cdb \
-u "$QMAILDUID" -g "$NOFILESGID" 172.16.0.1 smtp /var/qmail/bin/qmail-smtpd 
2>&1

Note that your run file differs from mine, I simply mangled my own
rather than hand-type one...

If this is simply for traffic analysis purposes, this should do the
trick...

* Your operating system's routing table, or NAT method, or whatever, may
provide you with a way to control which IP address is used to send
outbound mail. IIRC, there are patches that force qmail to always send
using a specified IP address. Stock qmail, in and of itself, provides no
way to control the IP address used to send mail on, AFAIK.

-- 
Greg White
Those who make peaceful revolution impossible will make violent
revolution inevitable.
-- John F. Kennedy



Re: smtp on a specific IP

2001-06-01 Thread Ross Davis - Data Anywhere

>>
>> here is my smtpd run from the supervise directory
>>  /var/qmail/bin/qmail-smtpd 2>&1
>> env - PATH="/var/qmail/bin:/usr/local/bin" \
>> tcpserver -v -p -u vpopmail -g vchkpw 0 smtp /var/qmail/bin/qmail-smtpd
2>&1
>^
>this is the address to bind to.
>http://cr.yp.to/ucspi-tcp/tcpserver.html
>
>cheers
>/k

I must be missing something then.  I see that I can tell it what IP to send
out on for all domains, but how do I tell mail.domain1.com to use IP
xxx.xxx.xxx.xxx and mail.domain2.com to use yyy.yyy.yyy.yyy

That is the part I don't understand.




Re: smtp on a specific IP

2001-05-31 Thread Karsten W. Rohrbach

Ross Davis - Data Anywhere([EMAIL PROTECTED])@2001.05.31 12:36:58 +:
> My server is running vpopmail.  I also have Multiple IP address' aliased off
> of one network card.
> 
> I can do traffic analysis through my router by IP address and this works
> fine for incoming mail.  The problem that I have is the outgoing mail all is
> going out through one IP.  I need to be able to charge my customers for
> traffic.
> 
> Is there any way to make different domains send out on their own IP address?
> 
> here is my smtpd run from the supervise directory
>  /var/qmail/bin/qmail-smtpd 2>&1
> env - PATH="/var/qmail/bin:/usr/local/bin" \
> tcpserver -v -p -u vpopmail -g vchkpw 0 smtp /var/qmail/bin/qmail-smtpd 2>&1
^
this is the address to bind to. 
http://cr.yp.to/ucspi-tcp/tcpserver.html

cheers
/k

-- 
> Caffeine is proof that God hates mornings too
KR433/KR11-RIPE -- WebMonster Community Founder -- nGENn GmbH Senior Techie
http://www.webmonster.de/ -- ftp://ftp.webmonster.de/ -- http://www.ngenn.net/
karsten&rohrbach.de -- alpha&ngenn.net -- alpha&scene.org -- [EMAIL PROTECTED]
GnuPG 0x2964BF46 2001-03-15 42F9 9FFF 50D4 2F38 DBEE  DF22 3340 4F4E 2964 BF46

 PGP signature


smtp on a specific IP

2001-05-31 Thread Ross Davis - Data Anywhere

My server is running vpopmail.  I also have Multiple IP address' aliased off
of one network card.

I can do traffic analysis through my router by IP address and this works
fine for incoming mail.  The problem that I have is the outgoing mail all is
going out through one IP.  I need to be able to charge my customers for
traffic.

Is there any way to make different domains send out on their own IP address?

here is my smtpd run from the supervise directory
 /var/qmail/bin/qmail-smtpd 2>&1
env - PATH="/var/qmail/bin:/usr/local/bin" \
tcpserver -v -p -u vpopmail -g vchkpw 0 smtp /var/qmail/bin/qmail-smtpd 2>&1