On Dec 11, 2010, at 4:33 PM, Milo Velimirović wrote:

> 
> On Dec 11, 2010, at 2:08 PM, Levan, Jerry wrote:
>> 
>> It turns out that it is not hard to get the Airport Extreme Base Station 
>> external address:
>> 
>> [mbp:]$ snmpwalk -Ov -OQ -c public router ipAdEntAddr
>> 76.177.12.46
>> 127.0.0.1
>> 127.0.0.2
>> 169.254.162.44
>> 192.168.1.1
>> 
>> The smnpwalk command above grabs a part of the ipAddr table which lists info 
>> on all
>> ip addresses assigned to the machine.
>> 
>> The first (at least in this case ) is the external ip of the router.
>> The second two addresses are a bit of mystery to me but they are certainly 
>> not the external address
> No mystery, 127.0.0.0/8 is defined as loopkback/localhost address(es).
>> The fourth is a special configuration address, try whois 169.254.162.44 for 
>> more info.
> It's merely a self-assigned, unroutable address.
>> The last address is the internal lan address of the router.
> 
> [snip]
> 


The last part of the puzzle was to mail the results off site...

Earlier I noted that my ISP puked when it saw my local domain
as the envelope-from in the tramsaction.

After playing around with the sendmail command on the mac I found
the following would work...

Create a text file, say message.txt and put a To:, From: and Subject:
header at the top of the file and then dump the results of the
above snmpwalk into the file.

The following command seems to work for me...

sendmail -t -f [email protected] < message.txt

the -t command picks up the To: field in the message.txt file , the -f sets the 
envelope-from field,
that's the critical step evidently many smtp servers reject domains that cannot 
be resolved.

It appears to me that using plain old mail is like using

sendmail -t < message.txt

which defaulted to using my local domain as the envelope-from field

Normally (I think ) the local smtp-server would be used but from times past
I have set up a redirection via the /etc/postfix/transport file that would
choose the roadrunner smtp-server rather than the local smtp server for sending
mail to many external locations. ( that whole idea seems dead now...)

Just out of curiosity, am I the only person who wants to send a 'scripted 
email' to
a location outside of the local network? It seems like that would be a handy 
notification tool.

Jerry
_______________________________________________
MacOSX-admin mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-admin

Reply via email to