cancel
Showing results for 
Search instead for 
Did you mean: 

SMTP: which types of authentication are supported?

Former Member
5,466

[SQL Anywhere 12.0.1.3810]

The xp_startsmtp procedure supports two parameters 'smtp_auth_username' and 'smtp_auth_password', which allow it to work with SMTP servers that require authentication.

I've been testing this against the free 'hMailServer' mail server and have found that the parameters do work but only if the server is set to 'Allow plain text authentication' (which it isn't by default).

Looking at the SMTP logs and doing some reading (e.g. here), I now understand that there are several different types of SMTP authentication around: LOGIN, PLAIN and CRAM-MD5 (and possibly others?). The default for hMailServer is simply LOGIN, which causes xp_startsmtp to return 104. Ticking the 'Allow plain text authentication' tickbox adds PLAIN support at which point xp_startsmtp returns success. I haven't found a way of enabling CRAM-MD5 with hmailserver so don't know whether this will work with xp_startsmtp.

Can anyone tell me which forms of SMTP authentication are supposed to be supported by SQL Anywhere?

For reference, the command I have been testing with is of the form:

BEGIN
DECLARE li_result integer;
li_result = CALL  xp_startsmtp( 
    smtp_sender = 'testsender@testdomain.co.uk'
    , smtp_server = '10.200.42.40'
    , smtp_port = 25
    , timeout = 60
    , smtp_auth_username = 'test@testpc.testdomain.co.uk'
    , smtp_auth_password = 'test'
);
SELECT li_result;
END

Accepted Solutions (1)

Accepted Solutions (1)

graeme_perrow
Advisor
Advisor

At the moment we only support PLAIN authentication. We are investigating adding other forms of authentication in future versions of SQL Anywhere.

Former Member
0 Kudos

Thanks for the answer.

Former Member
0 Kudos

Hello,

please could you give me some informations about the availability of AUTH LOGIN ? maybe in SQL Anywhere 16.x ?

Kind regards

Frank

graeme_perrow
Advisor
Advisor
0 Kudos

Sorry, v16 only supports PLAIN authentication.

Former Member
0 Kudos

Hello Graeme,

is it possible, to give me some ideas to solve this problem because we must ensure to send newsletter emails from db-side.

The mailserver authentication method AUTH LOGIN of the provider is fixed and cannot be changed !

Thx in advance

Frank

justin_willey
Participant

There are a number of command line mail programs (eg Blat) available that you could use with xp_cmdshell()

Former Member
0 Kudos

Hello Justin,

thx for your answer. Yes, you're right, but this would be my last possibilty - maybe there is a smarter solution.

best regards

Frank

VolkerBarth
Contributor
0 Kudos

FWIW: Frank, I have just converted your postings from "answers" into comments, as I think they are not actual answers. You can do that yourself by using the "add new comment" button beneath each question/answer or by using the "reply" button (second symbol from right) beneath each comment (for nested comments).

Former Member
0 Kudos

Okay and sorry for your inconvenience

Best regards

Frank

VolkerBarth
Contributor
0 Kudos

No inconvenience, absolutely:)

justin_willey
Participant
0 Kudos

Hi Frank - unless someone from SAP is able to say otherwise, it's unlikely that new authentication types are going to be added to existing versions - new features tend to come with major version releases rather than ebfs (not always, but usually).

If that is the case, I think your possible workarounds are limited to using a mail server with will accept an authentication method compatible with what the SQL Anywhere server can do (which doesn't sound practicable for you), or using another method of sending the emails. However someone may have a cleverer idea!

Answers (0)