From: Tsume Date: 2005-11-23T12:48:28+09:00 Subject: Re: net/smtp question On Wednesday 23 November 2005 10:02 am, itsme213 wrote: > I am experimenting with SMTP mail from my local machine, to basically send > an email just like my Outlook client does. But I can't figure out how to > translate my Outlook settings to the parameters of SMTP.start, in > particular the params: > > helo : I don't see such a setting in Outlook. I use a cable service > provider for internet connection, the SMTP server is different (at my web > host). You are a client, you still need to use the correct HELO. HELO myhostname-12-34-34-2.myisp.com would be what you want to say to server, just supply hostname. Here is an example SMTP session to my mail server using one of the number one administration utilities.. telnet :) tsume@laptop:~$ telnet tsumelabs.com 25 Trying 72.21.54.43... Connected to tsumelabs.com. Escape character is '^]'. 220 zanshin.tsumelabs.com ESMTP HELO FAKEDOMAIN.COM 250 zanshin.tsumelabs.com Ok. EHLO FAKEDOMAIN.COM 250-zanshin.tsumelabs.com Ok. 250-AUTH LOGIN CRAM-MD5 CRAM-SHA1 CRAM-SHA256 250-AUTH=LOGIN CRAM-MD5 CRAM-SHA1 CRAM-SHA256 X-NETSCAPE-HAS-BUGS 250-XVERP=Courier 250-XEXDATA 250-XSECURITY=NONE,STARTTLS 250-PIPELINING 250-8BITMIME 250-SIZE 250 DSN MAIL FROM: 250 Ok. RCPT TO: 250 Ok. DATA 354 Ok. Subject: Test Message From: tsume@hidedomain.com test . 250 Ok. 43838FA9.000017BC quit 221 Bye. When the email is delivered, the email is altered by the MTA. Below is what the client(I) get when I check my mail via POP3. [start] ------------------------------------------------------------------ Delivered-To: tsume@tsumelabs.com Return-Path: Received: from FAKEDOMAIN.COM ([209.112.145.186]) by zanshin.tsumelabs.com with esmtp; Tue, 22 Nov 2005 16:37:17 -0500 id 0068813E.43838FA9.000017BC Subject: Test Message To: tsume@tsumelabs.com From: tsume@hidedomain.com Message-ID: Date: Tue, 22 Nov 2005 16:37:17 -0500 test [end] --------------------------------------- Notice the received from line Received: from FAKEDOMAIN.COM ([209.112.145.186]) Still the MTA will place my IP address in the header, I'm really on tsume@laptop:~$ nslookup 209.112.145.186 Server: 209.193.4.7 Address: 209.193.4.7#53 186.145.112.209.in-addr.arpa name = 209-112-145-186-cdsl-rb1.sol.acsalaska.net. tsume@laptop:~$ Many spammers fake the HELO, and I know some MTAs actually do check for a valid HELO, so you want to use the correct hostname. Do I still need to provide a helo if I send the email to my ISPs server? yes, the mail server still attaches receive. Look through emails and you will see more of how the MTA will transform emails, here is an example [start] ------------------------------------------------------------------ Delivered-To: tsume@tsumelabs.com Return-Path: Received: from FAKEDOMAIN.COM ([209.112.145.186]) by zanshin.tsumelabs.com with esmtp; Tue, 22 Nov 2005 16:37:17 -0500 id 0068813E.43838FA9.000017BC Received: from littleguy-23.2.32.3.isp.com ([205.2.145.186]) by some-otherhost.com with esmtp; Tue, 22 Nov 2005 16:34:17 -0500 id 0068813E.43838FA9.000017BC Subject: Test Message To: tsume@tsumelabs.com From: tsume@hidedomain.com Message-ID: Date: Tue, 22 Nov 2005 16:37:17 -0500 test [end] --------------------------------------- Ask more questions if confused. There are RFCs on SMTP you should read for future reference http://www.rfc-editor.org/ Have more fun learning! Tsume > > user : is this the User Name from the Outlook account? > yes, this may be your email name, or your full email address > secret : is this the Password from the Outlok account? > yes > authtype : my Outlook account has "requires authentication" OFF > > Thanks! > > > > require 'net/smtp' > > msg = "Subject: Test\n\nNow is the time\n" > > Net::SMTP.start('my.smtp.server,25,'my.cable.provider','my.user.name, > 'password,:plain) do |smtp| > # smtp.send_message msg, 'desmond.dsouza@kinetium.com', > ['dedoig213@hotmail.com'] > end > > > C:experiments> c:/ruby/lib/ruby/1.8/net/smtp.rb:586:in `auth_login': 535 > authorization failed (#5.7.0) (Net::SMTPAuthenticationError) > from c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in `__send__' > from c:/ruby/lib/ruby/1.8/net/smtp.rb:571:in `authenticate' > from c:/ruby/lib/ruby/1.8/net/smtp.rb:411:in `do_start' > from c:/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start' > from c:/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start' > from C:/des/desktop/methods/experiments/smtp.rb:5 > Process ruby exited with code 1