| Ticket UUID: | 979894 | |||
| Title: | username and password options are missing | |||
| Type: | Bug | Version: | None | |
| Submitter: | orwellian | Created on: | 2004-06-25 18:04:39 | |
| Subsystem: | smtp | Assigned To: | mrose | |
| Priority: | 5 Medium | Severity: | ||
| Status: | Closed | Last Modified: | 2004-07-09 05:58:22 | |
| Resolution: | Out of Date | Closed By: | patthoyts | |
| Closed on: | 2004-07-08 22:58:22 | |||
| Description: |
One of my web service providers recently started requiring all
email use SMTP authorization - username/password. POP before
SMTP was no longer good enough due to spammers.
In the latest TCLLIB 1.6.1 there are username/password options
in the smtp package for smtp::sendmessage invocations.
Well, in the documentation. Not the code.
I could really use to have these options available - TCLLIB can't
send mail anymore without them, for me.
----
I'm sourcing these TCLLIB 1.6.1 modules:
base64.tcl, md5.tcl, mime.tcl, smtp.tcl
I uploaded those modules to source them because the hosting
sit has an older TCLLIB installed.
----
The MIME module gave me this error:
can't read "::major": no such variable
while executing
"if {$::major < 2} {
I altered the other two references to $::major from $major
to get around this error.
| |||
| User Comments: |
patthoyts added on 2004-07-09 05:58:22:
Logged In: YES user_id=202636 The current CVS version of the smtp package has AUTH support for DIGEST-MD5, CRAM-MD5, LOGIN and PLAIN. It also supports the use of the STARTTLS extension to enable a secure link if you have the tls package available. This has been tested against sendmail, postfix and Microsoft's SMTP server. orwellian added on 2004-07-02 15:23:14: Logged In: YES user_id=490034 Update: regarding giving a choice of AUTH methods, it turns out that was a problem on my end, nevermind. It may or may not be a useful thing to be able to specify. orwellian added on 2004-06-27 20:02:35: Logged In: YES
user_id=490034
I've hardcoded a fix for my usage.
In proc ::smtp::initialize_ehlo, after the TLS code, I added:
if [catch {smtp::talk $token 300 "AUTH PLAIN"} result] {
array set response [list code 400 diagnostic $result args ""]
} else {
array set response $result
}
if {$response(code) != 334} {
puts stderr "Bad response to AUTH PLAIN = '$response(diagnostic)'."
catch {close $state(sd)}
return {}
}
if [catch {smtp::talk $token 300 "A------------
redacted----------------------hZGE="} result] {
array set response [list code 400 diagnostic $result args ""]
} else {
array set response $result
}
if {$response(code) != 235} {
puts stderr "Bad response to the base64 password =
'$response(diagnostic)'."
catch {close $state(sd)}
return {}
}
It took a bit of Googling to find out the format, the RFC didn't state it.
FYI, you'd better give the user a choice of AUTH methods, because
I first coded this for AUTH LOGIN and it seemed to work - gave a
success for authorization - but it would fail to work if I was sending
to a different domain (and it was a forward, not a POP box) that
was handled by the same POP server. I don't know if this was a
qmail quirk or not. Switching to AUTH PLAIN worked. If the (eventually)
fixed smtp.tcl doesn't give a choice and it chooses the first one listed
by the EHLO output, it would fail for local aliases at my provider.
I'm suggesting to my provider to drop AUTH LOGIN from the EHLO output.
| |||
Home
Blog
Docs
Downloads
Tickets
Timeline
Branches
Tags
Wiki