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

IP Address

 [1/11] from: the::optimizer::tiscali::it at: 8-Jan-2004 18:03


Hi again, few questions (again). 1. is there a way to obtain the IP address of a e-mail sender from the header of the message? 'cause I have not find it directly specified there, but those of the smtp servers which receive the mail. 2. I'm building a bot in Rebol that can receive mails, parse them and execute the commands specified in them. This is to be able to interact with my computer at home while I'm at work as there have only e-mail service and my home ip address is not static (so putting apache on it and then using CGI has to be "tunneled" through the use of mail as information vector). One of the things I would like to create are good HTML reports of the message/commands received from the bot logs file. I would like to save those logs in XML format, but I have not found a simple way to create the XML files. From the XML I then will easily use a Rebol script that converts them into HTML and sends them back as a mail. Is there a good (but simple) XML and HTML builder in Rebol out there that I can embed in my bot (something more than XMLgen)? Once finished I'll upload the sources of the bot to the library (under which category still I do not know). This is more as an exercise than for real use as the bot already works but there's not advanced logging abilities. Thanks Mauro

 [2/11] from: AJMartin:orcon at: 24-Jan-2004 11:45


Mauro wrote:
> Is there a good (but simple) XML and HTML builder in Rebol out there that
I can embed in my bot (something more than XMLgen)? Yes. You could use my ML.r script, which generates HTML and/or XML from a Rebol dialect. The following function shows my common envelope to surround a CGI response: Envelope: func [Head [block!] Body [block!]] [ print rejoin [ "Content-Type: " 'text/html newline newline ML compose/deep [<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> html [ head [(Head)] body [(Body)] ] ] ] quit ] If you're interested in it, let me know, and I'll send you the scripts. -- Andrew J Martin Speaking in tongues and performing miracles. ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/

 [3/11] from: petr:krenzelok:trz:cz at: 8-Jan-2004 22:49


A J Martin wrote:
>Mauro wrote: >>Is there a good (but simple) XML and HTML builder in Rebol out there that
<<quoted lines omitted: 4>>
>Rebol dialect. The following function shows my common envelope to surround a >CGI response:
Why do you use below doctype instead of e.g. XHTML Transitional one? Just curious ...
>Envelope: func [Head [block!] Body [block!]] [ > print rejoin [
<<quoted lines omitted: 13>>
> ] >If you're interested in it, let me know, and I'll send you the scripts.
Thanks, -pekr-<

 [4/11] from: the:optimizer:tiscali:it at: 9-Jan-2004 2:31


On Fri, 9 Jan 2004 09:11:13 +1300, A J Martin <[AJMartin--orcon--net--nz]> wrote:
> Mauro wrote: >> Is there a good (but simple) XML and HTML builder in Rebol out there
<<quoted lines omitted: 21>>
> ] > If you're interested in it, let me know, and I'll send you the scripts.
Yes thanks. I'll have a look to see if it can solve some problems I'm having with nested nodes. Isn't it in the library? I can't find it in my archive. (and was it there, I probably would have not looked at it... a script named ML.r that generates HTML and XML? Is it for MetaLanguages? MarkupLanguages?) Thanks again Mauro

 [5/11] from: AJMartin:orcon at: 24-Jan-2004 11:45


Mauro wrote:
> Isn't it in the library? I can't find it in my archive.
The one in the library is a bit out of date now.
> (and was it there, I probably would have not looked at it... a script
named ML.r that generates HTML and XML? Is it for MetaLanguages? MarkupLanguages?) :) It stands for MarkupLanguage. I've sent a copy directly. -- Andrew J Martin Speaking in tongues and performing miracles. ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/

 [6/11] from: AJMartin:orcon at: 24-Jan-2004 11:45


Pekr wrote:
> Why do you use below doctype instead of e.g. XHTML Transitional one?
Because it allows me to use XHTML, SVG and MathML all in the one XHTML document. :) -- Andrew J Martin Speaking in tongues and performing miracles. ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/

 [7/11] from: gchiu:compkarori at: 24-Jan-2004 11:45


On Thu, 08 Jan 2004 18:03:06 +0100 M&F <[the--optimizer--tiscali--it]> wrote:
>1. is there a way to obtain the IP address of a e-mail >sender from the >header of the message? 'cause I have not find it directly >specified there, >but those of the smtp servers which receive the mail.
You should be able to get the IP address of the sender's mail server. It should be in the first or second chronologically received: lines. If the received lines are forged, then there's more work to be done. -- Graham Chiu http://www.compkarori.com/cerebrus/<

 [8/11] from: gchiu:compkarori at: 24-Jan-2004 11:45


On Thu, 08 Jan 2004 18:03:06 +0100 M&F <[the--optimizer--tiscali--it]> wrote:
>service and my home ip address is not static (so putting >apache on it and >then using CGI has to be "tunneled" through the use of >mail as information >vector).
What I did a couple of years ago was to get my home PC to constantly update a remote web page with it's own IP address if that address changed so I could come in that way. -- Graham Chiu http://www.compkarori.com/vanilla/<

 [9/11] from: antonr:iinet:au at: 9-Jan-2004 18:03


I don't think you can. That's the problem with email - you don't know who it's coming from. That's why we get so much spam. However, it looks like you want to send your address from work, so your home computer can contact your work computer. Surely you can just embed the ip address in the mail you are sending. But I think there will be a problem: your work ip will be an internal address on a subnet, or a dynamic ip, and behind a firewall, so it will not be visible from the outside. I have an idea, both machines check for mail and send to the same mail account. But each puts an identifier in the message so that you can tell who it's from. When each machine checks the mail, it doesn't delete it straight away necessarily. It first reads the mail, and only deletes those mails which were intended to be read by this machine. To do this, you need to open a pop port to your account manually, like this: port: open join pop:// [user ":" pass "@" system/schemes/pop/host "/"] Now read and examine the mail you have before deciding which to delete. (Can help with that). Anton.

 [10/11] from: didec:tiscali at: 9-Jan-2004 12:49


Re: IP Address If you want to verify, you can use my Delete-emails.r script that let you see emails awaiting on your POP server, and allow you to see the full header with all "Received:" field. But I think you will only see the IP of your provider host, not you computer one. do http://membres.lycos.fr/didec/rebsite/delete-emails/delete-emails.r (View/1.2.8+ needed) Eventually, this script parse the "Received:" fields to pick IP addresses in order to check for spam in RBL (spamcop...), so if you want to do the same, you can pick the appropriate code in it. DideC

 [11/11] from: the:optimizer:tiscali:it at: 10-Jan-2004 1:57


On Fri, 9 Jan 2004 18:03:30 +1100, Anton Rolls <[antonr--iinet--net--au]> wrote:
> I don't think you can. That's the problem with email - > you don't know who it's coming from. That's why we
<<quoted lines omitted: 7>>
> ip, and behind a firewall, so it will not be visible > from the outside.
Well it was just for "statistical" recording (call it data-collection-mania). For every message the bot is to be processing the important data is extracted and I thought that the ip address could be found as well. I will extract the first smtp server in the chain, where the mail should have started (that should be the last in the header list, isn't it?). As I said this is more for fun, just to undestand more about the language and on all many other things the language makes easy to manipulate. Nevertheless the constant update at work of the progress eMule is doing at home is not that bad 8) Mauro<

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted