Tried with a similar question earlier, but could not I make headway. So I did new tests and here is the new question:

I did a brand new installation of PHARO 1.4 and GEMSTONE 3.0.1.2 on the same machine. (Linux CENTOS). Loaded seaside 3.0 in Pharo and version 3.0.7.1 in Gemstone using the latest version of Gemtools (1.0 beta 87) with the latest version of glass workspace (1.0 beta 8.7.4).

I opened the workspace and evaluated:

(WAEmailMessage
    from: (WAEmailAddress address: '[email protected]' username: 'fromMe')
    to: (WAEmailAddress address: 'shyam@localhost' username: 'shyam')
    subject: 'Email Test')   
      body: 'This is a Test Email sent'; 
      send.

(BTW, As the default mail host in Gemstone is "mailhost", I added the following line to the /etc/hosts file127.0.0.1 localhost mailhost ).

On Pharo the message is sent and received correctly, while in Gemstone I get a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand #'isEmpty', in the method

readSmtpResult
| result firstChar |
[self readWillNotBlockWithin: 5000]
    whileFalse: [GsFile stderr log: 'Waiting for server to write...'].
result := self readString: 500.
result isEmpty   =========================> HERE result is "nil".
    ifTrue: 
        [self log: 'Empty result'.
        ^false].

The reason being that result returns a nil.

I tried with similar results also on MAC OS X which instead went into a loop in the lines above.

Using tcpdump -X -i lo tcp port 25 and WireShark, I noticed that for GEMSTONE, I saw NO activity while the packets were correctly exchanged for PHARO.

Evidently, I am doing something terribly wrong to get it wrong on two different systems.

Any idea ?

Thanks

Shyam.

1

There are 1 best solutions below

3
On

result is nil because #readString: returned nil.

It seems that the peer does not send any data. As you already traced that there is no activity on port 25 going on, are you sure that the SMTP parameters are correct?

Seaside-Email contains code that you can use to configure your SMTP-Server. Given you have your Seaside application seasideApp, you can do the following:

seasideApp configuration
    addParent: WAEmailConfiguration instance.
seasideApp
    preferenceAt: #smtpServer put: 'your.smtp.host';
    preferenceAt: #smtpPort put: 25;
    preferenceAt: #smtpUsername put: 'your.smtp.username.or.nil.if.unecessary';
    preferenceAt: #smtpUsername put: 'your.smtp.password.or.nil.if.unecessary';
    yourself.

Note that #smtpServer and smtpPort must be configured the way described, as they are used in the GemStone version of GRPlatform>>#seasideDeliverEmailMessage:. I opted to deliberately not use the GemStone defaults.

Also, setting the SMTP parameters this way is ment to work cross-platform; if it does not, please contact me directly.