Mr. Werkhoven: Thank you very much! That was to the point simple and it works great. As a bonus I got to learn more about regexp and stream editor sed - thanks a lot Theo. -----Original Message----- From: Theo v. Werkhoven [mailto:twe-suse.e@ferrets4me.xs4all.nl] Sent: Saturday, February 07, 2004 7:27 AM To: suse-linux-e@suse.com Subject: Re: [SLE] Anyway to Automate Changing the 'proxy_interface' in Postfix? Fri, 06 Feb 2004, by josh@joslyn.com:
My NAT device changes its "static" IP address from time to time. Is there an easy way to update the 'proxy_interface' setting in 'main.cf' config file? Without the proper proxy_interface setting, my SMPT server does not serve users outside the NAT device. Thanks for any help given.
Use a service like whatismyip.com e.g.: publicipv4=` lynx --dump http://www.whatismyip.com/ |\ grep -i "your ip is" | sed -e 's/.*is //' ` (shameless copy from a 6to4 setup script, GPL Copyleft 2003 Sander, surfipv6 at xs4all .nl) As many time as you need to, poll whatismyip.com in a cronjob, and use 'postconf -e "proxy_interface=$publicipv4"; postfix reload' to re-set the IP. Save the IP, and only change proxy_interface when you get another IP of course. This only works when your ISP has no mandatory proxy server. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 27N , 4 29 45E. SUSE 8.2 Kernel k_athlon-2.4.20 See headers for PGP/GPG info.