making sendmail choose relay depending on the ip number

making sendmail choose relay depending on the ip number

Post by Steinar Ban » Wed, 09 Feb 2000 04:00:00



Platform: Dell Inspiron 3500, SuSE linux 6.2, sendmail 8.9.3

My Dell laptop is either online in one of two LANs where it gets its
IP number from DHCP, or from home via a modem.

I would like to let sendmail choose what relay to use, depending on
the IP number of the laptop.  This is to drop off the mail as soon as
possible to a machine that's permanently connected to the net.

Is it possible to hack the sendmail.cf file to do this?  Is this
possible to hack in an m4 file (it should be a simple satellite
machine with no address rewrites, talking to a hub, where the address
of the hub is different for different addresses of the satellite).

Thanx for any and all tips!

- Steinar

 
 
 

making sendmail choose relay depending on the ip number

Post by Carl Byingt » Wed, 09 Feb 2000 04:00:00


-----BEGIN PGP SIGNED MESSAGE-----


Quote:

>Platform: Dell Inspiron 3500, SuSE linux 6.2, sendmail 8.9.3

>My Dell laptop is either online in one of two LANs where it gets its
>IP number from DHCP, or from home via a modem.

>I would like to let sendmail choose what relay to use, depending on
>the IP number of the laptop.  This is to drop off the mail as soon as
>possible to a machine that's permanently connected to the net.

>Is it possible to hack the sendmail.cf file to do this?  Is this
>possible to hack in an m4 file (it should be a simple satellite
>machine with no address rewrites, talking to a hub, where the address
>of the hub is different for different addresses of the satellite).

I presume you are not running sendmail in daemon mode since you don't
have a static ip address.

Somewhere there should be a script that runs when the ethernet/modem
interface comes up. This script could simply copy the proper file into
/etc/sendmail.cf, and then your sendmail will use the specified
smarthost.

- --
PGP key available from the key servers.
Key fingerprint 95 F4 D3 94 66 BA 92 4E  06 1E 95 F8 74 A8 2F A0

-----BEGIN PGP SIGNATURE-----
Version: 4.5

iQCVAgUBOKBkutZjPoeWO7BhAQFCDAP+O7hvaVh39bhP3rN1iODwyU+mNP4VZiu4
5Ow+1NFb2MpYpD1AQJ67mRlLlz6uo6DW7AESus05MC9kwMMNm7RjppY3c1fSKUhd
lcGME8RzWgs0Pk/M61e+XqWP36myBXnazXc+/8N7GXEfQuUkZFl4p4ihLBDeUJ/+
L7GeVYPYCOE=
=ECPZ
-----END PGP SIGNATURE-----

 
 
 

making sendmail choose relay depending on the ip number

Post by Steinar Ban » Thu, 10 Feb 2000 04:00:00



> I presume you are not running sendmail in daemon mode since you
> don't have a static ip address.

Actually, I am.  Is this a problem?  Does that sendmail run with the
assumption that it had the address with which it was booted?

Quote:> Somewhere there should be a script that runs when the ethernet/modem
> interface comes up. This script could simply copy the proper file into
> /etc/sendmail.cf, and then your sendmail will use the specified
> smarthost.

Yes, that's a possibility.

Thanx for the tip!

 
 
 

making sendmail choose relay depending on the ip number

Post by Neil W Ricker » Fri, 11 Feb 2000 04:00:00




>> I presume you are not running sendmail in daemon mode since you
>> don't have a static ip address.
>Actually, I am.  Is this a problem?  Does that sendmail run with the
>assumption that it had the address with which it was booted?

Yes.

Quote:>> Somewhere there should be a script that runs when the ethernet/modem
>> interface comes up. This script could simply copy the proper file into
>> /etc/sendmail.cf, and then your sendmail will use the specified
>> smarthost.
>Yes, that's a possibility.

Then restart your daemon in that same script.
 
 
 

making sendmail choose relay depending on the ip number

Post by Steinar Ban » Thu, 17 Feb 2000 04:00:00




>>> Somewhere there should be a script that runs when the
>>> ethernet/modem interface comes up. This script could simply copy
>>> the proper file into /etc/sendmail.cf, and then your sendmail will
>>> use the specified smarthost.
>> Yes, that's a possibility.
> Then restart your daemon in that same script.

I think I'll go for a different and simpler solution (as suggested on
comp.os.linux.portable) : make the script change the hosts file
according to the IP number, and define the mail relay in this file.
 
 
 

1. making sendmail use IP alias to send mail, not real IP

I have a machine that is on a network that has 2 ISPs connected to the
same router.  The machine's primary address is from 1 ISPs pool and the
alias address is from the other provider.  How do I make sendmail send
mail using the alias IP (so that it gets routed through the ISP that
uses the alias' IP range).  Basically I want the web server on
the machine to be accessed through one ISP and mail to leave using the
other ISP, any suggestions?  I am running RH 6.2 with SendMail 8.11.
Thanks,

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Update to Scottish Show

3. Making Sendmail bind to only one IP address so I can run multiple versions of Sendmail

4. CPU usage: nan0x7ffffe00

5. Sendmail SMARTHOST does not work with [IP number]

6. PMX Font Path Problem

7. how to relay depending on destination

8. ADV: eValid Review by CTLabs

9. roaming relay control based upon ip given ip-range ?

10. Relay depending on domain name

11. Relay depending on user

12. Making Sure That Sendmail Will Not Relay