I installed iredmail, and used it to set up a mail server on Debian 7 based VPS. Everything went fine, I can send and receive email via webmail. However on trying to send mail via SMTP on a client program (The Bat Professional, Windows 7), I am getting an error that "Sender address rejected: not logged in".

I am trying to find the cause of this issue. Here's the result of a manual telnet and attempting to send the mail. I've done this test via telnet on Windows on the same machine that the email client program resides on, and also checked via telnet on a remote debian server. Both times, email was successfully sent via telnet.

#telnet apollo.who.org 25
Connected to apollo.who.org.
Escape character is '^]'.
220 apollo.who.org ESMTP Postfix (Debian/GNU)
HELO apollo.who.org
250 apollo.who.org
auth login
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6
235 2.7.0 Authentication successful
MAIL FROM:<joel@who.org>
250 2.1.0 Ok
RCPT TO:<timothy@somewhere.com>
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>

Check success.
250 2.0.0 Ok: queued as 5E150C2FF2

Manually sending email via smtp on telnet worked. The email was delivered. So it seems to be a problem configuring the client program?

Log of the client program shows:

 12/06/2013, 13:22:42: IMAP  - Connecting to IMAP server apollo.who.org on port 993
 12/06/2013, 13:22:44: IMAP  - Initiating TLS handshake
>12/06/2013, 13:22:45: IMAP  - Certificate S/N: B25F55E1155DD8A8, algorithm: RSA (2048 bits), issued from 6/11/2013 5:26:55 PM to 6/9/2023 5:26:55 PM, for 1 host(s): apollo.who.org.
>12/06/2013, 13:22:45: IMAP  - Owner: CN, GuangDong, ShenZhen, apollo.who.org, IT, apollo.who.org, root@apollo.who.org.
>12/06/2013, 13:22:45: IMAP  - This certificate is self-issued.
 12/06/2013, 13:22:45: IMAP  - TLS handshake complete
 12/06/2013, 13:22:45: IMAP  - Connected to IMAP server (apollo.who.org)
>12/06/2013, 13:22:45: IMAP  - Dovecot ready.
 12/06/2013, 13:22:46: IMAP  - Authenticating (user: "joel@who.org", method: "LOGIN")...
 12/06/2013, 13:22:47: IMAP  - IMAP server authentication OK, server says "Logged in"
 12/06/2013, 13:23:21: SEND  - sending mail message(s) - 1 message(s) in queue
 12/06/2013, 13:23:21: SEND  - Connecting to SMTP server apollo.who.org on port 25
 12/06/2013, 13:23:21: SEND  - connected to SMTP server
 12/06/2013, 13:23:23: SEND  - WARNING: there were no compatible authentication mechanisms detected
 12/06/2013, 13:23:23: SEND  - sending message to joel@whos.org
 12/06/2013, 13:23:23: SEND  - The last address submitted was <joel@whos.org>
!12/06/2013, 13:23:23: SEND  - Message has not been sent. Server reply - 5.7.1 <joel@who.org>: Sender address rejected: not logged in
 12/06/2013, 13:23:24: SEND  - connection finished - 0 message(s) sent
 12/06/2013, 13:23:24: SEND  - Some messages were not sent - check the log for details

What settings should I use for configuring the client program to send email through this server?

Currently, I've tried:

  1. Regular. The log as above
  2. StartTTLS.
  3. TLS

SMTP Authentication was set to on. Secure authentication was enabled.

Ports 25, 993 and 995 were checked.

Netstat results:

 #netstat -lpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0  *               LISTEN      2537/dovecot
tcp        0      0   *               LISTEN      2537/dovecot
tcp        0      0*               LISTEN      1674/python
tcp        0      0   *               LISTEN      2537/dovecot
tcp        0      0*               LISTEN      1439/amavisd-new (m
tcp        0      0*               LISTEN      3509/master
tcp        0      0*               LISTEN      2359/mysqld
tcp        0      0   *               LISTEN      3509/master
tcp        0      0   *               LISTEN      2537/dovecot
tcp        0      0*               LISTEN      1439/amavisd-new (m
tcp        0      0*               LISTEN      2574/perl
tcp        0      0   *               LISTEN      2537/dovecot
tcp        0      0    *               LISTEN      1459/apache2
tcp        0      0    *               LISTEN      1585/sshd
tcp        0      0    *               LISTEN      3509/master
tcp        0      0   *               LISTEN      1459/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      1585/sshd

closed as off topic by EightBitTony, Jenny D, Scott Pack, Ward, mdpc Jun 12 '13 at 15:45

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Was the telnet test done from the machine on which the client runs? – MadHatter Jun 12 '13 at 8:08
  • Of course not. :) It was from another VPS on a different DC. – Joel G Mathew Jun 12 '13 at 8:13
  • 2
    That's not a very useful test, then, is it? Could we get one that at least tries to simulate what the client's doing? Also, details on how the client's set up for outgoing mail, particularly with respect to mandatory authentication requirements. – MadHatter Jun 12 '13 at 8:17
  • Looks like you've misconfigured your POP before SMTP log location.. – NickW Jun 12 '13 at 8:17
  • 1
    Droidzone, you were clear, I understood your test; it's just a bad test (it's like saying "My bathroom tap drips. I have checked the washer in the kitchen tap, and it's fine. What could be wrong?"). Please test again from the platform on which the SMTP client runs. And we still need to know what authentication methods have been configured on the client. – MadHatter Jun 12 '13 at 8:31

The key is in the line

 12/06/2013, 13:23:23: SEND  - WARNING: there were no compatible authentication mechanisms detected

which, as we have found out, means that the server supports none of the authentication methods that the client has been configured to require to use. When you reconfigure the client not to require any authentication methods that the server won't support, it works.

I wrote this up as an answer partly so you can accept it, thus putting the question to bed, but partly to warn you that that server appears to be running an open SMTP relay: we've confirmed that at least two separate hosts can use it to relay mail without authentication of any kind.

If it's behind a firewall, or it really only allows this relaying from a list of addresses that you control (and on which both the external test points happen to be), then all is good. Otherwise, you're going to want to nail that relay down very quickly indeed, or you'll be carrying a shedload of spam onto the internet, and your reputation as a sending server will be in the toilet as far as the RBLs are concerned.

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