2

I have installed on my MAC with MACOSX Lion, in the latest version of Gemtools (1.0 beta 87) with the latest version of glass workspace (1.0 beta 8.7.4) and the latest version of GEMSTONE: 3.1.0.1. On this I have loaded Seaside using :

MCPlatformSupport commitOnAlmostOutOfMemoryDuring: [    
    Gofer project load: 'Seaside30' version: '3.0.7.1'.    

    Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfMetacello';
    load.
    (Smalltalk at: #ConfigurationOfMetacello) perform: #load.


    Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfSeasideRest';
    load.


].
ConfigurationOfSeasideRest project stableVersion load: 'Tests'

All work fine, but the system "hangs" if I attempt to evaluate this piece :

(WAEmailMessage
     from: (WAEmailAddress address: 'xx@aa.com' username: 'fromman')
     to: (WAEmailAddress address: 'shyam1.sundaresan1@gmail.com' username: 'shyam')
     subject: 'Email Test')   
          body: 'This is a Test Email sent'; 
          send.

With debug, I have seen that the place where it hangs is in SendMail >> send

send
    | rc |
    ^self isEnabled
    ifFalse: [self saveToFile]
    ifTrue: [ self halt.
        rc := self openTcpConnection.
        rc
            ifTrue: 
                [   rc ifTrue: [rc := self readSmtpResult] "==> HANGS HERE ==>"
                rc ifTrue: [rc := self sendHelo].
                rc ifTrue: [rc := self readSmtpResult].
                rc ifTrue: [rc := self sendMailFrom].
                rc ifTrue: [rc := self readSmtpResult]. 

and specifically, it does not exit (for ever) from the following loop whileFalse in readSmtpResult:

readSmtpResult
| result firstChar |

    [self readWillNotBlockWithin: 5000]
        whileFalse: [GsFile stderr log: 'Waiting for server to write...'].

Using Telnet, that port connects well

shyam:opt shyam$ telnet mailhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 shyam.homenet.telecomitalia.it ESMTP Postfix

I have also inspected that the smtpHost, smtpPort, ownDomainName etc... are all correct. Have also noticed that nothing is written in the /var/log/mail.log

Besides, The same piece of code on a PHARO 1.4 engine + Seaside on the same machine works fine and using the following command line, the mail is correctly RELAYED through gmail.

echo 'It works' | mailx -s 'Test message' shyam1.sundaresan1@gmail.com 

Any indicators to help me overcome the impasse will be gratefully welcome.

Thanks

Shyam.

  • +1 for putting a lot of effort into solving. I think i had a similar problem once but curiously not with Gemstone but with Squeak (for which your's works). The solution was to append CRLFCRLF (ascii \13\10\13\10) to the smtp. For some reason the mail server waited for that and did not want to answer because of that. – Bernd Elkemann Feb 27 '13 at 20:47
  • What's actually happening on the wire? When you get to #readSmtpResult, what does Wireshark (or similar) tell you? – Frank Shearar Feb 28 '13 at 11:47
  • The SMTP-client is a little bit behaving like `expect`. What might happen is that the client connected and now waits in `readSmtpResult` for the server to answer something like `220 server ESMTP sendmail`. Can you log what comes from and goes onto the wire? – Tobias Feb 28 '13 at 15:11
  • @frank and @tobias I tried with : `tcpdump -tA -v -i lo0 port 25`. Whereas, the `telnet mailhost 25` outputs copious output, the Gemstone produces no output at all. BTW, the last call before entering the system primitive is (extract) : `connectTo: portNumber on: host | res | res := true. [res isKindOf: Boolean] whileTrue: [res := self _twoArgPrim: 2 with: host with: portNumber. res == false ...` Here the host is 'mailhost' and the portNumber is 25 (as expected). The value returned "res" is 47. @eznme, I want to try what you say, but have idea how to do it. Thanks – Shyam Sundaresan Feb 28 '13 at 17:33
  • Downloading Wireshark and will do some more homework and get back. Thanks – Shyam Sundaresan Mar 02 '13 at 01:58
  • Tried with WireShark. As soon as I evaluate the expression, I see a flurry of activity between ports 50836 and 50834 (i.e between the "gem" and "squeak" processes, but _absolutely nothing_ when I set filter to tcp.port=25 or protocol type=smtp. **With Pharo 1.4 and telnet, I see the correct information on port 25 and smtp.** I am not able to dive further than the call to the primitive: `res := self _twoArgPrim: 2 with: host with: portNumber`! Both the host ('mailhost') and portNumber (25) are correctly passed. I also tried with the latest version of GEMSTONE 3.1.0.2.. No luck.. Please help! – Shyam Sundaresan Mar 02 '13 at 02:45
  • What happens if you email YOURUSERID@localhost instead of trying to send to gmail? – Warren P Mar 02 '13 at 19:13
  • @WarrenP, `echo 'It works' | mailx -s 'Test message' shyam@localhost` works and not only that the same piece (with shyam@localhost) in PHARO works. I can see the mails received using the `mail`command. Looks as if GEMSTONE is not recognizing "mailhost" (which I have placed in the /etc/hosts as equal to 127.0.0.1) just like localhost. Thanks. – Shyam Sundaresan Mar 03 '13 at 01:29

0 Answers0