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

Reading POP mail

 [1/15] from: matt:blis at: 1-Oct-2001 14:20


Hi all, wondering if someone could enlighten me... I'm trying to read email from a pop account on the mail server from a CGI script using mailbox: open pop://myuser:[mypass--mydomain--com] but I get an error ** User Error: Server error: tcp connection failed but when i try the *exact* same command (copy and paste from the cgi script) via the rebol console it connects properly Anyone got any ideas? TIA Matt.

 [2/15] from: moliad:hotmai:l at: 1-Oct-2001 14:24


Hi, are you using a proxy? if so, maybe your cgi-script isn't sourcing the same user.r file? where I work, I installed a rebol just for the cgi and another one for users to play with so I know that the cgi won't get broken... maybe something similar is affecting you? -Max

 [3/15] from: tim:johnsons-web at: 1-Oct-2001 11:31


Hi Matt: On Mon, Oct 01, 2001 at 02:20:10PM +0100, Matt Burns wrote:
> Hi all, wondering if someone could enlighten me... > I'm trying to read email from a pop account on the mail server from a
<<quoted lines omitted: 5>>
> script) via the rebol console it connects properly > Anyone got any ideas?
Could it be a side affect from other code in your script? Can you provide the list with the rest of the script? (Taking care of course to obfuscate the password/login strings) ..later -- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [4/15] from: tim:johnsons-web at: 1-Oct-2001 11:46


On Mon, Oct 01, 2001 at 02:24:35PM +0000, maxim olivier wrote:
> Hi, > > are you using a proxy? > > if so, maybe your cgi-script isn't sourcing the same user.r file? where I > work, I installed a rebol just for the cgi and another one for users to play > with so I know that the cgi won't get broken... maybe something similar is > affecting you?
Amen to that Max. :>) I should have mentioned that. Matt, you can run set-net directly from your script.
> -Max > >From: Matt Burns <[matt--blis--co--uk]>
<<quoted lines omitted: 34>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [5/15] from: matt:blis at: 1-Oct-2001 19:58


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
<<quoted lines omitted: 24>>
> (Taking care of course to obfuscate the password/login > strings) ..later
Thank. The complete script (minus the obvious user/domain details) is as follows: REBOL [Title: "check mail"] print "Content-Type: text/plain" print "" mailbox: open pop://user:[pass--domain--com] while [not tail? mailbox] [ msg: import-email first mailbox print "mail: " print msg/subject print newline mailbox: next mailbox ] close mailbox The error occurs on the open line. I've also tried entering this in the rebol console via telnet, and I get the same error. Any help appreciated. Matt.

 [6/15] from: holger:rebol at: 1-Oct-2001 13:14


On Mon, Oct 01, 2001 at 07:58:16PM +0100, Matt Burns wrote:
> Thank. > The complete script (minus the obvious user/domain details) is as
<<quoted lines omitted: 3>>
> print "" > mailbox: open pop://user:[pass--domain--com]
On possible explanation of the problem is that the DNS settings on the machine you are running this on are different than on the machine where it works correctly. Try the following: on the machine where the command works correctly type: host domain.com in a shell window to find out the IP address of domain.com. Then use that IP address in the pop:// URL instead of domain.com. Another possibility is that the host where it is not working is outside of a firewall that prevents POP access to domain.com. In that case you are out of luck. -- Holger Kruse [holger--rebol--com]

 [7/15] from: matt:blis at: 1-Oct-2001 21:38


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
<<quoted lines omitted: 13>>
> is outside of a firewall that prevents POP access to > domain.com. In that case you are out of luck.
Thank Holger. The POP server is actually on the same machine as the rebol install (it's a small dedicated server) and I have already tried using the full IP address, "localhost" and 127.0.0.1, none of which worked. I'll try some other things and see what I can come up with. Thanks all for your help. Matt.

 [8/15] from: tim:johnsons-web at: 1-Oct-2001 14:50


Hi Matt:
> The complete script (minus the obvious user/domain details) is as > follows:
<<quoted lines omitted: 10>>
> ] > close mailbox
Here's another thought: I'm not as seasoned a rebol programmer as many on this list, but I use rebol requently for SMTP, less often for POP. Here's a question: regarding the following line, which you have obfuscated: mailbox: open pop://user:[pass--domain--com] ? Are you using your domain OR are you using the full name of you POP server. Example: My domain is johnsons-web.com BUT postman.johnsons-web.com is my POP server. Just checking :>) ...
> The error occurs on the open line. I've also tried entering this in the > rebol console via telnet, and I get the same error.
<<quoted lines omitted: 4>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [9/15] from: matt:blis at: 1-Oct-2001 23:29


> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]
<<quoted lines omitted: 15>>
> is my POP server. > Just checking :>) ...
Hehe thanks for thinking about this a bit more! As it stands, I have a domain redirect to the mailserver, so domain.com points to mail.domain.com. TBH I'm really confused by this, as I can get access from outwith the server itself (the script works fine locally) but on the server itself I get an error. Bizarre. Matt.

 [10/15] from: tim:johnsons-web at: 1-Oct-2001 15:35


On Mon, Oct 01, 2001 at 11:29:06PM +0100, Matt Burns wrote:
> Hehe thanks for thinking about this a bit more! > As it stands, I have a domain redirect to the mailserver, so domain.com
<<quoted lines omitted: 3>>
> get an error. > Bizarre.
Then I think Holger on the right track with a dns problem. (But it wouldn't hurt to try the actual pop server name OR it's raw I.P. address - just 'ping' for that)
> Matt. > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [11/15] from: matt:blis at: 2-Oct-2001 0:14


I found the problem. For some reason, rebol on the server was trying to connect via APOP rather than vanilla POP, and because the account wasn't specified as APOP, login couldn't be verified. I found this using the trace/net function (and watching the output) At blooming last. Is APOP the default POP access method, or is there some specifier I can use to change this? I didn't set this up manually... Oh, well... Thanks. Matt.

 [12/15] from: phil:hayes:cnutarch at: 1-Oct-2001 22:54


Matt, Remember when you are running cgi you're not using the same environment as the rebol/command prompt. What uid is the cgi proicess running as ? What are the environmental settings? try "trace/net on" to see why the tcp connection is failing ? Phil

 [13/15] from: holger:rebol at: 1-Oct-2001 17:44


On Tue, Oct 02, 2001 at 12:14:49AM +0100, Matt Burns wrote:
> I found the problem. For some reason, rebol on the server was trying to > connect via APOP rather than vanilla POP, and because the account wasn't
<<quoted lines omitted: 3>>
> Is APOP the default POP access method, or is there some specifier I can > use to change this? I didn't set this up manually... Oh, well...
Prior to Core 2.5 APOP was not supported at all. In Core 2.5 REBOL attempts APOP if the server signals that it supports APOP (or that it at least knows how to correctly reject it) by putting its date stamp into the login message. Unfortunately there are some POP servers out there which signal that they support APOP but then close the connection (instead of returning a proper error) when the application attempts to use it :-(. Because of that... ... current versions of View, Command etc. (and future versions of Core) no longer attempt to use APOP by itself. Instead you need to enable it by settings system/schemes/pop/algorithms to 'apop. Without that only regular pop is used. It looks like you used different REBOL versions on different machines, and your POP server is broken in that particular way... To disable APOP in Core 2.5 put the following line into your user.r or at the beginning of your script. You should check for system/product and system/version so it does not get executed accidentially on newer versions: change pick find second get in system/schemes/pop/handler 'open 'if 3 true -- Holger Kruse [holger--rebol--com]

 [14/15] from: matt:blis at: 2-Oct-2001 9:35


Phil Hayes <[phil--hayes--cnutarch--net]> wrote on 01/10/01 22:54:21:
>Matt, > >Remember when you are running cgi you're not using the same environment as >the rebol/command prompt. >What uid is the cgi proicess running as ? >What are the environmental settings? > >try "trace/net on" to see why the tcp connection is failing ?
Thanks Phil, I found this myself by accident (and a little help from the official guide) :) Matt.

 [15/15] from: matt:blis at: 2-Oct-2001 9:36


[holger--rebol--com] wrote on 02/10/01 01:44:42:
>On Tue, Oct 02, 2001 at 12:14:49AM +0100, Matt Burns wrote: >> I found the problem. For some reason, rebol on the server was trying to
<<quoted lines omitted: 25>>
>newer versions: >change pick find second get in system/schemes/pop/handler 'open 'if 3 true
Thanks for the explanation Holger. I'm using rebol/view on my machine here and at home (win98/2k), and rebol/core on the server(linux) so there's definitely the possibility of version mismatches. Anyway, problem solved (this one at least!) so thank you everyone for your help. Very much appreciated. Now, just to write these mailbots... Regards, Matt.

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