Also do auth type detection for plain connection.
This commit is contained in:
parent
b8015d5ba1
commit
3eaa54cc01
1 changed files with 7 additions and 3 deletions
|
@ -23,8 +23,11 @@ module Net
|
||||||
@socket = new_internet_message_io(tlsconnect(s))
|
@socket = new_internet_message_io(tlsconnect(s))
|
||||||
# helo response may be different after STARTTLS
|
# helo response may be different after STARTTLS
|
||||||
do_helo helo_domain
|
do_helo helo_domain
|
||||||
# ADD auto detection of authtype - https://github.com/zammad/zammad/issues/240
|
end
|
||||||
# set detected authtype based on smtp server capabilities
|
|
||||||
|
# ADD auto detection of authtype - https://github.com/zammad/zammad/issues/240
|
||||||
|
# set detected authtype based on smtp server capabilities
|
||||||
|
if user or secret
|
||||||
if !authtype
|
if !authtype
|
||||||
if auth_capable?(DEFAULT_AUTH_TYPE)
|
if auth_capable?(DEFAULT_AUTH_TYPE)
|
||||||
authtype = DEFAULT_AUTH_TYPE
|
authtype = DEFAULT_AUTH_TYPE
|
||||||
|
@ -36,8 +39,9 @@ module Net
|
||||||
authtype = 'CRAM-MD5'
|
authtype = 'CRAM-MD5'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# /ADD auto detection of authtype - https://github.com/zammad/zammad/issues/240
|
|
||||||
end
|
end
|
||||||
|
# /ADD auto detection of authtype - https://github.com/zammad/zammad/issues/240
|
||||||
|
|
||||||
authenticate user, secret, (authtype || DEFAULT_AUTH_TYPE) if user
|
authenticate user, secret, (authtype || DEFAULT_AUTH_TYPE) if user
|
||||||
@started = true
|
@started = true
|
||||||
ensure
|
ensure
|
||||||
|
|
Loading…
Reference in a new issue