Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

smtp not permitted to relay workround

 [1/1] from: gchiu::compkarori::co::nz at: 14-Jun-2005 9:11

For those without smtp services on web servers, and plugins on web pages, you could try this work round. First off, download %dig.r from the library at This function gets the lowest MX record given the domain. get-mx-ip: func [ "Returns the ip address of the lowest MX record" nameserver [tuple!] domain [string!] /local ans result ][ result: copy [] ans: read to-url rejoin [ "dig://" nameserver "/MX/" domain ] foreach rec ans/answers [ repend result [ rec/rdata/preference rec/rdata/exchange ] ] ; get the lowest preference for the MX record result: second sort/skip result 2 foreach rec ans/additionals [ if rec/name = result [ return rec/rdata/ip ] ] return read join dns:// result ] So, say you wanted to send an email to caaarl who is at My local name server is at So, smtp-server: get-mx-ip "" == We can now plug in this value to set-net set-net reduce [ ['myemail--where--com] smtp-server ] And we should be able to send caaarl a message using his own smtp server which should accept mail for him as the address is within the domain the server services ie. it will not be relaying send [caaarl--rebol--com] "test message" Of course you will have to handle errors, and resend if the server is busy etc, which you may not have to do if you have a full smtp server. -- Graham Chiu