Will trade source...

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Will trade source...

Jerry McBride
Hi Everyone,

First, I've been dormant for a long time. Most of you will not remember me...
Sokay...


What I'm here for is I'm looking for a netrexx script that sends messages to
an SMTP submission server on port 587. What's I'm not getting right is the
hand-shake between client and server.

I'll swap  a simple SMTP posting script for port 25. I picked this up years
ago...


/* Sending message via SMTP server                                    */
/*                                                                    */
/* Class SMTPMessage for sending message through selected SMTP server */
/* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
/* The IOException and UnknownHostException are handled               */

class SMTPMessage

  properties constant
    CRLF       = '\x0D\x0A'
    SMTPPort   = int 25;

  method SMTPMessage(whoto, whofrom, theserver, themessage) signals
IOException
    MsgBody = themessage.strip()
    SMTPServer = theserver.strip()
    Receiver = whoto.strip()
    Sender = whofrom.strip()

    say "to:      " Receiver
    say "from:    " Sender
    say "server:  " SMTPServer
    say "message: " MsgBody

    do
      sc = Socket(SMTPServer, SMTPPort)
      sout = PrintStream(sc.getOutputStream())
      Cmnd = 'HELO' || CRLF
      sout.PrintLn(Cmnd)
      Cmnd = 'MAIL FROM:' || Sender || CRLF
      sout.PrintLn(Cmnd)
      Cmnd = 'RCPT TO:' || Receiver || CRLF
      sout.PrintLn(Cmnd)
      Cmnd = 'DATA' || CRLF
      sout.PrintLn(Cmnd)
      Cmnd = MsgBody || CRLF || '.' || CRLF
      sout.PrintLn(Cmnd)
      Cmnd = 'QUIT' || CRLF
      sout.PrintLn(Cmnd)
    catch er1=IOException
      Say 'I/O error' er1
    finally
      if (sc \= null) then sc.close()
    end;







--
*****************************************************************************
                                       
                             From the desk of:
                             Jerome D. McBride
                                       
  18:25:16 up 118 days, 15 min,  3 users,  load average: 0.11, 0.04, 0.01
 
*****************************************************************************
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

rvjansen
Hi Jerry,

sorry - dunno - wouldn't javamail help you here?

But I would certainly like to welcome you back, knowing your name from the NetRexx beginnings!

Can someone else help Jerry?

best regards,

René.
On 15 okt 2010, at 03:12, Jerome McBride wrote:

> Hi Everyone,
>
> First, I've been dormant for a long time. Most of you will not remember me...
> Sokay...
>
>
> What I'm here for is I'm looking for a netrexx script that sends messages to
> an SMTP submission server on port 587. What's I'm not getting right is the
> hand-shake between client and server.
>
> I'll swap  a simple SMTP posting script for port 25. I picked this up years
> ago...
>
>
> /* Sending message via SMTP server                                    */
> /*                                                                    */
> /* Class SMTPMessage for sending message through selected SMTP server */
> /* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
> /* The IOException and UnknownHostException are handled               */
>
> class SMTPMessage
>
>  properties constant
>    CRLF       = '\x0D\x0A'
>    SMTPPort   = int 25;
>
>  method SMTPMessage(whoto, whofrom, theserver, themessage) signals
> IOException
>    MsgBody = themessage.strip()
>    SMTPServer = theserver.strip()
>    Receiver = whoto.strip()
>    Sender = whofrom.strip()
>
>    say "to:      " Receiver
>    say "from:    " Sender
>    say "server:  " SMTPServer
>    say "message: " MsgBody
>
>    do
>      sc = Socket(SMTPServer, SMTPPort)
>      sout = PrintStream(sc.getOutputStream())
>      Cmnd = 'HELO' || CRLF
>      sout.PrintLn(Cmnd)
>      Cmnd = 'MAIL FROM:' || Sender || CRLF
>      sout.PrintLn(Cmnd)
>      Cmnd = 'RCPT TO:' || Receiver || CRLF
>      sout.PrintLn(Cmnd)
>      Cmnd = 'DATA' || CRLF
>      sout.PrintLn(Cmnd)
>      Cmnd = MsgBody || CRLF || '.' || CRLF
>      sout.PrintLn(Cmnd)
>      Cmnd = 'QUIT' || CRLF
>      sout.PrintLn(Cmnd)
>    catch er1=IOException
>      Say 'I/O error' er1
>    finally
>      if (sc \= null) then sc.close()
>    end;
>
>
>
>
>
>
>
> --
> *****************************************************************************
>
>                             From the desk of:
>                             Jerome D. McBride
>
>  18:25:16 up 118 days, 15 min,  3 users,  load average: 0.11, 0.04, 0.01
>
> *****************************************************************************
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

rickmcguire
On Fri, Oct 15, 2010 at 12:37 PM, René Jansen <[hidden email]> wrote:
> Hi Jerry,
>
> sorry - dunno - wouldn't javamail help you here?

Using javamail would certainly keep from reinventing the wheel.  Doing
a starttls connection to an SMTP server is not for the faint of heart.
 I had to implement this for the Apache Geronimo version of javamail
and there's quite a bit of code involved.  On the other hand, the
javamail implementation already handles the connection details for
you.

Rick

>
> But I would certainly like to welcome you back, knowing your name from the NetRexx beginnings!
>
> Can someone else help Jerry?
>
> best regards,
>
> René.
> On 15 okt 2010, at 03:12, Jerome McBride wrote:
>
>> Hi Everyone,
>>
>> First, I've been dormant for a long time. Most of you will not remember me...
>> Sokay...
>>
>>
>> What I'm here for is I'm looking for a netrexx script that sends messages to
>> an SMTP submission server on port 587. What's I'm not getting right is the
>> hand-shake between client and server.
>>
>> I'll swap  a simple SMTP posting script for port 25. I picked this up years
>> ago...
>>
>>
>> /* Sending message via SMTP server                                    */
>> /*                                                                    */
>> /* Class SMTPMessage for sending message through selected SMTP server */
>> /* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
>> /* The IOException and UnknownHostException are handled               */
>>
>> class SMTPMessage
>>
>>  properties constant
>>    CRLF       = '\x0D\x0A'
>>    SMTPPort   = int 25;
>>
>>  method SMTPMessage(whoto, whofrom, theserver, themessage) signals
>> IOException
>>    MsgBody = themessage.strip()
>>    SMTPServer = theserver.strip()
>>    Receiver = whoto.strip()
>>    Sender = whofrom.strip()
>>
>>    say "to:      " Receiver
>>    say "from:    " Sender
>>    say "server:  " SMTPServer
>>    say "message: " MsgBody
>>
>>    do
>>      sc = Socket(SMTPServer, SMTPPort)
>>      sout = PrintStream(sc.getOutputStream())
>>      Cmnd = 'HELO' || CRLF
>>      sout.PrintLn(Cmnd)
>>      Cmnd = 'MAIL FROM:' || Sender || CRLF
>>      sout.PrintLn(Cmnd)
>>      Cmnd = 'RCPT TO:' || Receiver || CRLF
>>      sout.PrintLn(Cmnd)
>>      Cmnd = 'DATA' || CRLF
>>      sout.PrintLn(Cmnd)
>>      Cmnd = MsgBody || CRLF || '.' || CRLF
>>      sout.PrintLn(Cmnd)
>>      Cmnd = 'QUIT' || CRLF
>>      sout.PrintLn(Cmnd)
>>    catch er1=IOException
>>      Say 'I/O error' er1
>>    finally
>>      if (sc \= null) then sc.close()
>>    end;
>>
>>
>>
>>
>>
>>
>>
>> --
>> *****************************************************************************
>>
>>                             From the desk of:
>>                             Jerome D. McBride
>>
>>  18:25:16 up 118 days, 15 min,  3 users,  load average: 0.11, 0.04, 0.01
>>
>> *****************************************************************************
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>>
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
>
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

KP Kirchdörfer
In reply to this post by Jerry McBride
Am Freitag, 15. Oktober 2010, 03:12:22 schrieb Jerome McBride:

> Hi Everyone,
>
> First, I've been dormant for a long time. Most of you will not remember
> me... Sokay...
>
>
> What I'm here for is I'm looking for a netrexx script that sends messages
> to an SMTP submission server on port 587. What's I'm not getting right is
> the hand-shake between client and server.
>
> I'll swap  a simple SMTP posting script for port 25. I picked this up years
> ago...
>
>
> /* Sending message via SMTP server                                    */
> /*                                                                    */
> /* Class SMTPMessage for sending message through selected SMTP server */
> /* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
> /* The IOException and UnknownHostException are handled               */
>
> class SMTPMessage
>
>   properties constant
>     CRLF       = '\x0D\x0A'
>     SMTPPort   = int 25;
>
>   method SMTPMessage(whoto, whofrom, theserver, themessage) signals
> IOException
>     MsgBody = themessage.strip()
>     SMTPServer = theserver.strip()
>     Receiver = whoto.strip()
>     Sender = whofrom.strip()
>
>     say "to:      " Receiver
>     say "from:    " Sender
>     say "server:  " SMTPServer
>     say "message: " MsgBody
>
>     do
>       sc = Socket(SMTPServer, SMTPPort)
>       sout = PrintStream(sc.getOutputStream())
>       Cmnd = 'HELO' || CRLF
>       sout.PrintLn(Cmnd)
>       Cmnd = 'MAIL FROM:' || Sender || CRLF
>       sout.PrintLn(Cmnd)
>       Cmnd = 'RCPT TO:' || Receiver || CRLF
>       sout.PrintLn(Cmnd)
>       Cmnd = 'DATA' || CRLF
>       sout.PrintLn(Cmnd)
>       Cmnd = MsgBody || CRLF || '.' || CRLF
>       sout.PrintLn(Cmnd)
>       Cmnd = 'QUIT' || CRLF
>       sout.PrintLn(Cmnd)
>     catch er1=IOException
>       Say 'I/O error' er1
>     finally
>       if (sc \= null) then sc.close()
>     end;

587 requires some sort of authentication.

>From RFC 2476

3.3. Authorized Submission
Numerous methods have been used to ensure that only authorized users are able
to submit messages. These methods include authenticated SMTP, IP address
restrictions, secure IP, and prior POP authentication.

I'd suggest you start with telnetting into the server and see what it exactly
expects.

kp

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

Fernando Cassia-2
On Fri, Oct 15, 2010 at 2:04 PM, KP Kirchdoerfer
<[hidden email]> wrote:

> >From RFC 2476
>
> 3.3. Authorized Submission
> Numerous methods have been used to ensure that only authorized users are able
> to submit messages. These methods include authenticated SMTP, IP address
> restrictions, secure IP, and prior POP authentication.

I think that a code snippet for sending email over SSL (ie using
Google´s SMTP.GMAIL.COM servers) and using user authentication would
be great and a must-have for NetRexx.

FC

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

Thomas.Schneider.Wien
In reply to this post by rickmcguire
  Hello Rick,
    despite for you excellent support of ooRexx, you are also *very
responsive*
on NetRexx issues.

    I personally would like to thank you for this attitude :-)

Thomas Schneider.

www.thsitc.com
============================================================
Am 15.10.2010 18:47, schrieb Rick McGuire:

> On Fri, Oct 15, 2010 at 12:37 PM, René Jansen<[hidden email]>  wrote:
>> Hi Jerry,
>>
>> sorry - dunno - wouldn't javamail help you here?
> Using javamail would certainly keep from reinventing the wheel.  Doing
> a starttls connection to an SMTP server is not for the faint of heart.
>   I had to implement this for the Apache Geronimo version of javamail
> and there's quite a bit of code involved.  On the other hand, the
> javamail implementation already handles the connection details for
> you.
>
> Rick
>
>> But I would certainly like to welcome you back, knowing your name from the NetRexx beginnings!
>>
>> Can someone else help Jerry?
>>
>> best regards,
>>
>> René.
>> On 15 okt 2010, at 03:12, Jerome McBride wrote:
>>
>>> Hi Everyone,
>>>
>>> First, I've been dormant for a long time. Most of you will not remember me...
>>> Sokay...
>>>
>>>
>>> What I'm here for is I'm looking for a netrexx script that sends messages to
>>> an SMTP submission server on port 587. What's I'm not getting right is the
>>> hand-shake between client and server.
>>>
>>> I'll swap  a simple SMTP posting script for port 25. I picked this up years
>>> ago...
>>>
>>>
>>> /* Sending message via SMTP server                                    */
>>> /*                                                                    */
>>> /* Class SMTPMessage for sending message through selected SMTP server */
>>> /* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
>>> /* The IOException and UnknownHostException are handled               */
>>>
>>> class SMTPMessage
>>>
>>>   properties constant
>>>     CRLF       = '\x0D\x0A'
>>>     SMTPPort   = int 25;
>>>
>>>   method SMTPMessage(whoto, whofrom, theserver, themessage) signals
>>> IOException
>>>     MsgBody = themessage.strip()
>>>     SMTPServer = theserver.strip()
>>>     Receiver = whoto.strip()
>>>     Sender = whofrom.strip()
>>>
>>>     say "to:      " Receiver
>>>     say "from:    " Sender
>>>     say "server:  " SMTPServer
>>>     say "message: " MsgBody
>>>
>>>     do
>>>       sc = Socket(SMTPServer, SMTPPort)
>>>       sout = PrintStream(sc.getOutputStream())
>>>       Cmnd = 'HELO' || CRLF
>>>       sout.PrintLn(Cmnd)
>>>       Cmnd = 'MAIL FROM:' || Sender || CRLF
>>>       sout.PrintLn(Cmnd)
>>>       Cmnd = 'RCPT TO:' || Receiver || CRLF
>>>       sout.PrintLn(Cmnd)
>>>       Cmnd = 'DATA' || CRLF
>>>       sout.PrintLn(Cmnd)
>>>       Cmnd = MsgBody || CRLF || '.' || CRLF
>>>       sout.PrintLn(Cmnd)
>>>       Cmnd = 'QUIT' || CRLF
>>>       sout.PrintLn(Cmnd)
>>>     catch er1=IOException
>>>       Say 'I/O error' er1
>>>     finally
>>>       if (sc \= null) then sc.close()
>>>     end;
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> *****************************************************************************
>>>
>>>                              From the desk of:
>>>                              Jerome D. McBride
>>>
>>>   18:25:16 up 118 days, 15 min,  3 users,  load average: 0.11, 0.04, 0.01
>>>
>>> *****************************************************************************
>>> _______________________________________________
>>> Ibm-netrexx mailing list
>>> [hidden email]
>>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>>
>>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
>
>


--
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)
Reply | Threaded
Open this post in threaded view
|

Re: Will trade source...

Thomas.Schneider.Wien
In reply to this post by Jerry McBride
  Hello Jerome,
    I too rember you from the early NetRexx discussion list.

Please do send me a private mail what you are doing nowadays.

Thomas Schneider
========================================================
Am 15.10.2010 03:12, schrieb Jerome McBride:

> Hi Everyone,
>
> First, I've been dormant for a long time. Most of you will not remember me...
> Sokay...
>
>
> What I'm here for is I'm looking for a netrexx script that sends messages to
> an SMTP submission server on port 587. What's I'm not getting right is the
> hand-shake between client and server.
>
> I'll swap  a simple SMTP posting script for port 25. I picked this up years
> ago...
>
>
> /* Sending message via SMTP server                                    */
> /*                                                                    */
> /* Class SMTPMessage for sending message through selected SMTP server */
> /* msg = SMTPMessage(whoto, whofrom, theserver, themessage)           */
> /* The IOException and UnknownHostException are handled               */
>
> class SMTPMessage
>
>    properties constant
>      CRLF       = '\x0D\x0A'
>      SMTPPort   = int 25;
>
>    method SMTPMessage(whoto, whofrom, theserver, themessage) signals
> IOException
>      MsgBody = themessage.strip()
>      SMTPServer = theserver.strip()
>      Receiver = whoto.strip()
>      Sender = whofrom.strip()
>
>      say "to:      " Receiver
>      say "from:    " Sender
>      say "server:  " SMTPServer
>      say "message: " MsgBody
>
>      do
>        sc = Socket(SMTPServer, SMTPPort)
>        sout = PrintStream(sc.getOutputStream())
>        Cmnd = 'HELO' || CRLF
>        sout.PrintLn(Cmnd)
>        Cmnd = 'MAIL FROM:' || Sender || CRLF
>        sout.PrintLn(Cmnd)
>        Cmnd = 'RCPT TO:' || Receiver || CRLF
>        sout.PrintLn(Cmnd)
>        Cmnd = 'DATA' || CRLF
>        sout.PrintLn(Cmnd)
>        Cmnd = MsgBody || CRLF || '.' || CRLF
>        sout.PrintLn(Cmnd)
>        Cmnd = 'QUIT' || CRLF
>        sout.PrintLn(Cmnd)
>      catch er1=IOException
>        Say 'I/O error' er1
>      finally
>        if (sc \= null) then sc.close()
>      end;
>
>
>
>
>
>
>


--
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)