Re: How to email

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
Here's a little blogging about it

http://blog.saush.com/?p=199

Ramon Leon

-------------

It looks very useful, but I'm still having problems. There is something
very BASIC that I'm doing wrong, apparently.

Following the blog, I'm using this code fragment:

| username password client |
username := 'richard.eng'.
password := 'Bugaboo'.
client := SMTPClient openOnHostNamed: 'smtp.broadband.rogers.com' port: 25.
client user: username; password: password; login; initiateSession.
client mailFrom: '[hidden email]';
  recipient: '[hidden email]';
  data:
'Subject: Hello from SMTPClient!
From: [hidden email]
To: [hidden email]
Sending from SMTPClient!'.
client quit.


The above chokes at #login. The debugger says:

TelnetProtocolError: 501 malformed auth input (#5.5.4)

Apparently it hits a problem at #checkResponse:

login
  self user ifNil: [^self].
  self sendCommand: 'AUTH LOGIN ' , (self encodeString: self user).
  [self checkResponse]
    on: TelnetProtocolError
    do: [ :ex | ex isCommandUnrecognized ifTrue: [^ self] ifFalse: [ex pass]].
  self sendCommand: (self encodeString: self password).
  self checkResponse


I'm using the exact same username and password as in Evolution (with
which I'm sending this email). So why is it complaining about
"malformed auth input"???

One thought I had was that the SMTP server authenticates against the
POP server at Rogers, I believe (I could be wrong). Maybe this is the
problem?

Regards,
Richard

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Boris Popov, DeepCove Labs (SNN)
Re: [Seaside] How to email

Silly question, but did you try it without using authentication at all? Some SMTP servers don't use it, but rather relay everything from the IP block(s) that belong to the ISP.

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: [hidden email] <[hidden email]>
Sent: Tue Aug 14 07:56:33 2007
Subject: Re: [Seaside] How to email

Here's a little blogging about it

http://blog.saush.com/?p=199

Ramon Leon

-------------

It looks very useful, but I'm still having problems. There is something
very BASIC that I'm doing wrong, apparently.

Following the blog, I'm using this code fragment:

| username password client |
username := 'richard.eng'.
password := 'Bugaboo'.
client := SMTPClient openOnHostNamed: 'smtp.broadband.rogers.com' port: 25.
client user: username; password: password; login; initiateSession.
client mailFrom: '[hidden email]';
  recipient: '[hidden email]';
  data:
'Subject: Hello from SMTPClient!
From: [hidden email]
To: [hidden email]
Sending from SMTPClient!'.
client quit.


The above chokes at #login. The debugger says:

TelnetProtocolError: 501 malformed auth input (#5.5.4)

Apparently it hits a problem at #checkResponse:

login
  self user ifNil: [^self].
  self sendCommand: 'AUTH LOGIN ' , (self encodeString: self user).
  [self checkResponse]
    on: TelnetProtocolError
    do: [ :ex | ex isCommandUnrecognized ifTrue: [^ self] ifFalse: [ex pass]].
  self sendCommand: (self encodeString: self password).
  self checkResponse


I'm using the exact same username and password as in Evolution (with
which I'm sending this email). So why is it complaining about
"malformed auth input"???

One thought I had was that the SMTP server authenticates against the
POP server at Rogers, I believe (I could be wrong). Maybe this is the
problem?

Regards,
Richard

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
In reply to this post by Richard Eng
Silly question, but did you try it without using authentication at all? Some
SMTP servers don't use it, but rather relay everything from the IP block(s)
that belong to the ISP.

Cheers!

-Boris

-----------

I don't think this is within my control. My ISP's (Rogers') SMTP server
requires authentication in order to work. I don't think I can ask them to
turn it off.

Regards,
Richard


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
In reply to this post by Richard Eng
Re: [Seaside] How to email Okay, I give up. For whatever reason, Rogers won’t let me use telnet to access their server. But then the terms of use prohibit me operating a server from home anyway.

I guess for the purposes of testing, I’ll have to install Postfix...another upcoming nightmare.

Richard

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to email

Boris Popov, DeepCove Labs (SNN)
Telnet?

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Richard Eng
> Sent: Tuesday, August 14, 2007 9:11 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> Okay, I give up. For whatever reason, Rogers won't let me use telnet
to
> access their server. But then the terms of use prohibit me operating a
> server from home anyway.
>
> I guess for the purposes of testing, I'll have to install
> Postfix...another upcoming nightmare.
>
> Richard
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
In reply to this post by Richard Eng
Doesn¹t SMTPClient use telnet?

Richard

-----------
Telnet?

-Boris

> -----Original Message-----
> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
> bounces at lists.squeakfoundation.org] On Behalf Of Richard Eng
> Sent: Tuesday, August 14, 2007 9:11 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> Okay, I give up. For whatever reason, Rogers won't let me use telnet
to
> access their server. But then the terms of use prohibit me operating a
> server from home anyway.
>
> I guess for the purposes of testing, I'll have to install
> Postfix...another upcoming nightmare.
>
> Richard


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to email

Ramon Leon-5
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Richard Eng
> Sent: Tuesday, August 14, 2007 9:15 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> Doesn¹t SMTPClient use telnet?
>
> Richard

No, it uses SMTP.


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to email

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Richard Eng
Well, SMTP client should use SMTP protocol, which opens a port to the server, sends a bunch of commands, and gets a bunch of responses. If your regular email client is able to talk to the server, so should your SMTP client in Squeak, no? Now, I know nothing about Squeak, but I've used VisualWorks SMTP client many times against a countless number of email servers and it always worked just fine, with or without auth in place. I would look into why you are getting an error and not resort to running postfix or sendmail yourself.

Cheers,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Richard Eng
> Sent: Tuesday, August 14, 2007 9:15 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> Doesn¹t SMTPClient use telnet?
>
> Richard
>
> -----------
> Telnet?
>
> -Boris
>
> > -----Original Message-----
> > From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
> > bounces at lists.squeakfoundation.org] On Behalf Of Richard Eng
> > Sent: Tuesday, August 14, 2007 9:11 AM
> > To: Seaside - general discussion
> > Subject: Re: [Seaside] How to email
> >
> > Okay, I give up. For whatever reason, Rogers won't let me use telnet
> to
> > access their server. But then the terms of use prohibit me operating a
> > server from home anyway.
> >
> > I guess for the purposes of testing, I'll have to install
> > Postfix...another upcoming nightmare.
> >
> > Richard
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
In reply to this post by Richard Eng
Re: [Seaside] How to email Then why am I getting a TelnetProtocolError: 501 malformed auth input (#5.5.4) error during login to the SMTPClient object?

Richard

---------
> Doesn¹t SMTPClient use telnet?
>
> Richard

No, it uses SMTP.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Brian Brown-2
In reply to this post by Boris Popov, DeepCove Labs (SNN)
You can test an email port by using telnet to connect to the proper  
port, which is historically 25 for SMTP; however, 587 is the new SMTP  
port and more ISP's are turning off 25 and switching to 587. 993 is  
the traditional port for secure smtp as well.

So you should be able to telnet from your box to whatever the open  
email port at your ISP is and even see what email server software  
they are using based on the first response.

- Brian

On Aug 14, 2007, at 10:18 AM, Boris Popov wrote:

> Well, SMTP client should use SMTP protocol, which opens a port to  
> the server, sends a bunch of commands, and gets a bunch of  
> responses. If your regular email client is able to talk to the  
> server, so should your SMTP client in Squeak, no? Now, I know  
> nothing about Squeak, but I've used VisualWorks SMTP client many  
> times against a countless number of email servers and it always  
> worked just fine, with or without auth in place. I would look into  
> why you are getting an error and not resort to running postfix or  
> sendmail yourself.
>
> Cheers,
>
> -Boris
>
> --
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> [hidden email]
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the message
> header. Unless otherwise indicated, it contains information that is
> private and confidential. If you have received it in error, please
> notify the sender and delete the entire message including any
> attachments.
>
> Thank you.
>
>> -----Original Message-----
>> From: [hidden email] [mailto:seaside-
>> [hidden email]] On Behalf Of Richard Eng
>> Sent: Tuesday, August 14, 2007 9:15 AM
>> To: Seaside - general discussion
>> Subject: Re: [Seaside] How to email
>>
>> Doesn¹t SMTPClient use telnet?
>>
>> Richard
>>
>> -----------
>> Telnet?
>>
>> -Boris
>>
>>> -----Original Message-----
>>> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
>>> bounces at lists.squeakfoundation.org] On Behalf Of Richard Eng
>>> Sent: Tuesday, August 14, 2007 9:11 AM
>>> To: Seaside - general discussion
>>> Subject: Re: [Seaside] How to email
>>>
>>> Okay, I give up. For whatever reason, Rogers won't let me use telnet
>> to
>>> access their server. But then the terms of use prohibit me  
>>> operating a
>>> server from home anyway.
>>>
>>> I guess for the purposes of testing, I'll have to install
>>> Postfix...another upcoming nightmare.
>>>
>>> Richard
>>
>>
>> _______________________________________________
>> Seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to email

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Richard Eng
You'd have to look at the input SMTP client is generating, which is why I was curious if it may just work without providing authentication information in case your SMTP server doesn't understand it at all.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Richard Eng
> Sent: Tuesday, August 14, 2007 9:43 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> Then why am I getting a TelnetProtocolError: 501 malformed auth input
> (#5.5.4) error during login to the SMTPClient object?
>
> Richard
>
> ---------
> > Doesn¹t SMTPClient use telnet?
> >
> > Richard
>
> No, it uses SMTP.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to email

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Brian Brown-2
I just tried,

telnet smtp109.rog.mail.re2.yahoo.com 25

which seems to be the originating SMTP server Richard is using and it looks like its running on a standard port.

Cheers,


-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Brian Brown
> Sent: Tuesday, August 14, 2007 9:45 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] How to email
>
> You can test an email port by using telnet to connect to the proper
> port, which is historically 25 for SMTP; however, 587 is the new SMTP
> port and more ISP's are turning off 25 and switching to 587. 993 is
> the traditional port for secure smtp as well.
>
> So you should be able to telnet from your box to whatever the open
> email port at your ISP is and even see what email server software
> they are using based on the first response.
>
> - Brian
>
> On Aug 14, 2007, at 10:18 AM, Boris Popov wrote:
>
> > Well, SMTP client should use SMTP protocol, which opens a port to
> > the server, sends a bunch of commands, and gets a bunch of
> > responses. If your regular email client is able to talk to the
> > server, so should your SMTP client in Squeak, no? Now, I know
> > nothing about Squeak, but I've used VisualWorks SMTP client many
> > times against a countless number of email servers and it always
> > worked just fine, with or without auth in place. I would look into
> > why you are getting an error and not resort to running postfix or
> > sendmail yourself.
> >
> > Cheers,
> >
> > -Boris
> >
> > --
> > +1.604.689.0322
> > DeepCove Labs Ltd.
> > 4th floor 595 Howe Street
> > Vancouver, Canada V6C 2T5
> > http://tinyurl.com/r7uw4
> >
> > [hidden email]
> >
> > CONFIDENTIALITY NOTICE
> >
> > This email is intended only for the persons named in the message
> > header. Unless otherwise indicated, it contains information that is
> > private and confidential. If you have received it in error, please
> > notify the sender and delete the entire message including any
> > attachments.
> >
> > Thank you.
> >
> >> -----Original Message-----
> >> From: [hidden email] [mailto:seaside-
> >> [hidden email]] On Behalf Of Richard Eng
> >> Sent: Tuesday, August 14, 2007 9:15 AM
> >> To: Seaside - general discussion
> >> Subject: Re: [Seaside] How to email
> >>
> >> Doesn¹t SMTPClient use telnet?
> >>
> >> Richard
> >>
> >> -----------
> >> Telnet?
> >>
> >> -Boris
> >>
> >>> -----Original Message-----
> >>> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-
> >>> bounces at lists.squeakfoundation.org] On Behalf Of Richard Eng
> >>> Sent: Tuesday, August 14, 2007 9:11 AM
> >>> To: Seaside - general discussion
> >>> Subject: Re: [Seaside] How to email
> >>>
> >>> Okay, I give up. For whatever reason, Rogers won't let me use telnet
> >> to
> >>> access their server. But then the terms of use prohibit me
> >>> operating a
> >>> server from home anyway.
> >>>
> >>> I guess for the purposes of testing, I'll have to install
> >>> Postfix...another upcoming nightmare.
> >>>
> >>> Richard
> >>
> >>
> >> _______________________________________________
> >> Seaside mailing list
> >> [hidden email]
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Philippe Marschall
In reply to this post by Richard Eng
2007/8/14, Richard Eng <[hidden email]>:
>
>  Then why am I getting a TelnetProtocolError: 501 malformed auth input
> (#5.5.4) error during login to the SMTPClient object?

That is a SMTP error code see:
http://www.faqs.org/rfcs/rfc2821.html
There are many possible causes for this. I know that we once did some
hacks to make SMTPClient work for us. You get a TelnetProtocolError
because SMTPClient is a subclass of TelnetProtocolClient (for code
sharing).

Cheers
Philippe

>  Richard
>
>  ---------
>  > Doesn¹t SMTPClient use telnet?
>  >
>  > Richard
>
>  No, it uses SMTP.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to email

Richard Eng
In reply to this post by Richard Eng
Yea! I don't have to resort to Postfix or Sendmail! Here's the problem:

The #encodeString: method in SMTPClient is incorrectly generating two extra
trailing and unreadable characters. (Are they CR/LF?) This is why I was
getting the "malformed auth input" error message.

The simple fix is to have #encodeString: strip off the last two characters:

^str truncateTo: (str size - 2)

Now SMTPClient works like a charm! I'm so proud of myself.  :-)

Regards,
Newbie Richard


------------
Well, SMTP client should use SMTP protocol, which opens a port to the
server, sends a bunch of commands, and gets a bunch of responses. If your
regular email client is able to talk to the server, so should your SMTP
client in Squeak, no? Now, I know nothing about Squeak, but I've used
VisualWorks SMTP client many times against a countless number of email
servers and it always worked just fine, with or without auth in place. I
would look into why you are getting an error and not resort to running
postfix or sendmail yourself.

Cheers,

-Boris


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside