Koozali.org: home of the SME Server

authentication script on the email server of sme server

Offline purvis

  • *****
  • 567
  • +0/-0
authentication script on the email server of sme server
« on: August 23, 2009, 05:42:43 AM »
Hi

I am writing a program for windows that sends email using smtp.
SSL is going to be a big obstacle for me.
So far i have got the program working sending mail on the lan side of server using no authentication.

I do not though have smtp working from the external network using smtp.

I have searched and have not found a cure to what in these forums are called simple or plain authenication using smtp.

Even though i have practiced a few rules, i keep getting a response of "500 Unrecognized commands" while trying to authenicate.

I have seen a script on the internet that authenicates before "EHLO" and that did no good.

When do you authenicate a user and password?
Right before the "EHLO" or right after?
What is the proper string for authentication.
I have tried plain text for user name and password and base64 encoded and "Authorization Basic "+base64(user name:password)

can somebody put me straight.

And if anybody has SSL programming code that would be great too.

Paul, never giving up.






Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: authentication script on the email server of sme server
« Reply #1 on: August 23, 2009, 06:17:38 AM »
I am writing a program for windows that sends email using smtp.

You can use swiks, which is written in perl, and should work on Windows.

Quote
When do you authenicate a user and password?
Right before the "EHLO" or right after?

You can't do anything before EHLO.


Quote
What is the proper string for authentication.

The details are all here:

http://www.faqs.org/rfcs/rfc2554.html

Offline purvis

  • *****
  • 567
  • +0/-0
Re: authentication script on the email server of sme server
« Reply #2 on: August 23, 2009, 06:57:20 AM »
Thanks Charlie for responding so late on a saturday night.
Oh i know the work that you put in and i appreciate it.

I have a program written already and it is being refined to touched up.
It is a console command program.
I posted what i have already at www.powerbasic.com/forums.
So far, it just does text.
It would be great to workout the SSL stuff but i really do not know if that is going to happen soon.
It would allow for a internet email server with my programming doing most of the sending of emails.
I would hate to write a special server program on the intranet just to receive email sending request from remote locations. Right now i plan on having a email server at each location, but that adds up to supervision and maintanance also.

Thanks once again and let see what i can get going.




Offline purvis

  • *****
  • 567
  • +0/-0
Re: authentication script on the email server of sme server
« Reply #3 on: August 23, 2009, 12:47:00 PM »
ok
i finally got it and also found out that the base64 conversion i was using was flawed.
change the default setting of smeserver to support both smtp and secure smtp(ssmtp)  first.

after connecting to the server with port 25

sent to server    "EHLO"
server returned  "250 AUTH PLAIN LOGIN"   this line changed from the default when the server is set to run smtp from the wlan
sent to server    "AUTH PLAIN"
server returned  "334 Please continue"
sent to server     "base64encoded username plus password"   this is a base64 encoded string of character zero+username+character zero+userpassword
server returned  " 235 Authentication successful for username - authcvm/plain"

then continue with reset of regular email code

« Last Edit: August 23, 2009, 12:50:55 PM by purvis »