Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 [127.0.0.1]: 535 Incorrect authentication data

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

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

it works perfectly.

Any clues?

share|improve this question
add comment

1 Answer

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)

fixed_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
add comment

Your Answer

 
discard

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.