On Thu, Sep 01, 2016 at 08:01:20PM +0000, Steve Barnes wrote:
> Changed Email hosting this week and forgot all about MikroTik Routers and the
> Dude using an IP address for SMTP only.
>
> The new service is a hosted Email service and a static IP is not an option.
>
> What do you guys do to by-pass this issue. I was so looking forward to not
> having an email server.
Write a script to [resolve mail.server.name] and update the
e-mail servers settings with the new IP from scheduler every X
hours/days/weeks/...
This is my radius updater. Ignore the lanprivaddressnoprefix. That's
created by a different script at boot time:
I run the radiusresolver script once per hour. I've been thinking about
expanding it to handle radius, ntp, and a few other things.
add name=radiusresolver \
policy=ftp,read,write,policy,test,password \
source=":local rad2resolvedIP [:resolve \"rad2.domain.net\"];\
\n:local rad2ID [/radius find comment=\"rad2.domain.net\"];\
\n:local rad2currentIP [/radius get \$rad2ID address];\
\n\r\
\n:local rad3resolvedIP [ :resolve \"rad3.domain.net\"];\r\
\n:local rad3ID [/radius find comment=\"rad3.domain.net\"];\r\
\n:local rad3currentIP [/radius get \$rad3ID address];\r\
\n\
\n/global lanprivaddressnoprefix\
\n\
\n:if (\$rad2resolvedIP != \$rad2currentIP) do={\
\n /radius set \$rad2ID address=\$rad2resolvedIP
src-address=\$lanprivaddressnoprefix ;\
\n /log info \"rad2 ip updated\";\
\n}\
\n\
\n:if (\$rad3resolvedIP != \$rad3currentIP) do={ \r\
\n /radius set \$rad3ID address=\$rad3resolvedIP
src-address=\$lanprivaddressnoprefix ;\r\
\n /log info \"rad3 ip updated\";\r\
\n}"
--
Scott Lambert KC5MLE Unix SysAdmin
[email protected]
_______________________________________________
Mikrotik-users mailing list
[email protected]
http://lists.wispa.org/mailman/listinfo/mikrotik-users