Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to send mail from my java application simply connecting on localhost:25 with empty login and password (I have to state them due to API).

Mail sending is failed then with

2010-03-21 12:20:01 login authenticator failed for localhost []: 535 Incorrect authentication data

On the other hand, when I am sending mail with telnet by:

$ telnet localhost 25
ehlo ...
mail from:...
rcpt to:...

it works perfectly.

Any clues?

share|improve this question
up vote 0 down vote accepted

It seems you are using a bad username/password. You are not authenticating with telnet, that's why it works.

To test with a fixed username/password combination, you can add this authenticator (assuming you use PLAIN)

  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_condition = \
    ${if and {{eq{$auth2}{username}}{eq{$auth3}{mysecret}}}}
  server_set_id = $auth2

Change username and mysecret to your needs.

Here is the relevant documentation.

To accept from localhost w/o password, add a line like the following to the correct ACL:

accept host = localhost
share|improve this answer
But can I somehow setup no authentication when sending from localhost? – Stas Mar 21 '10 at 13:36
Yes, you can setup the correct ACL to accept from localhost w/o authentication. I have edited the answer. – Dan Andreatta Mar 21 '10 at 19:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.