Operating System - Linux
1822143 Members
3889 Online
109640 Solutions
New Discussion юеВ

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

 
Geoff Wild
Honored Contributor

How to relay email on a DSL DHCP connection to my Sendmail server?

Okay - this is driving me crazy - I have a server on the internet - which I have locked down as tight as I can - it is my main email server - I connect via pop. At home, I have a linsys DSL router - problem is - my externel IP is DHCP and changes every couple of days. I even tried to setup a hostname for myself with a Dynamic DNS name- but my ISP has PTR records for the DHCP address range - so sendmail goes to them first and I get "relaying denied"....so I have to constantly modify my /etc/mail/access file and add my new ip for relay....

How can I configure my sendmail to relay a changing DHCP address on the fly? I don't want to open my server up to the world for relaying....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
7 REPLIES 7
Stuart Browne
Honored Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

Ok, so you're wanting to change the '/etc/mail/access' file on the server which has the dynamic address, yes?

Or you're wanting to change the access file on a remote server as your local address is the one that changes?

(Sorry, I'm not sure which end is which here).

If the machine with the DHCP-assigned address is the one that needs to have the file changed, it should be relativly simple. Periodically check the address (ip addr list eth0 | awk '/inet/ {print substr($2,0,index($2,"/")-1)}'), and seeing if it's in the '/etc/mail/access' file. If you dump the current one to a temporary file, you'll know which one to remove when the time comes ripe... then just re-make the db.

If it's on a remote-machine that you're wanting to alter.. Does it accept mail to it's self when it's in the broken state?

Or possibly change it from IP based relaying to user-authenticated-based relaying, using 'smtp+auth' stuff.
One long-haired git at your service...
Vernon Brown_4
Trusted Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

I think you can set up your access file to relay to a range of addresses. Your DHCP addresses will be in a certain range; maybe you could specify that range and still keep alien traffic from relaying.
Geoff Wild
Honored Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

Stuart - server is remote and has a fixed ip address.

I've heard of 'smtp+auth' - no idea how to implement - sounds like that may be the way to go....

Vernon - I don't want to allow anyone that receives an ip address from my local ISP the the ability to relay - so the range method is not an option.

Thanks...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

The only reliable answer to this problem is a fixed IP address. I think SBC charges $15-$25 a month for this.

The problem you have is that your provider doesn't want you running ANY servers on the DSL. Its probably a violation of your terms of service.

Couple of options: speakeasy.net has plans as low as $75 a month that give you a fixed IP address and they don't care if you relay or not.

I have a backup web server sitting at a friends DHCP DSL. I have a DNS record that is rebuilt every day based on and email from that server. If the IP address has changed, the DNS record gets rebuilt.

This has allowed me to briefly fail over web and mail services to a DHCP system.

Practically speaking I really think you need a fixed IP address. I would not run a business email system in a DHCP system more than the few hours it takes to get a problem resolved.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

Steven,

Actually, my server has a fixed ip addy - it's my home network that is DHCP.

My server is at another ISP - far away from my home.

I have found a workaround - I have pointed my email client to use my home's ISP's smtp server for outgoing email...and my server for incoming pop....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

I guess I misunderstood.

That is exactly what I did before I became an ISP and no longer needed to do that.

Your solution is solid and will work perfectly.

Congrats.

0 Points please.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chris Saunderson
Frequent Advisor

Re: How to relay email on a DSL DHCP connection to my Sendmail server?

I recall reading an article (http://popbsmtp.sourceforge.net/) about implementing POP before SMTP.

Postfix supports SMTP AUTH for clients, which may be an option.
Ted Nugent called. He wants his shirt back.