The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

[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

asked 04 Mar '13, 05:27

Luke's gravatar image

Luke
49691525
accept rate: 33%


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

permanent link

answered 04 Mar '13, 09:05

Graeme%20Perrow's gravatar image

Graeme Perrow
8.3k369106
accept rate: 52%

Thanks for the answer.

(04 Mar '13, 09:11) Luke

Hello,

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

Kind regards

Frank

(13 Nov '13, 13:29) Frank_V
Replies hidden

Sorry, v16 only supports PLAIN authentication.

(13 Nov '13, 13:32) Graeme Perrow

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

(15 Nov '13, 04:56) Frank_V
Replies hidden
1

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

(15 Nov '13, 05:07) Justin Willey

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

(15 Nov '13, 05:32) Frank_V
Replies hidden

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).

(15 Nov '13, 05:39) Volker Barth

Okay and sorry for your inconvenience

Best regards

Frank

(15 Nov '13, 05:42) Frank_V
Replies hidden

No inconvenience, absolutely:)

(15 Nov '13, 06:21) Volker Barth

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!

(15 Nov '13, 06:46) Justin Willey
showing 5 of 10 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×9

question asked: 04 Mar '13, 05:27

question was seen: 2,530 times

last updated: 17 Nov '13, 08:58