Thanks, however I cannot use ifconfig.  All it will report is my NAT address, 
which never changes and has no meaning to the outside world (a 10.0.0.* 
internal network) though the mail header will contain my _real_ internet ip 
address nonetheless.

My dsl modem/router is running a NAT internal network.  If I telnet into my 
router and check the NAT table, it lists the current outside world ip address.
Simply sending mail out through my local postmail server will tag my router's 
ip address into to mail header, which is the real information I want.  

Perhaps I can borrow a bit from your method - all I would need is a script 
that would send me an email, message body empty (or not- just containing "ip 
address update" or something as filler), and most importantly of all: send my 
mail program a "Ctrl-D" to complete the message sending process.  That is 
actually the only thing missing for me.  If I can send a Ctrl-D to mail, then 
I am set.  The "message" will go out and I will receive the information I am 
after.

I appreciate the other suggestions but they really don't serve the purpose I 
have.  The only way, right now, that I can know my external ip address on any 
given day other than sending myself a message via my local postfix server as 
I describe above, is to telnet into my DSL modem and check the NAT table.  
This will contain my current "outside" ip address.  I check this manually 
every morning and, as necessary, re-edit the NAT table to allow an ssh port 
forward to my linux box.  When I go to work, I can then ssh to my linux box.  
As soon as my ip address expires or the uswest/qwest servers burp or, by 
apparent policy, they change my dynamic ip, I change my NAT port forward to 
match the new address and go on from there.  By sending myself mail on a 
daily or every other day basis, I will keep abreast of my ever-changing ip 
address and always be able to telnet into my router and, when needed, change 
the NAT table and continue with ssh connections.  A pain in the ass but I 
simply can't afford a static ip right now so I am stuck with this.

By doing this, no matter where I am, at work, out of state, whatever, I can 
check my email, look at the mail header info in this particular message and 
immediately know what my current ip address is.

The only thing that would really top it all off would be to be able to upload 
a script to my cisco router that would run and update the NAT table port 
forward entry every time a new ip address was negotiated.  Between that and 
getting the ip address updates from my mail cronjob, I could always ssh into 
my box inspite of having a dynamic ip - without further work on my part 
(editing the NAT table is easy but is a pain in the ass).

praedor

On Monday 04 December 2000 08:43 pm, you wrote:

> > On Monday 04 December 2000 21:42, you wrote:
> > > On Monday 04 December 2000 06:35 pm, you wrote:
> >
> > [...]
> >
> > > I would like to setup a script that simply sends mail to my
> > > [EMAIL PROTECTED] mail account.  Simply running "mail
> > > [EMAIL PROTECTED]" wont work since it subsequently wants a
[...]
> > I am almost there with this command:
> >
> > mail -s "ip update message" [EMAIL PROTECTED]
> >
> > This will produce a message with a subject of "ip update message" and
> > add my email to the "To:" field.  It does leave an empty message body
> > and doesn't send a "ctrl-d" command to mail which is required to
> > sending.  How do I do that?
[...]
> I do something similar in python, it extracts the ip address ftom
> ifconfig, then mails it to me at my work address
[...]

Keep in touch with http://mandrakeforum.com: 
Subscribe the "[EMAIL PROTECTED]" mailing list.

Reply via email to