You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Garvice Eakins <ga...@gmail.com> on 2011/10/14 22:43:44 UTC

Authentication errors SMTP

I am having problems sending SMTP messages from James3.0 using a simple java
application using javamail.

Here is the example I am using

public class MailClient

  extends Authenticator{

  public static final int SHOW_MESSAGES = 1;

  public static final int CLEAR_MESSAGES = 2;

  public static final int SHOW_AND_CLEAR =

    SHOW_MESSAGES + CLEAR_MESSAGES;

  protected String from;

  protected Session session;

  protected PasswordAuthentication authentication;


public MailClient(String user, String pass, String host)  {

    this(user, pass, host, false);

  }

  public MailClient(String user, String pass, String host, boolean debug){

    from = user + '@' + host;

    authentication = new PasswordAuthentication(user, pass);

    Properties props = new Properties();

    props.put("mail.user", user);

    props.put("mail.host", host);

    props.put("mail.debug", debug ? "true" : "false");

    props.put("mail.store.protocol", "pop3");

    props.put("mail.transport.protocol", "smtp");

    //props.put("mail.smtp.auth", "true");

    session = Session.getInstance(props, this);

  }



  public PasswordAuthentication getPasswordAuthentication(){

    return authentication;

  }



  public void sendMessage(

    String to, String subject, String content)

      throws MessagingException

  {

    System.out.println("SENDING message from " + from + " to " + to);

    System.out.println();

    MimeMessage msg = new MimeMessage(session);

    msg.setFrom(new InternetAddress(from));

    msg.addRecipients(Message.RecipientType.TO, to);

    msg.setSubject(subject);

    msg.setText(content);

    Transport.send(msg);

  }



  public void checkInbox(int mode)

    throws MessagingException, IOException

  {

    if (mode == 0) return;

    boolean show = (mode & SHOW_MESSAGES) > 0;

    boolean clear = (mode & CLEAR_MESSAGES) > 0;

    String action =

      (show ? "Show" : "") +

      (show && clear ? " and " : "") +

      (clear ? "Clear" : "");

    System.out.println(action + " INBOX for " + from);

    Store store = session.getStore();

    store.connect();

    Folder root = store.getDefaultFolder();

    Folder inbox = root.getFolder("inbox");

    inbox.open(Folder.READ_WRITE);

    Message[] msgs = inbox.getMessages();

    if (msgs.length == 0 && show)

    {

      System.out.println("No messages in inbox");

    }

    for (int i = 0; i < msgs.length; i++)

    {

      MimeMessage msg = (MimeMessage)msgs[i];

      if (show)

      {

        System.out.println("    From: " + msg.getFrom()[0]);

        System.out.println(" Subject: " + msg.getSubject());

        System.out.println(" Content: " + msg.getContent());

      }

      if (clear)

      {

        msg.setFlag(Flags.Flag.DELETED, true);

      }

    }

    inbox.close(true);

    store.close();

    System.out.println();

  }

}


public class JamesConfigTest

{

  public static void main(String[] args)

    throws Exception

  {

    // CREATE CLIENT INSTANCES

    MailClient redClient = new MailClient("red@smo.tld","red",
"192.168.55.119");

    MailClient greenClient = new MailClient("green@smo.tld", "green",
"192.168.55.119");

    MailClient blueClient = new MailClient("blue@smo.tld","blue",
"192.168.55.119");



    // CLEAR EVERYBODY'S INBOX

    redClient.checkInbox(MailClient.CLEAR_MESSAGES);

    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);

    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);

    Thread.sleep(500); // Let the server catch up



    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)

    //redClient.getPasswordAuthentication();

    redClient.sendMessage(

      "garvicee@h5sw.com",

      "Testing blue from red",

      "This is a test message");

    //greenClient.getPasswordAuthentication();

    greenClient.sendMessage(

      "blue@smo.tld",

      "Testing blue from green",

      "This is a test message");

    Thread.sleep(500); // Let the server catch up



    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)

    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);

  }

}


Here is the output from the console

 Exception in thread "main" javax.mail.SendFailedException: Invalid
Addresses;

  nested exception is:

com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Authentication
Required


 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)

at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)

at javax.mail.Transport.send0(Transport.java:195)

at javax.mail.Transport.send(Transport.java:124)

at MailClient.sendMessage(MailClient.java:55)

at JamesConfigTest.main(JamesConfigTest.java:20)

Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1
Authentication Required


 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1733)

... 5 more

Here is the output in the JamesServer.log:

INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection established
from Garvice-MacBook.local (192.168.55.116)

INFO  13:38:51,477 | james.smtpserver | ID=128768368
org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)

INFO  13:38:51,479 | james.smtpserver | ID=128768368
org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
Required]

INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
Garvice-MacBook.local (192.168.55.116)


Here is the SMTP:

INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection established
from Garvice-MacBook.local (192.168.55.116)

INFO  13:38:51,477 | james.smtpserver | ID=128768368
org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)

INFO  13:38:51,479 | james.smtpserver | ID=128768368
org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
Required]

INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
Garvice-MacBook.local (192.168.55.116)


If I uncomment the line  //props.put("mail.smtp.auth", "true");

I get this error message:

Exception in thread "main" javax.mail.SendFailedException: Invalid
Addresses;

  nested exception is:

com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
Authentication for Specified Email Address


 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)

at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)

at javax.mail.Transport.send0(Transport.java:195)

at javax.mail.Transport.send(Transport.java:124)

at MailClient.sendMessage(MailClient.java:55)

at JamesConfigTest.main(JamesConfigTest.java:20)

Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
Authentication for Specified Email Address


 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)

... 5 more


With these Logfiles:

SMTPServer.log

INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection established
from Garvice-MacBook.local (192.168.55.116)

INFO  13:38:37,221 | james.smtpserver | ID=192071567
org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook: result=2
(DENY)

INFO  13:38:37,223 | james.smtpserver | ID=192071567
org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
Authentication for Specified Email Address]

INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
Garvice-MacBook.local (192.168.55.116)

James-Server.log

INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection established
from Garvice-MacBook.local (192.168.55.116)

INFO  13:38:37,221 | james.smtpserver | ID=192071567
org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook: result=2
(DENY)

INFO  13:38:37,223 | james.smtpserver | ID=192071567
org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
Authentication for Specified Email Address]

INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
Garvice-MacBook.local (192.168.55.116)


Any help with this would be great. I'm not really sure what I"m doing wrong.
I don't know if it's a setting in james or a property I need to set in
JavaMail for the Transport.

Also here is the SMTPServer.xml file

<smtpserver enabled="true">

  <bind>0.0.0.0:25</bind>

  <connectionBacklog>200</connectionBacklog>

  <tls socketTLS="false" startTLS="false">

  </tls>

  <connectiontimeout>360</connectiontimeout>

  <connectionLimit> 0 </connectionLimit>

  <connectionLimitPerIP> 0 </connectionLimitPerIP>

  <authorizedAddresses>127.0.0.0/8</authorizedAddresses>

  <authRequired>false</authRequired>

  <verifyIdentity>false</verifyIdentity>

  <maxmessagesize>0</maxmessagesize>

  <addressBracketsEnforcement>true</addressBracketsEnforcement>

  <handlerchain enableJmx="true">

    <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>

    <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>


  </handlerchain>

</smtpserver>

Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
I had already done all those. ended up having to create an SMTPTransport
object and getting the SMTP session instance form the session.
Then opening a new connection using the host, user, and password. then I
could send the msg,

Now to figure out how to use James with MYSQL

 MTPTransport t =
(SMTPTransport)session.getTransport("smtp");
try {
t.connect(host, user, pass);

t.sendMessage(msg, msg.getAllRecipients());
}
finally {
System.out.println("Response: " +
t.getLastServerResponse());


~Garvice

On Thu, Oct 20, 2011 at 6:13 AM, Eric Charles <er...@apache.org> wrote:

> Yes, the settings are in smtpserver.xml, with default being:
>
>    <authorizedAddresses>127.0.0.**0/8 <http://127.0.0.0/8>
> </authorizedAddresses>
>    <authRequired>true</**authRequired>
>    <verifyIdentity>true</**verifyIdentity>
>
> You change those settings (e.g. verifyIdentity to false, that will be an
> answer to what Patrick said).
>
> With default settings, ensure the from used in msg.setFrom(new
> InternetAddress(from)); is the same as the username/pwd.
>
> Thx,
>
> Eric
>
>
>
> On 19/10/11 21:48, Patrick Pyette wrote:
>
>> The only time that I've seen this issue (multiple times) is if the account
>> that you authenticate with is not the same as the  MAIL FROM command (and I
>> think obtained from the "From" header on the email message).   If you
>> authenticate as jsmith@domain.com, the only mail that you can
>> legitimately send must have a "From" header that matches that account (and
>> not bjones@domain.com, or jsmith@anotherdomain.com)
>>
>> Hope that helps.
>>
>> Cheers,
>> Pat
>>
>> On 2011-10-19, at 2:39 PM, Garvice Eakins wrote:
>>
>>  As far as I can tell it is all correct. I'm able to send internal emails,
>>> view and delete messages, I just can't seem to be able to send emails to
>>> external addresses. user@gmail.com
>>>
>>> On Wed, Oct 19, 2011 at 11:35 AM, Eric Charles<er...@apache.org>  wrote:
>>>
>>>  Ok, so you need to double check that the username/password combination
>>>> you
>>>> use in your java mail program is defined in james server.
>>>>
>>>> The username must be of the form user@domain.tld (its in fact the email
>>>> address).
>>>>
>>>> Thx,
>>>> Eric
>>>>
>>>>
>>>>
>>>> On 19/10/11 18:53, Garvice Eakins wrote:
>>>>
>>>>  If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>
>>>>> I get this error message:
>>>>>
>>>>> Exception in thread "main" javax.mail.****SendFailedException: Invalid
>>>>> Addresses;
>>>>>
>>>>>  nested exception is:
>>>>>
>>>>> com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1 Incorrect
>>>>> Authentication for Specified Email Address
>>>>>
>>>>>
>>>>> at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1835)
>>>>>
>>>>> at com.sun.mail.smtp.****SMTPTransport.sendMessage(**
>>>>> SMTPTransport.java:1098)
>>>>>
>>>>> at javax.mail.Transport.send0(****Transport.java:195)
>>>>>
>>>>> at javax.mail.Transport.send(****Transport.java:124)
>>>>>
>>>>> at MailClient.sendMessage(****MailClient.java:55)
>>>>>
>>>>> at JamesConfigTest.main(****JamesConfigTest.java:20)
>>>>>
>>>>> Caused by: com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1
>>>>> Incorrect
>>>>> Authentication for Specified Email Address
>>>>>
>>>>>
>>>>> at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1686)
>>>>>
>>>>> ... 5 more
>>>>>
>>>>>
>>>>> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>
>>>>> wrote:
>>>>>
>>>>> H Garvice,
>>>>>
>>>>>>
>>>>>> If you can send from your mail client to external mails, you must
>>>>>> ensure
>>>>>> your java client sends the needed credentials.
>>>>>>
>>>>>>  From the initial mail, I see that you have commented the
>>>>>> mail.smtp.auth
>>>>>> line:
>>>>>>
>>>>>> //props.put("mail.smtp.auth", "true");
>>>>>>
>>>>>> Can you try after uncommenting that line.
>>>>>>
>>>>>> Thx,
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>> On 19/10/11 17:23, Garvice Eakins wrote:
>>>>>>
>>>>>> But my original question still stands. Why am I getting an
>>>>>>
>>>>>>> authentication
>>>>>>> error from James when I try and send emails to an external email from
>>>>>>> my
>>>>>>> Java app?
>>>>>>> What part am I missing, I authenticated before I checked for message,
>>>>>>> and
>>>>>>> that works fine but not send as it does when I send internal emails.
>>>>>>>
>>>>>>> ~Garvice
>>>>>>>
>>>>>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>>
>>>>>>>
>>>>>>> Glad it is now OK.
>>>>>>>
>>>>>>>  Thx,
>>>>>>>> Eric
>>>>>>>>
>>>>>>>>
>>>>>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>>>>>
>>>>>>>> Eric,
>>>>>>>>
>>>>>>>>
>>>>>>>>> Ok I have attached an email client to the James Server (Apple Mail)
>>>>>>>>> I
>>>>>>>>> can
>>>>>>>>> send emails to internal addresses on the same domain, and I can
>>>>>>>>> send
>>>>>>>>> external emails as well.
>>>>>>>>> Using the Java Program I submitted earlier I can send internal
>>>>>>>>> emails,
>>>>>>>>> retrieve and print them to console. I can also view these emails
>>>>>>>>> using
>>>>>>>>> the
>>>>>>>>> mail client.
>>>>>>>>> I can also use the mail client to send internal emails. (Internal
>>>>>>>>> to
>>>>>>>>> the
>>>>>>>>> james server)
>>>>>>>>>
>>>>>>>>> ~Garvice
>>>>>>>>>
>>>>>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>>>>>> <er...@u-mangate.com>********wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> You simply have to define a new email account in your favorite mail
>>>>>>>>>
>>>>>>>>> client
>>>>>>>>>
>>>>>>>>>> with the username/password/host you have in James.
>>>>>>>>>>
>>>>>>>>>> Eric
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>>>>>
>>>>>>>>>> no I have not used thunderbird or any other standard mail client,
>>>>>>>>>> not
>>>>>>>>>>
>>>>>>>>>> really
>>>>>>>>>>
>>>>>>>>>>> sure even how to do that.
>>>>>>>>>>> I will search the site and see if I can find an example. If you
>>>>>>>>>>> could
>>>>>>>>>>> provide a link to one that would be great!
>>>>>>>>>>> I really am going blindly into this as I have almost zero
>>>>>>>>>>> knowledge
>>>>>>>>>>> about
>>>>>>>>>>> mail servers.
>>>>>>>>>>>
>>>>>>>>>>> ~Garvice
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>>>>>> <er...@u-mangate.com>**********wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> What Norman says + did you try from a standard mail client such
>>>>>>>>>>> as
>>>>>>>>>>>
>>>>>>>>>>>  thunderbird to test the server conf?
>>>>>>>>>>>> thx,
>>>>>>>>>>>> Eric
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi there,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> what exact version you are using? also are you sure the
>>>>>>>>>>>> recipients
>>>>>>>>>>>>
>>>>>>>>>>>>> exist
>>>>>>>>>>>>> at
>>>>>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>>>>>> smtpserver?
>>>>>>>>>>>>>
>>>>>>>>>>>>> bye
>>>>>>>>>>>>> norman
>>>>>>>>>>>>>
>>>>>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>>>>>
>>>>>>>>>>>>> :
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am having problems sending SMTP messages from James3.0 using
>>>>>>>>>>>>> a
>>>>>>>>>>>>>
>>>>>>>>>>>>>  simple
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> java
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  application using javamail.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the example I am using
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public class MailClient
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> extends Authenticator{
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public static final int SHOW_AND_CLEAR =
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> protected String from;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> protected Session session;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> protected PasswordAuthentication authentication;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   this(user, pass, host, false);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public MailClient(String user, String pass, String host,
>>>>>>>>>>>>>> boolean
>>>>>>>>>>>>>> debug){
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   from = user + '@' + host;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Properties props = new Properties();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   props.put("mail.user", user);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   props.put("mail.host", host);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   props.put("mail.store.************protocol", "pop3");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   props.put("mail.transport.************protocol", "smtp");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   session = Session.getInstance(props, this);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   return authentication;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public void sendMessage(
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   String to, String subject, String content)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     throws MessagingException
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>>>>>> to);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   System.out.println();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   msg.setFrom(new InternetAddress(from));
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   msg.addRecipients(Message.******
>>>>>>>>>>>>>> ******RecipientType.TO<http://
>>>>>>>>>>>>>> **
>>>>>>>>>>>>>> Message.RecipientType.TO<http:********//
>>>>>>>>>>>>>> Message.RecipientType.**TO <http://Message.RecipientType.TO>
>>>>>>>>>>>>>> **
>>>>>>>>>>>>>> <h**
>>>>>>>>>>>>>> ttp://Message.RecipientType.TO****<http://Message.**
>>>>>>>>>>>>>> RecipientType. <http://Message.RecipientType.>**
>>>>>>>>>>>>>> TO<http://Message.**RecipientType.TO<http://Message.RecipientType.TO>
>>>>>>>>>>>>>> >>**
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>  ,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>  to);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   msg.setSubject(subject);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   msg.setText(content);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Transport.send(msg);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public void checkInbox(int mode)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   throws MessagingException, IOException
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   if (mode == 0) return;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   boolean show = (mode&       SHOW_MESSAGES)>       0;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   boolean clear = (mode&       CLEAR_MESSAGES)>       0;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   String action =
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     (show ? "Show" : "") +
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     (show&&       clear ? " and " : "") +
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     (clear ? "Clear" : "");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   System.out.println(action + " INBOX for " + from);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Store store = session.getStore();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   store.connect();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Folder root = store.getDefaultFolder();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Folder inbox = root.getFolder("inbox");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   inbox.open(Folder.READ_WRITE);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Message[] msgs = inbox.getMessages();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   if (msgs.length == 0&&       show)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     System.out.println("No messages in inbox");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   for (int i = 0; i<       msgs.length; i++)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     if (show)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     if (clear)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>       msg.setFlag(Flags.Flag.************DELETED, true);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   inbox.close(true);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   store.close();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   System.out.println();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> public static void main(String[] args)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   throws Exception
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> {
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   // CREATE CLIENT INSTANCES
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   MailClient redClient = new MailClient("red@smo.tld","red"**
>>>>>>>>>>>>>> ****
>>>>>>>>>>>>>> ******,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>>>>>> "green",
>>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   MailClient blueClient = new MailClient("blue@smo.tld","****
>>>>>>>>>>>>>> ***
>>>>>>>>>>>>>> ****
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> *blue",
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   redClient.checkInbox(***********
>>>>>>>>>>>>>> *MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   greenClient.checkInbox(*********
>>>>>>>>>>>>>> ***MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   blueClient.checkInbox(**********
>>>>>>>>>>>>>> **MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   //redClient.************getPasswordAuthentication();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   redClient.sendMessage(
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "garvicee@h5sw.com",
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "Testing blue from red",
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "This is a test message");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   //greenClient.************getPasswordAuthentication();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   greenClient.sendMessage(
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "blue@smo.tld",
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "Testing blue from green",
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     "This is a test message");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND
>>>>>>>>>>>>>> GREEN)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   blueClient.checkInbox(**********
>>>>>>>>>>>>>> **MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Here is the output from the console
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Exception in thread "main" javax.mail.********
>>>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Invalid
>>>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> com.sun.mail.smtp.************SMTPAddressFailedException: 530
>>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>>> Required
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at com.sun.mail.smtp.************SMTPTransport.rcptTo(****
>>>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at com.sun.mail.smtp.************SMTPTransport.sendMessage(**
>>>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at javax.mail.Transport.send0(************Transport.java:195)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at javax.mail.Transport.send(************Transport.java:124)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at MailClient.sendMessage(************MailClient.java:55)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at JamesConfigTest.main(************JamesConfigTest.java:20)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>>>> 530
>>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>> Authentication Required
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at com.sun.mail.smtp.************SMTPTransport.rcptTo(****
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> established
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.****************
>>>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> org.apache.james.smtpserver.************JamesRcptCmdHandler:
>>>>>>>>>>>>>> 530
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>>> Required]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>> closed
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> established
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.****************
>>>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> org.apache.james.smtpserver.************JamesRcptCmdHandler:
>>>>>>>>>>>>>> 530
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>>> Required]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>> closed
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth",
>>>>>>>>>>>>>> "true");
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I get this error message:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Exception in thread "main" javax.mail.**********
>>>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Invalid
>>>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> com.sun.mail.smtp.************SMTPAddressFailedException: 503
>>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at com.sun.mail.smtp.************SMTPTransport.rcptTo(****
>>>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at com.sun.mail.smtp.************SMTPTransport.sendMessage(**
>>>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at javax.mail.Transport.send0(************Transport.java:195)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at javax.mail.Transport.send(************Transport.java:124)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at MailClient.sendMessage(************MailClient.java:55)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> at JamesConfigTest.main(************JamesConfigTest.java:20)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>>>> 503
>>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  Authentication for Specified Email Address
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  at com.sun.mail.smtp.************SMTPTransport.rcptTo(****
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> With these Logfiles:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> SMTPServer.log
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> established
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.****************
>>>>>>>>>>>>>> SenderAuthIdentifyVerification********
>>>>>>>>>>>>>> **
>>>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  (DENY)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.************JamesRcptCmdHandler:
>>>>>>>>>>>>>> 503
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>> closed
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> James-Server.log
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> established
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.****************
>>>>>>>>>>>>>> SenderAuthIdentifyVerification********
>>>>>>>>>>>>>> **
>>>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  (DENY)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>
>>>>>>>>>>>>>> org.apache.james.smtpserver.************JamesRcptCmdHandler:
>>>>>>>>>>>>>> 503
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567
>>>>>>>>>>>>>> Connection
>>>>>>>>>>>>>> closed
>>>>>>>>>>>>>> for
>>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Any help with this would be great. I'm not really sure what
>>>>>>>>>>>>>> I"m
>>>>>>>>>>>>>> doing
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> wrong.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  I don't know if it's a setting in james or a property I need
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>
>>>>>>>>>>>>> set
>>>>>>>>>>>>> in
>>>>>>>>>>>>>
>>>>>>>>>>>>> JavaMail for the Transport.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <bind>0.0.0.0:25</bind>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <connectionBacklog>200</************connectionBacklog>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <tls socketTLS="false" startTLS="false">
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> </tls>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <connectiontimeout>360</************connectiontimeout>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <connectionLimit>       0</connectionLimit>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <connectionLimitPerIP>       0</connectionLimitPerIP>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <authorizedAddresses>127.0.0.************0/8<
>>>>>>>>>>>>>> http://127.0.0.0/**8 <http://127.0.0.0/8>>
>>>>>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <authRequired>false</************authRequired>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <verifyIdentity>false</************verifyIdentity>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <maxmessagesize>0</************maxmessagesize>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <addressBracketsEnforcement>************true</******
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <handlerchain enableJmx="true">
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>   <handler
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> class="org.apache.james.************smtpserver.fastfail.****
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ValidRcptHandler"/>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    <handler class="org.apache.james.************smtpserver.**
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> CoreCmdHandlerLoader"/>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> </handlerchain>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> </smtpserver>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  --
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  Eric
>>>>>>>>>>>>>
>>>>>>>>>>>>>  http://about.echarles.net
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------************--------------------*
>>>>>>>>>>>> *--**
>>>>>>>>>>>> --**
>>>>>>>>>>>> --**--**
>>>>>>>>>>>> --**---------
>>>>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**
>>>>>>>>>>>> **********
>>>>>>>>>>>> apache.org
>>>>>>>>>>>> <
>>>>>>>>>>>> server-user-**unsubscribe@******ja**mes.apache.org<http://**
>>>>>>>>>>>> james.apache.org<http://james.**apache.org<http://james.apache.org>
>>>>>>>>>>>> >>
>>>>>>>>>>>> <unsubscribe@**james.apache.****org<http://james.apache.org><
>>>>>>>>>>>> unsubscribe@james.apache.****org<un...@james.apache.org>
>>>>>>>>>>>> >>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> <server-user-**unsubscribe@****j**ames.apache.org<http://**
>>>>>>>>>>>> james.apache.org <http://james.apache.org>>
>>>>>>>>>>>> <unsubscribe@**james.apache.**org <http://james.apache.org><
>>>>>>>>>>>> unsubscribe@james.apache.**org <un...@james.apache.org>>>
>>>>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>>> >
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   For additional commands, e-mail:
>>>>>>>>>>>> server-user-help@james.apache.***
>>>>>>>>>>>>
>>>>>>>>>>>>> ***
>>>>>>>>>>>>> **
>>>>>>>>>>>>>
>>>>>>>>>>>>> ****org<
>>>>>>>>>>>>>
>>>>>>>>>>>> server-user-help@james.********apach**e.org<http://apache.org**
>>>>>>>>>>>> ****><
>>>>>>>>>>>>
>>>>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org**
>>>>>>>>>>>> **><
>>>>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>>>> >
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  --
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Eric
>>>>>>>>>>>
>>>>>>>>>> http://about.echarles.net
>>>>>>>>>>
>>>>>>>>>> ------------------------------**********----------------------**
>>>>>>>>>> --**
>>>>>>>>>> --**--**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**********
>>>>>>>>>> apache.org
>>>>>>>>>> <
>>>>>>>>>> server-user-**unsubscribe@****ja**mes.apache.org<http://**
>>>>>>>>>> james.apache.org <http://james.apache.org>>
>>>>>>>>>> <unsubscribe@**james.apache.**org <http://james.apache.org><
>>>>>>>>>> unsubscribe@james.apache.**org <un...@james.apache.org>>>
>>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>> >
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>  For additional commands, e-mail: server-user-help@james.apache.*
>>>>>>>>>>> ***
>>>>>>>>>>> **
>>>>>>>>>>>
>>>>>>>>>>>  ****org<
>>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org****><
>>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>> >
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  --
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  Eric
>>>>>>>> http://about.echarles.net
>>>>>>>>
>>>>>>>> ------------------------------********------------------------**
>>>>>>>> --**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>>> apache.org
>>>>>>>> <
>>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>> <se...@james.apache.org>
>>>>>>>> <se...@james.apache.org>
>>>>>>>> >
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>> For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>>> **
>>>>>>>>>
>>>>>>>> ****org<
>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>> >
>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>>
>>>>>> Eric
>>>>>> http://about.echarles.net
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******
>>>>>> apache.org<
>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>> <se...@james.apache.org>
>>>>>> >
>>>>>>
>>>>>>>
>>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>>> ****org<
>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>> >>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>  --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>> >
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org <se...@james.apache.org>
>>>> >
>>>>
>>>>
>>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
> --
> Eric
> http://about.echarles.net
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@apache.org>.
Yes, the settings are in smtpserver.xml, with default being:

     <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
     <authRequired>true</authRequired>
     <verifyIdentity>true</verifyIdentity>

You change those settings (e.g. verifyIdentity to false, that will be an 
answer to what Patrick said).

With default settings, ensure the from used in msg.setFrom(new 
InternetAddress(from)); is the same as the username/pwd.

Thx,

Eric


On 19/10/11 21:48, Patrick Pyette wrote:
> The only time that I've seen this issue (multiple times) is if the account that you authenticate with is not the same as the  MAIL FROM command (and I think obtained from the "From" header on the email message).   If you authenticate as jsmith@domain.com, the only mail that you can legitimately send must have a "From" header that matches that account (and not bjones@domain.com, or jsmith@anotherdomain.com)
>
> Hope that helps.
>
> Cheers,
> Pat
>
> On 2011-10-19, at 2:39 PM, Garvice Eakins wrote:
>
>> As far as I can tell it is all correct. I'm able to send internal emails,
>> view and delete messages, I just can't seem to be able to send emails to
>> external addresses. user@gmail.com
>>
>> On Wed, Oct 19, 2011 at 11:35 AM, Eric Charles<er...@apache.org>  wrote:
>>
>>> Ok, so you need to double check that the username/password combination you
>>> use in your java mail program is defined in james server.
>>>
>>> The username must be of the form user@domain.tld (its in fact the email
>>> address).
>>>
>>> Thx,
>>> Eric
>>>
>>>
>>>
>>> On 19/10/11 18:53, Garvice Eakins wrote:
>>>
>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>
>>>> I get this error message:
>>>>
>>>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>>> Addresses;
>>>>
>>>>   nested exception is:
>>>>
>>>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>>>> Authentication for Specified Email Address
>>>>
>>>>
>>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>>
>>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>>> SMTPTransport.java:1098)
>>>>
>>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>>
>>>> at javax.mail.Transport.send(**Transport.java:124)
>>>>
>>>> at MailClient.sendMessage(**MailClient.java:55)
>>>>
>>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>>
>>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>>>> Incorrect
>>>> Authentication for Specified Email Address
>>>>
>>>>
>>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>>>
>>>> ... 5 more
>>>>
>>>>
>>>> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>   wrote:
>>>>
>>>> H Garvice,
>>>>>
>>>>> If you can send from your mail client to external mails, you must ensure
>>>>> your java client sends the needed credentials.
>>>>>
>>>>>  From the initial mail, I see that you have commented the mail.smtp.auth
>>>>> line:
>>>>>
>>>>> //props.put("mail.smtp.auth", "true");
>>>>>
>>>>> Can you try after uncommenting that line.
>>>>>
>>>>> Thx,
>>>>>
>>>>> Eric
>>>>>
>>>>>
>>>>> On 19/10/11 17:23, Garvice Eakins wrote:
>>>>>
>>>>> But my original question still stands. Why am I getting an
>>>>>> authentication
>>>>>> error from James when I try and send emails to an external email from my
>>>>>> Java app?
>>>>>> What part am I missing, I authenticated before I checked for message,
>>>>>> and
>>>>>> that works fine but not send as it does when I send internal emails.
>>>>>>
>>>>>> ~Garvice
>>>>>>
>>>>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>>>>> <er...@u-mangate.com>****wrote:
>>>>>>
>>>>>>
>>>>>> Glad it is now OK.
>>>>>>
>>>>>>> Thx,
>>>>>>> Eric
>>>>>>>
>>>>>>>
>>>>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>>>>
>>>>>>> Eric,
>>>>>>>
>>>>>>>>
>>>>>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>>>>>> can
>>>>>>>> send emails to internal addresses on the same domain, and I can send
>>>>>>>> external emails as well.
>>>>>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>>>>>> retrieve and print them to console. I can also view these emails using
>>>>>>>> the
>>>>>>>> mail client.
>>>>>>>> I can also use the mail client to send internal emails. (Internal to
>>>>>>>> the
>>>>>>>> james server)
>>>>>>>>
>>>>>>>> ~Garvice
>>>>>>>>
>>>>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> You simply have to define a new email account in your favorite mail
>>>>>>>>
>>>>>>>> client
>>>>>>>>> with the username/password/host you have in James.
>>>>>>>>>
>>>>>>>>> Eric
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>>>>
>>>>>>>>> no I have not used thunderbird or any other standard mail client,
>>>>>>>>> not
>>>>>>>>>
>>>>>>>>> really
>>>>>>>>>> sure even how to do that.
>>>>>>>>>> I will search the site and see if I can find an example. If you
>>>>>>>>>> could
>>>>>>>>>> provide a link to one that would be great!
>>>>>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>>>>>> about
>>>>>>>>>> mail servers.
>>>>>>>>>>
>>>>>>>>>> ~Garvice
>>>>>>>>>>
>>>>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>>>>> <er...@u-mangate.com>********wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> What Norman says + did you try from a standard mail client such as
>>>>>>>>>>
>>>>>>>>>>> thunderbird to test the server conf?
>>>>>>>>>>> thx,
>>>>>>>>>>> Eric
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi there,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> what exact version you are using? also are you sure the recipients
>>>>>>>>>>>> exist
>>>>>>>>>>>> at
>>>>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>>>>> smtpserver?
>>>>>>>>>>>>
>>>>>>>>>>>> bye
>>>>>>>>>>>> norman
>>>>>>>>>>>>
>>>>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>>>>
>>>>>>>>>>>> :
>>>>>>>>>>>>
>>>>>>>>>>>> I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>>>>>
>>>>>>>>>>>>> simple
>>>>>>>>>>>>>
>>>>>>>>>>>>> java
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   application using javamail.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the example I am using
>>>>>>>>>>>>>
>>>>>>>>>>>>> public class MailClient
>>>>>>>>>>>>>
>>>>>>>>>>>>> extends Authenticator{
>>>>>>>>>>>>>
>>>>>>>>>>>>> public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>>>>
>>>>>>>>>>>>> public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>>>>
>>>>>>>>>>>>> public static final int SHOW_AND_CLEAR =
>>>>>>>>>>>>>
>>>>>>>>>>>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>>>>
>>>>>>>>>>>>> protected String from;
>>>>>>>>>>>>>
>>>>>>>>>>>>> protected Session session;
>>>>>>>>>>>>>
>>>>>>>>>>>>> protected PasswordAuthentication authentication;
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    this(user, pass, host, false);
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> public MailClient(String user, String pass, String host, boolean
>>>>>>>>>>>>> debug){
>>>>>>>>>>>>>
>>>>>>>>>>>>>    from = user + '@' + host;
>>>>>>>>>>>>>
>>>>>>>>>>>>>    authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Properties props = new Properties();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    props.put("mail.user", user);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    props.put("mail.host", host);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    props.put("mail.store.**********protocol", "pop3");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    props.put("mail.transport.**********protocol", "smtp");
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    session = Session.getInstance(props, this);
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>>>>
>>>>>>>>>>>>>    return authentication;
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> public void sendMessage(
>>>>>>>>>>>>>
>>>>>>>>>>>>>    String to, String subject, String content)
>>>>>>>>>>>>>
>>>>>>>>>>>>>      throws MessagingException
>>>>>>>>>>>>>
>>>>>>>>>>>>> {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>>>>> to);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    System.out.println();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    msg.setFrom(new InternetAddress(from));
>>>>>>>>>>>>>
>>>>>>>>>>>>>    msg.addRecipients(Message.**********RecipientType.TO<http://
>>>>>>>>>>>>> **
>>>>>>>>>>>>> Message.RecipientType.TO<http:******//Message.RecipientType.TO**
>>>>>>>>>>>>> <h**
>>>>>>>>>>>>> ttp://Message.RecipientType.TO**<http://Message.RecipientType.**
>>>>>>>>>>>>> TO<http://Message.RecipientType.TO>>**
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> ,
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> to);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    msg.setSubject(subject);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    msg.setText(content);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Transport.send(msg);
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> public void checkInbox(int mode)
>>>>>>>>>>>>>
>>>>>>>>>>>>>    throws MessagingException, IOException
>>>>>>>>>>>>>
>>>>>>>>>>>>> {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    if (mode == 0) return;
>>>>>>>>>>>>>
>>>>>>>>>>>>>    boolean show = (mode&       SHOW_MESSAGES)>       0;
>>>>>>>>>>>>>
>>>>>>>>>>>>>    boolean clear = (mode&       CLEAR_MESSAGES)>       0;
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    String action =
>>>>>>>>>>>>>
>>>>>>>>>>>>>      (show ? "Show" : "") +
>>>>>>>>>>>>>
>>>>>>>>>>>>>      (show&&       clear ? " and " : "") +
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>      (clear ? "Clear" : "");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    System.out.println(action + " INBOX for " + from);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Store store = session.getStore();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    store.connect();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Folder root = store.getDefaultFolder();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Folder inbox = root.getFolder("inbox");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    inbox.open(Folder.READ_WRITE);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Message[] msgs = inbox.getMessages();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    if (msgs.length == 0&&       show)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    {
>>>>>>>>>>>>>
>>>>>>>>>>>>>      System.out.println("No messages in inbox");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    }
>>>>>>>>>>>>>
>>>>>>>>>>>>>    for (int i = 0; i<       msgs.length; i++)
>>>>>>>>>>>>>
>>>>>>>>>>>>>    {
>>>>>>>>>>>>>
>>>>>>>>>>>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>>>>
>>>>>>>>>>>>>      if (show)
>>>>>>>>>>>>>
>>>>>>>>>>>>>      {
>>>>>>>>>>>>>
>>>>>>>>>>>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>>>>
>>>>>>>>>>>>>        System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>>>>
>>>>>>>>>>>>>        System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>>>>
>>>>>>>>>>>>>      }
>>>>>>>>>>>>>
>>>>>>>>>>>>>      if (clear)
>>>>>>>>>>>>>
>>>>>>>>>>>>>      {
>>>>>>>>>>>>>
>>>>>>>>>>>>>        msg.setFlag(Flags.Flag.**********DELETED, true);
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>      }
>>>>>>>>>>>>>
>>>>>>>>>>>>>    }
>>>>>>>>>>>>>
>>>>>>>>>>>>>    inbox.close(true);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    store.close();
>>>>>>>>>>>>>
>>>>>>>>>>>>>    System.out.println();
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>>>>
>>>>>>>>>>>>> {
>>>>>>>>>>>>>
>>>>>>>>>>>>> public static void main(String[] args)
>>>>>>>>>>>>>
>>>>>>>>>>>>>    throws Exception
>>>>>>>>>>>>>
>>>>>>>>>>>>> {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    // CREATE CLIENT INSTANCES
>>>>>>>>>>>>>
>>>>>>>>>>>>>    MailClient redClient = new MailClient("red@smo.tld","red"****
>>>>>>>>>>>>> ******,
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>>>>> "green",
>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>>>>>>>> ****
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> *blue",
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>>>>
>>>>>>>>>>>>>    redClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    greenClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>
>>>>>>>>>>>>>    blueClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>>>>
>>>>>>>>>>>>>    //redClient.**********getPasswordAuthentication();
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    redClient.sendMessage(
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "garvicee@h5sw.com",
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "Testing blue from red",
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "This is a test message");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    //greenClient.**********getPasswordAuthentication();
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    greenClient.sendMessage(
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "blue@smo.tld",
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "Testing blue from green",
>>>>>>>>>>>>>
>>>>>>>>>>>>>      "This is a test message");
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>>>>>
>>>>>>>>>>>>>    blueClient.checkInbox(**********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the output from the console
>>>>>>>>>>>>>
>>>>>>>>>>>>> Exception in thread "main" javax.mail.********
>>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Invalid
>>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>>
>>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>>>
>>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 530
>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>> Required
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>>>
>>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>>> 530
>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>> Authentication Required
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>>
>>>>>>>>>>>>> established
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>>>
>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>> Required]
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>> closed
>>>>>>>>>>>>> for
>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>>
>>>>>>>>>>>>> established
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>>>
>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Authentication
>>>>>>>>>>>>> Required]
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>> closed
>>>>>>>>>>>>> for
>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>>>
>>>>>>>>>>>>> I get this error message:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Exception in thread "main" javax.mail.**********
>>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Invalid
>>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>>
>>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>>>
>>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 503
>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>>>
>>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>>>
>>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>>> 503
>>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   Authentication for Specified Email Address
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> With these Logfiles:
>>>>>>>>>>>>>
>>>>>>>>>>>>> SMTPServer.log
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>>
>>>>>>>>>>>>> established
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>>> **
>>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>>
>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   (DENY)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>>>
>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>
>>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>> closed
>>>>>>>>>>>>> for
>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>
>>>>>>>>>>>>> James-Server.log
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>>
>>>>>>>>>>>>> established
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>>> **
>>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>>
>>>>>>>>>>>>> result=2
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   (DENY)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>>>
>>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>>
>>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>>
>>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>> closed
>>>>>>>>>>>>> for
>>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>>>>>> doing
>>>>>>>>>>>>>
>>>>>>>>>>>>> wrong.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   I don't know if it's a setting in james or a property I need to
>>>>>>>>>>>> set
>>>>>>>>>>>> in
>>>>>>>>>>>>
>>>>>>>>>>>> JavaMail for the Transport.
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>>>>
>>>>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>>>>
>>>>>>>>>>>>> <bind>0.0.0.0:25</bind>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <connectionBacklog>200</**********connectionBacklog>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <tls socketTLS="false" startTLS="false">
>>>>>>>>>>>>>
>>>>>>>>>>>>> </tls>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <connectiontimeout>360</**********connectiontimeout>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <connectionLimit>       0</connectionLimit>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <connectionLimitPerIP>       0</connectionLimitPerIP>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <authorizedAddresses>127.0.0.**********0/8<http://127.0.0.0/8>
>>>>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <authRequired>false</**********authRequired>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <verifyIdentity>false</**********verifyIdentity>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <maxmessagesize>0</**********maxmessagesize>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <addressBracketsEnforcement>**********true</******
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>>>>
>>>>>>>>>>>>> <handlerchain enableJmx="true">
>>>>>>>>>>>>>
>>>>>>>>>>>>>    <handler
>>>>>>>>>>>>>
>>>>>>>>>>>>> class="org.apache.james.**********smtpserver.fastfail.****
>>>>>>>>>>>>>
>>>>>>>>>>>>> ValidRcptHandler"/>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     <handler class="org.apache.james.**********smtpserver.**
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> CoreCmdHandlerLoader"/>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> </handlerchain>
>>>>>>>>>>>>>
>>>>>>>>>>>>> </smtpserver>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   --
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> Eric
>>>>>>>>>>>>
>>>>>>>>>>> http://about.echarles.net
>>>>>>>>>>>
>>>>>>>>>>> ------------------------------**********----------------------**
>>>>>>>>>>> --**
>>>>>>>>>>> --**--**
>>>>>>>>>>> --**---------
>>>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**********
>>>>>>>>>>> apache.org
>>>>>>>>>>> <
>>>>>>>>>>> server-user-**unsubscribe@****ja**mes.apache.org<http://**
>>>>>>>>>>> james.apache.org<http://james.apache.org>>
>>>>>>>>>>> <unsubscribe@**james.apache.**org<http://james.apache.org><
>>>>>>>>>>> unsubscribe@james.apache.**org<un...@james.apache.org>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>>>> <un...@james.apache.org>>
>>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.*
>>>>>>>>>>>> ***
>>>>>>>>>>>> **
>>>>>>>>>>>>
>>>>>>>>>>>> ****org<
>>>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org****><
>>>>>>>>>>>
>>>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   --
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Eric
>>>>>>>>> http://about.echarles.net
>>>>>>>>>
>>>>>>>>> ------------------------------********------------------------**
>>>>>>>>> --**--**
>>>>>>>>> --**---------
>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>>>> apache.org
>>>>>>>>> <
>>>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>>>> <un...@james.apache.org>>
>>>>>>>>> <se...@james.apache.org>
>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>>>> **
>>>>>>>>>>
>>>>>>>>> ****org<
>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   --
>>>>>>>>
>>>>>>> Eric
>>>>>>> http://about.echarles.net
>>>>>>>
>>>>>>> ------------------------------******--------------------------**--**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>>>> <
>>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>>> <se...@james.apache.org>
>>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>> ****org<
>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>> Eric
>>>>> http://about.echarles.net
>>>>>
>>>>> ------------------------------****----------------------------**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>>>
>>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>>> server-user-help@james.**apache.org<se...@james.apache.org>>
>>>>>
>>>>>
>>>>>
>>>>
>>> --
>>> Eric
>>> http://about.echarles.net
>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Patrick Pyette <pp...@perimind.com>.
The only time that I've seen this issue (multiple times) is if the account that you authenticate with is not the same as the  MAIL FROM command (and I think obtained from the "From" header on the email message).   If you authenticate as jsmith@domain.com, the only mail that you can legitimately send must have a "From" header that matches that account (and not bjones@domain.com, or jsmith@anotherdomain.com)

Hope that helps.

Cheers,
Pat

On 2011-10-19, at 2:39 PM, Garvice Eakins wrote:

> As far as I can tell it is all correct. I'm able to send internal emails,
> view and delete messages, I just can't seem to be able to send emails to
> external addresses. user@gmail.com
> 
> On Wed, Oct 19, 2011 at 11:35 AM, Eric Charles <er...@apache.org> wrote:
> 
>> Ok, so you need to double check that the username/password combination you
>> use in your java mail program is defined in james server.
>> 
>> The username must be of the form user@domain.tld (its in fact the email
>> address).
>> 
>> Thx,
>> Eric
>> 
>> 
>> 
>> On 19/10/11 18:53, Garvice Eakins wrote:
>> 
>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>> 
>>> I get this error message:
>>> 
>>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>> Addresses;
>>> 
>>>  nested exception is:
>>> 
>>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>>> Authentication for Specified Email Address
>>> 
>>> 
>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>> 
>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>> SMTPTransport.java:1098)
>>> 
>>> at javax.mail.Transport.send0(**Transport.java:195)
>>> 
>>> at javax.mail.Transport.send(**Transport.java:124)
>>> 
>>> at MailClient.sendMessage(**MailClient.java:55)
>>> 
>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>> 
>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>>> Incorrect
>>> Authentication for Specified Email Address
>>> 
>>> 
>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>> 
>>> ... 5 more
>>> 
>>> 
>>> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>  wrote:
>>> 
>>> H Garvice,
>>>> 
>>>> If you can send from your mail client to external mails, you must ensure
>>>> your java client sends the needed credentials.
>>>> 
>>>> From the initial mail, I see that you have commented the mail.smtp.auth
>>>> line:
>>>> 
>>>> //props.put("mail.smtp.auth", "true");
>>>> 
>>>> Can you try after uncommenting that line.
>>>> 
>>>> Thx,
>>>> 
>>>> Eric
>>>> 
>>>> 
>>>> On 19/10/11 17:23, Garvice Eakins wrote:
>>>> 
>>>> But my original question still stands. Why am I getting an
>>>>> authentication
>>>>> error from James when I try and send emails to an external email from my
>>>>> Java app?
>>>>> What part am I missing, I authenticated before I checked for message,
>>>>> and
>>>>> that works fine but not send as it does when I send internal emails.
>>>>> 
>>>>> ~Garvice
>>>>> 
>>>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>>>> <er...@u-mangate.com>****wrote:
>>>>> 
>>>>> 
>>>>> Glad it is now OK.
>>>>> 
>>>>>> Thx,
>>>>>> Eric
>>>>>> 
>>>>>> 
>>>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>>> 
>>>>>> Eric,
>>>>>> 
>>>>>>> 
>>>>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>>>>> can
>>>>>>> send emails to internal addresses on the same domain, and I can send
>>>>>>> external emails as well.
>>>>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>>>>> retrieve and print them to console. I can also view these emails using
>>>>>>> the
>>>>>>> mail client.
>>>>>>> I can also use the mail client to send internal emails. (Internal to
>>>>>>> the
>>>>>>> james server)
>>>>>>> 
>>>>>>> ~Garvice
>>>>>>> 
>>>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> You simply have to define a new email account in your favorite mail
>>>>>>> 
>>>>>>> client
>>>>>>>> with the username/password/host you have in James.
>>>>>>>> 
>>>>>>>> Eric
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>>> 
>>>>>>>> no I have not used thunderbird or any other standard mail client,
>>>>>>>> not
>>>>>>>> 
>>>>>>>> really
>>>>>>>>> sure even how to do that.
>>>>>>>>> I will search the site and see if I can find an example. If you
>>>>>>>>> could
>>>>>>>>> provide a link to one that would be great!
>>>>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>>>>> about
>>>>>>>>> mail servers.
>>>>>>>>> 
>>>>>>>>> ~Garvice
>>>>>>>>> 
>>>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>>>> <er...@u-mangate.com>********wrote:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Hi,
>>>>>>>>> 
>>>>>>>>> What Norman says + did you try from a standard mail client such as
>>>>>>>>> 
>>>>>>>>>> thunderbird to test the server conf?
>>>>>>>>>> thx,
>>>>>>>>>> Eric
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>>> 
>>>>>>>>>> Hi there,
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> what exact version you are using? also are you sure the recipients
>>>>>>>>>>> exist
>>>>>>>>>>> at
>>>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>>>> smtpserver?
>>>>>>>>>>> 
>>>>>>>>>>> bye
>>>>>>>>>>> norman
>>>>>>>>>>> 
>>>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>>> 
>>>>>>>>>>> :
>>>>>>>>>>> 
>>>>>>>>>>> I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>>>> 
>>>>>>>>>>>> simple
>>>>>>>>>>>> 
>>>>>>>>>>>> java
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  application using javamail.
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> Here is the example I am using
>>>>>>>>>>>> 
>>>>>>>>>>>> public class MailClient
>>>>>>>>>>>> 
>>>>>>>>>>>> extends Authenticator{
>>>>>>>>>>>> 
>>>>>>>>>>>> public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>>> 
>>>>>>>>>>>> public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>>> 
>>>>>>>>>>>> public static final int SHOW_AND_CLEAR =
>>>>>>>>>>>> 
>>>>>>>>>>>>   SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>>> 
>>>>>>>>>>>> protected String from;
>>>>>>>>>>>> 
>>>>>>>>>>>> protected Session session;
>>>>>>>>>>>> 
>>>>>>>>>>>> protected PasswordAuthentication authentication;
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>>> 
>>>>>>>>>>>>   this(user, pass, host, false);
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> public MailClient(String user, String pass, String host, boolean
>>>>>>>>>>>> debug){
>>>>>>>>>>>> 
>>>>>>>>>>>>   from = user + '@' + host;
>>>>>>>>>>>> 
>>>>>>>>>>>>   authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>>> 
>>>>>>>>>>>>   Properties props = new Properties();
>>>>>>>>>>>> 
>>>>>>>>>>>>   props.put("mail.user", user);
>>>>>>>>>>>> 
>>>>>>>>>>>>   props.put("mail.host", host);
>>>>>>>>>>>> 
>>>>>>>>>>>>   props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>>> 
>>>>>>>>>>>>   props.put("mail.store.**********protocol", "pop3");
>>>>>>>>>>>> 
>>>>>>>>>>>>   props.put("mail.transport.**********protocol", "smtp");
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>> 
>>>>>>>>>>>>   session = Session.getInstance(props, this);
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>>> 
>>>>>>>>>>>>   return authentication;
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> public void sendMessage(
>>>>>>>>>>>> 
>>>>>>>>>>>>   String to, String subject, String content)
>>>>>>>>>>>> 
>>>>>>>>>>>>     throws MessagingException
>>>>>>>>>>>> 
>>>>>>>>>>>> {
>>>>>>>>>>>> 
>>>>>>>>>>>>   System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>>>> to);
>>>>>>>>>>>> 
>>>>>>>>>>>>   System.out.println();
>>>>>>>>>>>> 
>>>>>>>>>>>>   MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>>> 
>>>>>>>>>>>>   msg.setFrom(new InternetAddress(from));
>>>>>>>>>>>> 
>>>>>>>>>>>>   msg.addRecipients(Message.**********RecipientType.TO<http://
>>>>>>>>>>>> **
>>>>>>>>>>>> Message.RecipientType.TO<http:******//Message.RecipientType.TO**
>>>>>>>>>>>> <h**
>>>>>>>>>>>> ttp://Message.RecipientType.TO**<http://Message.RecipientType.**
>>>>>>>>>>>> TO <http://Message.RecipientType.TO>>**
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>> ,
>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>> to);
>>>>>>>>>>>> 
>>>>>>>>>>>>   msg.setSubject(subject);
>>>>>>>>>>>> 
>>>>>>>>>>>>   msg.setText(content);
>>>>>>>>>>>> 
>>>>>>>>>>>>   Transport.send(msg);
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> public void checkInbox(int mode)
>>>>>>>>>>>> 
>>>>>>>>>>>>   throws MessagingException, IOException
>>>>>>>>>>>> 
>>>>>>>>>>>> {
>>>>>>>>>>>> 
>>>>>>>>>>>>   if (mode == 0) return;
>>>>>>>>>>>> 
>>>>>>>>>>>>   boolean show = (mode&      SHOW_MESSAGES)>      0;
>>>>>>>>>>>> 
>>>>>>>>>>>>   boolean clear = (mode&      CLEAR_MESSAGES)>      0;
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   String action =
>>>>>>>>>>>> 
>>>>>>>>>>>>     (show ? "Show" : "") +
>>>>>>>>>>>> 
>>>>>>>>>>>>     (show&&      clear ? " and " : "") +
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>     (clear ? "Clear" : "");
>>>>>>>>>>>> 
>>>>>>>>>>>>   System.out.println(action + " INBOX for " + from);
>>>>>>>>>>>> 
>>>>>>>>>>>>   Store store = session.getStore();
>>>>>>>>>>>> 
>>>>>>>>>>>>   store.connect();
>>>>>>>>>>>> 
>>>>>>>>>>>>   Folder root = store.getDefaultFolder();
>>>>>>>>>>>> 
>>>>>>>>>>>>   Folder inbox = root.getFolder("inbox");
>>>>>>>>>>>> 
>>>>>>>>>>>>   inbox.open(Folder.READ_WRITE);
>>>>>>>>>>>> 
>>>>>>>>>>>>   Message[] msgs = inbox.getMessages();
>>>>>>>>>>>> 
>>>>>>>>>>>>   if (msgs.length == 0&&      show)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   {
>>>>>>>>>>>> 
>>>>>>>>>>>>     System.out.println("No messages in inbox");
>>>>>>>>>>>> 
>>>>>>>>>>>>   }
>>>>>>>>>>>> 
>>>>>>>>>>>>   for (int i = 0; i<      msgs.length; i++)
>>>>>>>>>>>> 
>>>>>>>>>>>>   {
>>>>>>>>>>>> 
>>>>>>>>>>>>     MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>>> 
>>>>>>>>>>>>     if (show)
>>>>>>>>>>>> 
>>>>>>>>>>>>     {
>>>>>>>>>>>> 
>>>>>>>>>>>>       System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>>> 
>>>>>>>>>>>>       System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>>> 
>>>>>>>>>>>>       System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>>> 
>>>>>>>>>>>>     }
>>>>>>>>>>>> 
>>>>>>>>>>>>     if (clear)
>>>>>>>>>>>> 
>>>>>>>>>>>>     {
>>>>>>>>>>>> 
>>>>>>>>>>>>       msg.setFlag(Flags.Flag.**********DELETED, true);
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>     }
>>>>>>>>>>>> 
>>>>>>>>>>>>   }
>>>>>>>>>>>> 
>>>>>>>>>>>>   inbox.close(true);
>>>>>>>>>>>> 
>>>>>>>>>>>>   store.close();
>>>>>>>>>>>> 
>>>>>>>>>>>>   System.out.println();
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>>> 
>>>>>>>>>>>> {
>>>>>>>>>>>> 
>>>>>>>>>>>> public static void main(String[] args)
>>>>>>>>>>>> 
>>>>>>>>>>>>   throws Exception
>>>>>>>>>>>> 
>>>>>>>>>>>> {
>>>>>>>>>>>> 
>>>>>>>>>>>>   // CREATE CLIENT INSTANCES
>>>>>>>>>>>> 
>>>>>>>>>>>>   MailClient redClient = new MailClient("red@smo.tld","red"****
>>>>>>>>>>>> ******,
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>> 
>>>>>>>>>>>>   MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>>>> "green",
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>> 
>>>>>>>>>>>>   MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>>>>>>> ****
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> *blue",
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>>> 
>>>>>>>>>>>>   redClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>> 
>>>>>>>>>>>>   greenClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>> 
>>>>>>>>>>>>   blueClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>>> 
>>>>>>>>>>>>   //redClient.**********getPasswordAuthentication();
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   redClient.sendMessage(
>>>>>>>>>>>> 
>>>>>>>>>>>>     "garvicee@h5sw.com",
>>>>>>>>>>>> 
>>>>>>>>>>>>     "Testing blue from red",
>>>>>>>>>>>> 
>>>>>>>>>>>>     "This is a test message");
>>>>>>>>>>>> 
>>>>>>>>>>>>   //greenClient.**********getPasswordAuthentication();
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   greenClient.sendMessage(
>>>>>>>>>>>> 
>>>>>>>>>>>>     "blue@smo.tld",
>>>>>>>>>>>> 
>>>>>>>>>>>>     "Testing blue from green",
>>>>>>>>>>>> 
>>>>>>>>>>>>     "This is a test message");
>>>>>>>>>>>> 
>>>>>>>>>>>>   Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>   // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>>>> 
>>>>>>>>>>>>   blueClient.checkInbox(**********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> }
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Here is the output from the console
>>>>>>>>>>>> 
>>>>>>>>>>>> Exception in thread "main" javax.mail.********
>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Invalid
>>>>>>>>>>>> Addresses;
>>>>>>>>>>>> 
>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>> 
>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 530
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>> 
>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>> 
>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>> 
>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>> 
>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>> 
>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>> 530
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> Authentication Required
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>> 
>>>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> 
>>>>>>>>>>>> established
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> result=2
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> (DENY)
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>> 
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required]
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> 
>>>>>>>>>>>> established
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> result=2
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> (DENY)
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>> 
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required]
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>> 
>>>>>>>>>>>> I get this error message:
>>>>>>>>>>>> 
>>>>>>>>>>>> Exception in thread "main" javax.mail.**********
>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Invalid
>>>>>>>>>>>> Addresses;
>>>>>>>>>>>> 
>>>>>>>>>>>> nested exception is:
>>>>>>>>>>>> 
>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 503
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>> 
>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>> 
>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>> 
>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>> 
>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>> 
>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>> 503
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  Authentication for Specified Email Address
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> With these Logfiles:
>>>>>>>>>>>> 
>>>>>>>>>>>> SMTPServer.log
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> 
>>>>>>>>>>>> established
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>> **
>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>> 
>>>>>>>>>>>> result=2
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  (DENY)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>> 
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>> 
>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>> 
>>>>>>>>>>>> James-Server.log
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> 
>>>>>>>>>>>> established
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>> **
>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>> 
>>>>>>>>>>>> result=2
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  (DENY)
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>> 
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>> 
>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>> 
>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>>>>> doing
>>>>>>>>>>>> 
>>>>>>>>>>>> wrong.
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  I don't know if it's a setting in james or a property I need to
>>>>>>>>>>> set
>>>>>>>>>>> in
>>>>>>>>>>> 
>>>>>>>>>>> JavaMail for the Transport.
>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>>> 
>>>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>>> 
>>>>>>>>>>>> <bind>0.0.0.0:25</bind>
>>>>>>>>>>>> 
>>>>>>>>>>>> <connectionBacklog>200</**********connectionBacklog>
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> <tls socketTLS="false" startTLS="false">
>>>>>>>>>>>> 
>>>>>>>>>>>> </tls>
>>>>>>>>>>>> 
>>>>>>>>>>>> <connectiontimeout>360</**********connectiontimeout>
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> <connectionLimit>      0</connectionLimit>
>>>>>>>>>>>> 
>>>>>>>>>>>> <connectionLimitPerIP>      0</connectionLimitPerIP>
>>>>>>>>>>>> 
>>>>>>>>>>>> <authorizedAddresses>127.0.0.**********0/8<http://127.0.0.0/8>
>>>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>>> 
>>>>>>>>>>>> <authRequired>false</**********authRequired>
>>>>>>>>>>>> 
>>>>>>>>>>>> <verifyIdentity>false</**********verifyIdentity>
>>>>>>>>>>>> 
>>>>>>>>>>>> <maxmessagesize>0</**********maxmessagesize>
>>>>>>>>>>>> 
>>>>>>>>>>>> <addressBracketsEnforcement>**********true</******
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>>> 
>>>>>>>>>>>> <handlerchain enableJmx="true">
>>>>>>>>>>>> 
>>>>>>>>>>>>   <handler
>>>>>>>>>>>> 
>>>>>>>>>>>> class="org.apache.james.**********smtpserver.fastfail.****
>>>>>>>>>>>> 
>>>>>>>>>>>> ValidRcptHandler"/>
>>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>>    <handler class="org.apache.james.**********smtpserver.**
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> CoreCmdHandlerLoader"/>
>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> </handlerchain>
>>>>>>>>>>>> 
>>>>>>>>>>>> </smtpserver>
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>  --
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>> Eric
>>>>>>>>>>> 
>>>>>>>>>> http://about.echarles.net
>>>>>>>>>> 
>>>>>>>>>> ------------------------------**********----------------------**
>>>>>>>>>> --**
>>>>>>>>>> --**--**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**********
>>>>>>>>>> apache.org
>>>>>>>>>> <
>>>>>>>>>> server-user-**unsubscribe@****ja**mes.apache.org<http://**
>>>>>>>>>> james.apache.org <http://james.apache.org>>
>>>>>>>>>> <unsubscribe@**james.apache.**org <http://james.apache.org><
>>>>>>>>>> unsubscribe@james.apache.**org <un...@james.apache.org>>>
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>  For additional commands, e-mail: server-user-help@james.apache.*
>>>>>>>>>>> ***
>>>>>>>>>>> **
>>>>>>>>>>> 
>>>>>>>>>>> ****org<
>>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org****><
>>>>>>>>>> 
>>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>  --
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Eric
>>>>>>>> http://about.echarles.net
>>>>>>>> 
>>>>>>>> ------------------------------********------------------------**
>>>>>>>> --**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>>> apache.org
>>>>>>>> <
>>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>> <se...@james.apache.org>
>>>>>>>> <se...@james.apache.org>
>>>>>>>>> 
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>>>> For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>>> **
>>>>>>>>> 
>>>>>>>> ****org<
>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>> 
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>>  --
>>>>>>> 
>>>>>> Eric
>>>>>> http://about.echarles.net
>>>>>> 
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>>> <
>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>> <se...@james.apache.org>
>>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> For additional commands, e-mail: server-user-help@james.apache.**
>>>>>> ****org<
>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> --
>>>> Eric
>>>> http://about.echarles.net
>>>> 
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>> 
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org <se...@james.apache.org>>
>>>> 
>>>> 
>>>> 
>>> 
>> --
>> Eric
>> http://about.echarles.net
>> 
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Eric Charles <er...@u-mangate.com>.
... but if I understand well, you can send to external email addresses 
with your Apple Mail client.  Which configuration did you use in Apple 
Mail client to achieve this (smtp auth?). Try reusing that 
username/password.

Thx,
Eric

On 19/10/11 20:39, Garvice Eakins wrote:
> As far as I can tell it is all correct. I'm able to send internal emails,
> view and delete messages, I just can't seem to be able to send emails to
> external addresses. user@gmail.com
>
> On Wed, Oct 19, 2011 at 11:35 AM, Eric Charles<er...@apache.org>  wrote:
>
>> Ok, so you need to double check that the username/password combination you
>> use in your java mail program is defined in james server.
>>
>> The username must be of the form user@domain.tld (its in fact the email
>> address).
>>
>> Thx,
>> Eric
>>
>>
>>
>> On 19/10/11 18:53, Garvice Eakins wrote:
>>
>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>
>>> I get this error message:
>>>
>>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>> Addresses;
>>>
>>>    nested exception is:
>>>
>>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>>> Authentication for Specified Email Address
>>>
>>>
>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>
>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>> SMTPTransport.java:1098)
>>>
>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>
>>> at javax.mail.Transport.send(**Transport.java:124)
>>>
>>> at MailClient.sendMessage(**MailClient.java:55)
>>>
>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>
>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>>> Incorrect
>>> Authentication for Specified Email Address
>>>
>>>
>>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>>
>>> ... 5 more
>>>
>>>
>>> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>   wrote:
>>>
>>>   H Garvice,
>>>>
>>>> If you can send from your mail client to external mails, you must ensure
>>>> your java client sends the needed credentials.
>>>>
>>>>   From the initial mail, I see that you have commented the mail.smtp.auth
>>>> line:
>>>>
>>>> //props.put("mail.smtp.auth", "true");
>>>>
>>>> Can you try after uncommenting that line.
>>>>
>>>> Thx,
>>>>
>>>> Eric
>>>>
>>>>
>>>> On 19/10/11 17:23, Garvice Eakins wrote:
>>>>
>>>>   But my original question still stands. Why am I getting an
>>>>> authentication
>>>>> error from James when I try and send emails to an external email from my
>>>>> Java app?
>>>>> What part am I missing, I authenticated before I checked for message,
>>>>> and
>>>>> that works fine but not send as it does when I send internal emails.
>>>>>
>>>>> ~Garvice
>>>>>
>>>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>>>> <er...@u-mangate.com>****wrote:
>>>>>
>>>>>
>>>>>   Glad it is now OK.
>>>>>
>>>>>> Thx,
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>>>
>>>>>>   Eric,
>>>>>>
>>>>>>>
>>>>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>>>>> can
>>>>>>> send emails to internal addresses on the same domain, and I can send
>>>>>>> external emails as well.
>>>>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>>>>> retrieve and print them to console. I can also view these emails using
>>>>>>> the
>>>>>>> mail client.
>>>>>>> I can also use the mail client to send internal emails. (Internal to
>>>>>>>   the
>>>>>>> james server)
>>>>>>>
>>>>>>> ~Garvice
>>>>>>>
>>>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   You simply have to define a new email account in your favorite mail
>>>>>>>
>>>>>>>   client
>>>>>>>> with the username/password/host you have in James.
>>>>>>>>
>>>>>>>> Eric
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>>>
>>>>>>>>   no I have not used thunderbird or any other standard mail client,
>>>>>>>> not
>>>>>>>>
>>>>>>>>   really
>>>>>>>>> sure even how to do that.
>>>>>>>>> I will search the site and see if I can find an example. If you
>>>>>>>>> could
>>>>>>>>> provide a link to one that would be great!
>>>>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>>>>> about
>>>>>>>>> mail servers.
>>>>>>>>>
>>>>>>>>> ~Garvice
>>>>>>>>>
>>>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>>>> <er...@u-mangate.com>********wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Hi,
>>>>>>>>>
>>>>>>>>>   What Norman says + did you try from a standard mail client such as
>>>>>>>>>
>>>>>>>>>> thunderbird to test the server conf?
>>>>>>>>>> thx,
>>>>>>>>>> Eric
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>>>
>>>>>>>>>>   Hi there,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   what exact version you are using? also are you sure the recipients
>>>>>>>>>>> exist
>>>>>>>>>>> at
>>>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>>>> smtpserver?
>>>>>>>>>>>
>>>>>>>>>>> bye
>>>>>>>>>>> norman
>>>>>>>>>>>
>>>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>>>
>>>>>>>>>>>   :
>>>>>>>>>>>
>>>>>>>>>>>   I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>>>>
>>>>>>>>>>>> simple
>>>>>>>>>>>>
>>>>>>>>>>>>   java
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    application using javamail.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   Here is the example I am using
>>>>>>>>>>>>
>>>>>>>>>>>> public class MailClient
>>>>>>>>>>>>
>>>>>>>>>>>>   extends Authenticator{
>>>>>>>>>>>>
>>>>>>>>>>>>   public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>>>
>>>>>>>>>>>>   public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>>>
>>>>>>>>>>>>   public static final int SHOW_AND_CLEAR =
>>>>>>>>>>>>
>>>>>>>>>>>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>>>
>>>>>>>>>>>>   protected String from;
>>>>>>>>>>>>
>>>>>>>>>>>>   protected Session session;
>>>>>>>>>>>>
>>>>>>>>>>>>   protected PasswordAuthentication authentication;
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>>>
>>>>>>>>>>>>     this(user, pass, host, false);
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>>   public MailClient(String user, String pass, String host, boolean
>>>>>>>>>>>> debug){
>>>>>>>>>>>>
>>>>>>>>>>>>     from = user + '@' + host;
>>>>>>>>>>>>
>>>>>>>>>>>>     authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>>>
>>>>>>>>>>>>     Properties props = new Properties();
>>>>>>>>>>>>
>>>>>>>>>>>>     props.put("mail.user", user);
>>>>>>>>>>>>
>>>>>>>>>>>>     props.put("mail.host", host);
>>>>>>>>>>>>
>>>>>>>>>>>>     props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>>>
>>>>>>>>>>>>     props.put("mail.store.**********protocol", "pop3");
>>>>>>>>>>>>
>>>>>>>>>>>>     props.put("mail.transport.**********protocol", "smtp");
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>>
>>>>>>>>>>>>     session = Session.getInstance(props, this);
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>>>
>>>>>>>>>>>>     return authentication;
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   public void sendMessage(
>>>>>>>>>>>>
>>>>>>>>>>>>     String to, String subject, String content)
>>>>>>>>>>>>
>>>>>>>>>>>>       throws MessagingException
>>>>>>>>>>>>
>>>>>>>>>>>>   {
>>>>>>>>>>>>
>>>>>>>>>>>>     System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>>>> to);
>>>>>>>>>>>>
>>>>>>>>>>>>     System.out.println();
>>>>>>>>>>>>
>>>>>>>>>>>>     MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>>>
>>>>>>>>>>>>     msg.setFrom(new InternetAddress(from));
>>>>>>>>>>>>
>>>>>>>>>>>>     msg.addRecipients(Message.**********RecipientType.TO<http://
>>>>>>>>>>>> **
>>>>>>>>>>>> Message.RecipientType.TO<http:******//Message.RecipientType.TO**
>>>>>>>>>>>> <h**
>>>>>>>>>>>> ttp://Message.RecipientType.TO**<http://Message.RecipientType.**
>>>>>>>>>>>> TO<http://Message.RecipientType.TO>>**
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>   ,
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> to);
>>>>>>>>>>>>
>>>>>>>>>>>>     msg.setSubject(subject);
>>>>>>>>>>>>
>>>>>>>>>>>>     msg.setText(content);
>>>>>>>>>>>>
>>>>>>>>>>>>     Transport.send(msg);
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   public void checkInbox(int mode)
>>>>>>>>>>>>
>>>>>>>>>>>>     throws MessagingException, IOException
>>>>>>>>>>>>
>>>>>>>>>>>>   {
>>>>>>>>>>>>
>>>>>>>>>>>>     if (mode == 0) return;
>>>>>>>>>>>>
>>>>>>>>>>>>     boolean show = (mode&       SHOW_MESSAGES)>       0;
>>>>>>>>>>>>
>>>>>>>>>>>>     boolean clear = (mode&       CLEAR_MESSAGES)>       0;
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     String action =
>>>>>>>>>>>>
>>>>>>>>>>>>       (show ? "Show" : "") +
>>>>>>>>>>>>
>>>>>>>>>>>>       (show&&       clear ? " and " : "") +
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>       (clear ? "Clear" : "");
>>>>>>>>>>>>
>>>>>>>>>>>>     System.out.println(action + " INBOX for " + from);
>>>>>>>>>>>>
>>>>>>>>>>>>     Store store = session.getStore();
>>>>>>>>>>>>
>>>>>>>>>>>>     store.connect();
>>>>>>>>>>>>
>>>>>>>>>>>>     Folder root = store.getDefaultFolder();
>>>>>>>>>>>>
>>>>>>>>>>>>     Folder inbox = root.getFolder("inbox");
>>>>>>>>>>>>
>>>>>>>>>>>>     inbox.open(Folder.READ_WRITE);
>>>>>>>>>>>>
>>>>>>>>>>>>     Message[] msgs = inbox.getMessages();
>>>>>>>>>>>>
>>>>>>>>>>>>     if (msgs.length == 0&&       show)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     {
>>>>>>>>>>>>
>>>>>>>>>>>>       System.out.println("No messages in inbox");
>>>>>>>>>>>>
>>>>>>>>>>>>     }
>>>>>>>>>>>>
>>>>>>>>>>>>     for (int i = 0; i<       msgs.length; i++)
>>>>>>>>>>>>
>>>>>>>>>>>>     {
>>>>>>>>>>>>
>>>>>>>>>>>>       MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>>>
>>>>>>>>>>>>       if (show)
>>>>>>>>>>>>
>>>>>>>>>>>>       {
>>>>>>>>>>>>
>>>>>>>>>>>>         System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>>>
>>>>>>>>>>>>         System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>>>
>>>>>>>>>>>>         System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>>>
>>>>>>>>>>>>       }
>>>>>>>>>>>>
>>>>>>>>>>>>       if (clear)
>>>>>>>>>>>>
>>>>>>>>>>>>       {
>>>>>>>>>>>>
>>>>>>>>>>>>         msg.setFlag(Flags.Flag.**********DELETED, true);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>       }
>>>>>>>>>>>>
>>>>>>>>>>>>     }
>>>>>>>>>>>>
>>>>>>>>>>>>     inbox.close(true);
>>>>>>>>>>>>
>>>>>>>>>>>>     store.close();
>>>>>>>>>>>>
>>>>>>>>>>>>     System.out.println();
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>>>
>>>>>>>>>>>> {
>>>>>>>>>>>>
>>>>>>>>>>>>   public static void main(String[] args)
>>>>>>>>>>>>
>>>>>>>>>>>>     throws Exception
>>>>>>>>>>>>
>>>>>>>>>>>>   {
>>>>>>>>>>>>
>>>>>>>>>>>>     // CREATE CLIENT INSTANCES
>>>>>>>>>>>>
>>>>>>>>>>>>     MailClient redClient = new MailClient("red@smo.tld","red"****
>>>>>>>>>>>> ******,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>
>>>>>>>>>>>>     MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>>>> "green",
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>
>>>>>>>>>>>>     MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>>>>>>> ****
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> *blue",
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>>>
>>>>>>>>>>>>     redClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>
>>>>>>>>>>>>     greenClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>
>>>>>>>>>>>>     blueClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>>>
>>>>>>>>>>>>     //redClient.**********getPasswordAuthentication();
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     redClient.sendMessage(
>>>>>>>>>>>>
>>>>>>>>>>>>       "garvicee@h5sw.com",
>>>>>>>>>>>>
>>>>>>>>>>>>       "Testing blue from red",
>>>>>>>>>>>>
>>>>>>>>>>>>       "This is a test message");
>>>>>>>>>>>>
>>>>>>>>>>>>     //greenClient.**********getPasswordAuthentication();
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     greenClient.sendMessage(
>>>>>>>>>>>>
>>>>>>>>>>>>       "blue@smo.tld",
>>>>>>>>>>>>
>>>>>>>>>>>>       "Testing blue from green",
>>>>>>>>>>>>
>>>>>>>>>>>>       "This is a test message");
>>>>>>>>>>>>
>>>>>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>>>>
>>>>>>>>>>>>     blueClient.checkInbox(**********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   }
>>>>>>>>>>>>
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the output from the console
>>>>>>>>>>>>
>>>>>>>>>>>>   Exception in thread "main" javax.mail.********
>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Invalid
>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>
>>>>>>>>>>>>   nested exception is:
>>>>>>>>>>>>
>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 530
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>
>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>>
>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>>
>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>>
>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>>
>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>> 530
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>> Authentication Required
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>
>>>>>>>>>>>>   established
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> result=2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>>
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required]
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>>
>>>>>>>>>>>>   established
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> result=2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> (DENY)
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>>
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Authentication
>>>>>>>>>>>> Required]
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>>
>>>>>>>>>>>> I get this error message:
>>>>>>>>>>>>
>>>>>>>>>>>> Exception in thread "main" javax.mail.**********
>>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Invalid
>>>>>>>>>>>> Addresses;
>>>>>>>>>>>>
>>>>>>>>>>>>   nested exception is:
>>>>>>>>>>>>
>>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 503
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>>
>>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>>
>>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>>
>>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>>
>>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>>
>>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>>
>>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>>> 503
>>>>>>>>>>>> 5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>   Incorrect
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    Authentication for Specified Email Address
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>   at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ... 5 more
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> With these Logfiles:
>>>>>>>>>>>>
>>>>>>>>>>>> SMTPServer.log
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>
>>>>>>>>>>>>   established
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>> **
>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>
>>>>>>>>>>>>   result=2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    (DENY)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>>
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>
>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>> James-Server.log
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>>
>>>>>>>>>>>>   established
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>>> **
>>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>>
>>>>>>>>>>>>   result=2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    (DENY)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>>
>>>>>>>>>>>> [5.7.1
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Incorrect
>>>>>>>>>>>>
>>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>>
>>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>> closed
>>>>>>>>>>>> for
>>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>>>>> doing
>>>>>>>>>>>>
>>>>>>>>>>>>   wrong.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    I don't know if it's a setting in james or a property I need to
>>>>>>>>>>> set
>>>>>>>>>>> in
>>>>>>>>>>>
>>>>>>>>>>>   JavaMail for the Transport.
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>>>
>>>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>>>
>>>>>>>>>>>>   <bind>0.0.0.0:25</bind>
>>>>>>>>>>>>
>>>>>>>>>>>>   <connectionBacklog>200</**********connectionBacklog>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   <tls socketTLS="false" startTLS="false">
>>>>>>>>>>>>
>>>>>>>>>>>>   </tls>
>>>>>>>>>>>>
>>>>>>>>>>>>   <connectiontimeout>360</**********connectiontimeout>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   <connectionLimit>       0</connectionLimit>
>>>>>>>>>>>>
>>>>>>>>>>>>   <connectionLimitPerIP>       0</connectionLimitPerIP>
>>>>>>>>>>>>
>>>>>>>>>>>>   <authorizedAddresses>127.0.0.**********0/8<http://127.0.0.0/8>
>>>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>>>
>>>>>>>>>>>>   <authRequired>false</**********authRequired>
>>>>>>>>>>>>
>>>>>>>>>>>>   <verifyIdentity>false</**********verifyIdentity>
>>>>>>>>>>>>
>>>>>>>>>>>>   <maxmessagesize>0</**********maxmessagesize>
>>>>>>>>>>>>
>>>>>>>>>>>>   <addressBracketsEnforcement>**********true</******
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>>>
>>>>>>>>>>>>   <handlerchain enableJmx="true">
>>>>>>>>>>>>
>>>>>>>>>>>>     <handler
>>>>>>>>>>>>
>>>>>>>>>>>>   class="org.apache.james.**********smtpserver.fastfail.****
>>>>>>>>>>>>
>>>>>>>>>>>>   ValidRcptHandler"/>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>      <handler class="org.apache.james.**********smtpserver.**
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   CoreCmdHandlerLoader"/>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   </handlerchain>
>>>>>>>>>>>>
>>>>>>>>>>>> </smtpserver>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>    --
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>   Eric
>>>>>>>>>>>
>>>>>>>>>> http://about.echarles.net
>>>>>>>>>>
>>>>>>>>>> ------------------------------**********----------------------**
>>>>>>>>>> --**
>>>>>>>>>> --**--**
>>>>>>>>>> --**---------
>>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**********
>>>>>>>>>> apache.org
>>>>>>>>>> <
>>>>>>>>>> server-user-**unsubscribe@****ja**mes.apache.org<http://**
>>>>>>>>>> james.apache.org<http://james.apache.org>>
>>>>>>>>>> <unsubscribe@**james.apache.**org<http://james.apache.org><
>>>>>>>>>> unsubscribe@james.apache.**org<un...@james.apache.org>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>>> <un...@james.apache.org>>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>> <se...@james.apache.org>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>    For additional commands, e-mail: server-user-help@james.apache.*
>>>>>>>>>>> ***
>>>>>>>>>>> **
>>>>>>>>>>>
>>>>>>>>>>>   ****org<
>>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org****><
>>>>>>>>>>
>>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    --
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Eric
>>>>>>>> http://about.echarles.net
>>>>>>>>
>>>>>>>> ------------------------------********------------------------**
>>>>>>>> --**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>>> apache.org
>>>>>>>> <
>>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>>> <un...@james.apache.org>>
>>>>>>>> <se...@james.apache.org>
>>>>>>>> <se...@james.apache.org>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>>> **
>>>>>>>>>
>>>>>>>> ****org<
>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>    --
>>>>>>>
>>>>>> Eric
>>>>>> http://about.echarles.net
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>>> <
>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>> <se...@james.apache.org>
>>>>>>>
>>>>>>
>>>>>>>
>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.**
>>>>>> ****org<
>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>   --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>>
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org<se...@james.apache.org>>
>>>>
>>>>
>>>>
>>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
As far as I can tell it is all correct. I'm able to send internal emails,
view and delete messages, I just can't seem to be able to send emails to
external addresses. user@gmail.com

On Wed, Oct 19, 2011 at 11:35 AM, Eric Charles <er...@apache.org> wrote:

> Ok, so you need to double check that the username/password combination you
> use in your java mail program is defined in james server.
>
> The username must be of the form user@domain.tld (its in fact the email
> address).
>
> Thx,
> Eric
>
>
>
> On 19/10/11 18:53, Garvice Eakins wrote:
>
>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>
>> I get this error message:
>>
>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>> Addresses;
>>
>>   nested exception is:
>>
>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>> Authentication for Specified Email Address
>>
>>
>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>
>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>> SMTPTransport.java:1098)
>>
>> at javax.mail.Transport.send0(**Transport.java:195)
>>
>> at javax.mail.Transport.send(**Transport.java:124)
>>
>> at MailClient.sendMessage(**MailClient.java:55)
>>
>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>
>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>> Incorrect
>> Authentication for Specified Email Address
>>
>>
>> at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>
>> ... 5 more
>>
>>
>> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>  wrote:
>>
>>  H Garvice,
>>>
>>> If you can send from your mail client to external mails, you must ensure
>>> your java client sends the needed credentials.
>>>
>>>  From the initial mail, I see that you have commented the mail.smtp.auth
>>> line:
>>>
>>> //props.put("mail.smtp.auth", "true");
>>>
>>> Can you try after uncommenting that line.
>>>
>>> Thx,
>>>
>>> Eric
>>>
>>>
>>> On 19/10/11 17:23, Garvice Eakins wrote:
>>>
>>>  But my original question still stands. Why am I getting an
>>>> authentication
>>>> error from James when I try and send emails to an external email from my
>>>> Java app?
>>>> What part am I missing, I authenticated before I checked for message,
>>>> and
>>>> that works fine but not send as it does when I send internal emails.
>>>>
>>>> ~Garvice
>>>>
>>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>>> <er...@u-mangate.com>****wrote:
>>>>
>>>>
>>>>  Glad it is now OK.
>>>>
>>>>> Thx,
>>>>> Eric
>>>>>
>>>>>
>>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>>
>>>>>  Eric,
>>>>>
>>>>>>
>>>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>>>> can
>>>>>> send emails to internal addresses on the same domain, and I can send
>>>>>> external emails as well.
>>>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>>>> retrieve and print them to console. I can also view these emails using
>>>>>> the
>>>>>> mail client.
>>>>>> I can also use the mail client to send internal emails. (Internal to
>>>>>>  the
>>>>>> james server)
>>>>>>
>>>>>> ~Garvice
>>>>>>
>>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>  You simply have to define a new email account in your favorite mail
>>>>>>
>>>>>>  client
>>>>>>> with the username/password/host you have in James.
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>>
>>>>>>>  no I have not used thunderbird or any other standard mail client,
>>>>>>> not
>>>>>>>
>>>>>>>  really
>>>>>>>> sure even how to do that.
>>>>>>>> I will search the site and see if I can find an example. If you
>>>>>>>> could
>>>>>>>> provide a link to one that would be great!
>>>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>>>> about
>>>>>>>> mail servers.
>>>>>>>>
>>>>>>>> ~Garvice
>>>>>>>>
>>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>>> <er...@u-mangate.com>********wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>  Hi,
>>>>>>>>
>>>>>>>>  What Norman says + did you try from a standard mail client such as
>>>>>>>>
>>>>>>>>> thunderbird to test the server conf?
>>>>>>>>> thx,
>>>>>>>>> Eric
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>>
>>>>>>>>>  Hi there,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  what exact version you are using? also are you sure the recipients
>>>>>>>>>> exist
>>>>>>>>>> at
>>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>>> smtpserver?
>>>>>>>>>>
>>>>>>>>>> bye
>>>>>>>>>> norman
>>>>>>>>>>
>>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>>
>>>>>>>>>>  :
>>>>>>>>>>
>>>>>>>>>>  I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>>>
>>>>>>>>>>> simple
>>>>>>>>>>>
>>>>>>>>>>>  java
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   application using javamail.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  Here is the example I am using
>>>>>>>>>>>
>>>>>>>>>>> public class MailClient
>>>>>>>>>>>
>>>>>>>>>>>  extends Authenticator{
>>>>>>>>>>>
>>>>>>>>>>>  public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>>
>>>>>>>>>>>  public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>>
>>>>>>>>>>>  public static final int SHOW_AND_CLEAR =
>>>>>>>>>>>
>>>>>>>>>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>>
>>>>>>>>>>>  protected String from;
>>>>>>>>>>>
>>>>>>>>>>>  protected Session session;
>>>>>>>>>>>
>>>>>>>>>>>  protected PasswordAuthentication authentication;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>>
>>>>>>>>>>>    this(user, pass, host, false);
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>>  public MailClient(String user, String pass, String host, boolean
>>>>>>>>>>> debug){
>>>>>>>>>>>
>>>>>>>>>>>    from = user + '@' + host;
>>>>>>>>>>>
>>>>>>>>>>>    authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>>
>>>>>>>>>>>    Properties props = new Properties();
>>>>>>>>>>>
>>>>>>>>>>>    props.put("mail.user", user);
>>>>>>>>>>>
>>>>>>>>>>>    props.put("mail.host", host);
>>>>>>>>>>>
>>>>>>>>>>>    props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>>
>>>>>>>>>>>    props.put("mail.store.**********protocol", "pop3");
>>>>>>>>>>>
>>>>>>>>>>>    props.put("mail.transport.**********protocol", "smtp");
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>
>>>>>>>>>>>    session = Session.getInstance(props, this);
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>>
>>>>>>>>>>>    return authentication;
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  public void sendMessage(
>>>>>>>>>>>
>>>>>>>>>>>    String to, String subject, String content)
>>>>>>>>>>>
>>>>>>>>>>>      throws MessagingException
>>>>>>>>>>>
>>>>>>>>>>>  {
>>>>>>>>>>>
>>>>>>>>>>>    System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>>> to);
>>>>>>>>>>>
>>>>>>>>>>>    System.out.println();
>>>>>>>>>>>
>>>>>>>>>>>    MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>>
>>>>>>>>>>>    msg.setFrom(new InternetAddress(from));
>>>>>>>>>>>
>>>>>>>>>>>    msg.addRecipients(Message.**********RecipientType.TO<http://
>>>>>>>>>>> **
>>>>>>>>>>> Message.RecipientType.TO<http:******//Message.RecipientType.TO**
>>>>>>>>>>> <h**
>>>>>>>>>>> ttp://Message.RecipientType.TO**<http://Message.RecipientType.**
>>>>>>>>>>> TO <http://Message.RecipientType.TO>>**
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>  ,
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> to);
>>>>>>>>>>>
>>>>>>>>>>>    msg.setSubject(subject);
>>>>>>>>>>>
>>>>>>>>>>>    msg.setText(content);
>>>>>>>>>>>
>>>>>>>>>>>    Transport.send(msg);
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  public void checkInbox(int mode)
>>>>>>>>>>>
>>>>>>>>>>>    throws MessagingException, IOException
>>>>>>>>>>>
>>>>>>>>>>>  {
>>>>>>>>>>>
>>>>>>>>>>>    if (mode == 0) return;
>>>>>>>>>>>
>>>>>>>>>>>    boolean show = (mode&      SHOW_MESSAGES)>      0;
>>>>>>>>>>>
>>>>>>>>>>>    boolean clear = (mode&      CLEAR_MESSAGES)>      0;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    String action =
>>>>>>>>>>>
>>>>>>>>>>>      (show ? "Show" : "") +
>>>>>>>>>>>
>>>>>>>>>>>      (show&&      clear ? " and " : "") +
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>      (clear ? "Clear" : "");
>>>>>>>>>>>
>>>>>>>>>>>    System.out.println(action + " INBOX for " + from);
>>>>>>>>>>>
>>>>>>>>>>>    Store store = session.getStore();
>>>>>>>>>>>
>>>>>>>>>>>    store.connect();
>>>>>>>>>>>
>>>>>>>>>>>    Folder root = store.getDefaultFolder();
>>>>>>>>>>>
>>>>>>>>>>>    Folder inbox = root.getFolder("inbox");
>>>>>>>>>>>
>>>>>>>>>>>    inbox.open(Folder.READ_WRITE);
>>>>>>>>>>>
>>>>>>>>>>>    Message[] msgs = inbox.getMessages();
>>>>>>>>>>>
>>>>>>>>>>>    if (msgs.length == 0&&      show)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    {
>>>>>>>>>>>
>>>>>>>>>>>      System.out.println("No messages in inbox");
>>>>>>>>>>>
>>>>>>>>>>>    }
>>>>>>>>>>>
>>>>>>>>>>>    for (int i = 0; i<      msgs.length; i++)
>>>>>>>>>>>
>>>>>>>>>>>    {
>>>>>>>>>>>
>>>>>>>>>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>>
>>>>>>>>>>>      if (show)
>>>>>>>>>>>
>>>>>>>>>>>      {
>>>>>>>>>>>
>>>>>>>>>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>>
>>>>>>>>>>>        System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>>
>>>>>>>>>>>        System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>>
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>      if (clear)
>>>>>>>>>>>
>>>>>>>>>>>      {
>>>>>>>>>>>
>>>>>>>>>>>        msg.setFlag(Flags.Flag.**********DELETED, true);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>      }
>>>>>>>>>>>
>>>>>>>>>>>    }
>>>>>>>>>>>
>>>>>>>>>>>    inbox.close(true);
>>>>>>>>>>>
>>>>>>>>>>>    store.close();
>>>>>>>>>>>
>>>>>>>>>>>    System.out.println();
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>>
>>>>>>>>>>> {
>>>>>>>>>>>
>>>>>>>>>>>  public static void main(String[] args)
>>>>>>>>>>>
>>>>>>>>>>>    throws Exception
>>>>>>>>>>>
>>>>>>>>>>>  {
>>>>>>>>>>>
>>>>>>>>>>>    // CREATE CLIENT INSTANCES
>>>>>>>>>>>
>>>>>>>>>>>    MailClient redClient = new MailClient("red@smo.tld","red"****
>>>>>>>>>>> ******,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>
>>>>>>>>>>>    MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>>> "green",
>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>
>>>>>>>>>>>    MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>>>>>> ****
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *blue",
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>>
>>>>>>>>>>>    redClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>
>>>>>>>>>>>    greenClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>
>>>>>>>>>>>    blueClient.checkInbox(**********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>>
>>>>>>>>>>>    //redClient.**********getPasswordAuthentication();
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    redClient.sendMessage(
>>>>>>>>>>>
>>>>>>>>>>>      "garvicee@h5sw.com",
>>>>>>>>>>>
>>>>>>>>>>>      "Testing blue from red",
>>>>>>>>>>>
>>>>>>>>>>>      "This is a test message");
>>>>>>>>>>>
>>>>>>>>>>>    //greenClient.**********getPasswordAuthentication();
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    greenClient.sendMessage(
>>>>>>>>>>>
>>>>>>>>>>>      "blue@smo.tld",
>>>>>>>>>>>
>>>>>>>>>>>      "Testing blue from green",
>>>>>>>>>>>
>>>>>>>>>>>      "This is a test message");
>>>>>>>>>>>
>>>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>>>
>>>>>>>>>>>    blueClient.checkInbox(**********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  }
>>>>>>>>>>>
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here is the output from the console
>>>>>>>>>>>
>>>>>>>>>>>  Exception in thread "main" javax.mail.********
>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Invalid
>>>>>>>>>>> Addresses;
>>>>>>>>>>>
>>>>>>>>>>>  nested exception is:
>>>>>>>>>>>
>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 530
>>>>>>>>>>> 5.7.1
>>>>>>>>>>> Authentication
>>>>>>>>>>> Required
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>
>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>
>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>
>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>
>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>
>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>
>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>> 530
>>>>>>>>>>> 5.7.1
>>>>>>>>>>> Authentication Required
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ... 5 more
>>>>>>>>>>>
>>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>
>>>>>>>>>>>  established
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> result=2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> (DENY)
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>
>>>>>>>>>>> [5.7.1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Authentication
>>>>>>>>>>> Required]
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>> closed
>>>>>>>>>>> for
>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>>
>>>>>>>>>>>  established
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>> AuthRequiredToRelayRcptHook:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> result=2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> (DENY)
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 530
>>>>>>>>>>>
>>>>>>>>>>> [5.7.1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Authentication
>>>>>>>>>>> Required]
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>> closed
>>>>>>>>>>> for
>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>>>
>>>>>>>>>>> I get this error message:
>>>>>>>>>>>
>>>>>>>>>>> Exception in thread "main" javax.mail.**********
>>>>>>>>>>> SendFailedException:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Invalid
>>>>>>>>>>> Addresses;
>>>>>>>>>>>
>>>>>>>>>>>  nested exception is:
>>>>>>>>>>>
>>>>>>>>>>> com.sun.mail.smtp.**********SMTPAddressFailedException: 503
>>>>>>>>>>> 5.7.1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Incorrect
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>>
>>>>>>>>>>> at com.sun.mail.smtp.**********SMTPTransport.sendMessage(**
>>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>>
>>>>>>>>>>> at javax.mail.Transport.send0(**********Transport.java:195)
>>>>>>>>>>>
>>>>>>>>>>> at javax.mail.Transport.send(**********Transport.java:124)
>>>>>>>>>>>
>>>>>>>>>>> at MailClient.sendMessage(**********MailClient.java:55)
>>>>>>>>>>>
>>>>>>>>>>> at JamesConfigTest.main(**********JamesConfigTest.java:20)
>>>>>>>>>>>
>>>>>>>>>>> Caused by: com.sun.mail.smtp.**********
>>>>>>>>>>> SMTPAddressFailedException:
>>>>>>>>>>> 503
>>>>>>>>>>> 5.7.1
>>>>>>>>>>>
>>>>>>>>>>>  Incorrect
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   Authentication for Specified Email Address
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>  at com.sun.mail.smtp.**********SMTPTransport.rcptTo(****
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ... 5 more
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> With these Logfiles:
>>>>>>>>>>>
>>>>>>>>>>> SMTPServer.log
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>
>>>>>>>>>>>  established
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>> **
>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>
>>>>>>>>>>>  result=2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   (DENY)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>
>>>>>>>>>>> [5.7.1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Incorrect
>>>>>>>>>>>
>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>> closed
>>>>>>>>>>> for
>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>> James-Server.log
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>>
>>>>>>>>>>>  established
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>>> org.apache.james.smtpserver.**************
>>>>>>>>>>> SenderAuthIdentifyVerification******
>>>>>>>>>>> **
>>>>>>>>>>> **RcptHook:
>>>>>>>>>>>
>>>>>>>>>>>  result=2
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   (DENY)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>>> org.apache.james.smtpserver.**********JamesRcptCmdHandler: 503
>>>>>>>>>>>
>>>>>>>>>>> [5.7.1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Incorrect
>>>>>>>>>>>
>>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>>
>>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>> closed
>>>>>>>>>>> for
>>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>>>> doing
>>>>>>>>>>>
>>>>>>>>>>>  wrong.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   I don't know if it's a setting in james or a property I need to
>>>>>>>>>> set
>>>>>>>>>> in
>>>>>>>>>>
>>>>>>>>>>  JavaMail for the Transport.
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>>
>>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>>
>>>>>>>>>>>  <bind>0.0.0.0:25</bind>
>>>>>>>>>>>
>>>>>>>>>>>  <connectionBacklog>200</**********connectionBacklog>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  <tls socketTLS="false" startTLS="false">
>>>>>>>>>>>
>>>>>>>>>>>  </tls>
>>>>>>>>>>>
>>>>>>>>>>>  <connectiontimeout>360</**********connectiontimeout>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  <connectionLimit>      0</connectionLimit>
>>>>>>>>>>>
>>>>>>>>>>>  <connectionLimitPerIP>      0</connectionLimitPerIP>
>>>>>>>>>>>
>>>>>>>>>>>  <authorizedAddresses>127.0.0.**********0/8<http://127.0.0.0/8>
>>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>>
>>>>>>>>>>>  <authRequired>false</**********authRequired>
>>>>>>>>>>>
>>>>>>>>>>>  <verifyIdentity>false</**********verifyIdentity>
>>>>>>>>>>>
>>>>>>>>>>>  <maxmessagesize>0</**********maxmessagesize>
>>>>>>>>>>>
>>>>>>>>>>>  <addressBracketsEnforcement>**********true</******
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>>
>>>>>>>>>>>  <handlerchain enableJmx="true">
>>>>>>>>>>>
>>>>>>>>>>>    <handler
>>>>>>>>>>>
>>>>>>>>>>>  class="org.apache.james.**********smtpserver.fastfail.****
>>>>>>>>>>>
>>>>>>>>>>>  ValidRcptHandler"/>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     <handler class="org.apache.james.**********smtpserver.**
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  CoreCmdHandlerLoader"/>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  </handlerchain>
>>>>>>>>>>>
>>>>>>>>>>> </smtpserver>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   --
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>  Eric
>>>>>>>>>>
>>>>>>>>> http://about.echarles.net
>>>>>>>>>
>>>>>>>>> ------------------------------**********----------------------**
>>>>>>>>> --**
>>>>>>>>> --**--**
>>>>>>>>> --**---------
>>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.**********
>>>>>>>>> apache.org
>>>>>>>>> <
>>>>>>>>> server-user-**unsubscribe@****ja**mes.apache.org<http://**
>>>>>>>>> james.apache.org <http://james.apache.org>>
>>>>>>>>> <unsubscribe@**james.apache.**org <http://james.apache.org><
>>>>>>>>> unsubscribe@james.apache.**org <un...@james.apache.org>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <server-user-**unsubscribe@**j**ames.apache.org<http://james.apache.org>
>>>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>>> <se...@james.apache.org>
>>>>>>>>> <se...@james.apache.org>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.*
>>>>>>>>>> ***
>>>>>>>>>> **
>>>>>>>>>>
>>>>>>>>>>  ****org<
>>>>>>>>> server-user-help@james.******apach**e.org<http://apache.org****><
>>>>>>>>>
>>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   --
>>>>>>>>>
>>>>>>>>
>>>>>>>>  Eric
>>>>>>> http://about.echarles.net
>>>>>>>
>>>>>>> ------------------------------********------------------------**
>>>>>>> --**--**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>> apache.org
>>>>>>> <
>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>> <se...@james.apache.org>
>>>>>>> <se...@james.apache.org>
>>>>>>> >
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>> **
>>>>>>>>
>>>>>>> ****org<
>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>> >
>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   --
>>>>>>
>>>>> Eric
>>>>> http://about.echarles.net
>>>>>
>>>>> ------------------------------******--------------------------**--**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>> <
>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>> <se...@james.apache.org>
>>>>> >
>>>>>
>>>>>>
>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>> ****org<
>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>> >>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>  --
>>> Eric
>>> http://about.echarles.net
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>> >
>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>> server-user-help@james.**apache.org <se...@james.apache.org>>
>>>
>>>
>>>
>>
> --
> Eric
> http://about.echarles.net
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@apache.org>.
Ok, so you need to double check that the username/password combination 
you use in your java mail program is defined in james server.

The username must be of the form user@domain.tld (its in fact the email 
address).

Thx,
Eric


On 19/10/11 18:53, Garvice Eakins wrote:
> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>
> I get this error message:
>
> Exception in thread "main" javax.mail.SendFailedException: Invalid
> Addresses;
>
>    nested exception is:
>
> com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
> Authentication for Specified Email Address
>
>
> at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>
> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>
> at javax.mail.Transport.send0(Transport.java:195)
>
> at javax.mail.Transport.send(Transport.java:124)
>
> at MailClient.sendMessage(MailClient.java:55)
>
> at JamesConfigTest.main(JamesConfigTest.java:20)
>
> Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
> Authentication for Specified Email Address
>
>
> at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
>
> ... 5 more
>
>
> On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles<er...@apache.org>  wrote:
>
>> H Garvice,
>>
>> If you can send from your mail client to external mails, you must ensure
>> your java client sends the needed credentials.
>>
>>  From the initial mail, I see that you have commented the mail.smtp.auth
>> line:
>>
>> //props.put("mail.smtp.auth", "true");
>>
>> Can you try after uncommenting that line.
>>
>> Thx,
>>
>> Eric
>>
>>
>> On 19/10/11 17:23, Garvice Eakins wrote:
>>
>>> But my original question still stands. Why am I getting an authentication
>>> error from James when I try and send emails to an external email from my
>>> Java app?
>>> What part am I missing, I authenticated before I checked for message, and
>>> that works fine but not send as it does when I send internal emails.
>>>
>>> ~Garvice
>>>
>>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>>> <er...@u-mangate.com>**wrote:
>>>
>>>   Glad it is now OK.
>>>> Thx,
>>>> Eric
>>>>
>>>>
>>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>>
>>>>   Eric,
>>>>>
>>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>>> can
>>>>> send emails to internal addresses on the same domain, and I can send
>>>>> external emails as well.
>>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>>> retrieve and print them to console. I can also view these emails using
>>>>> the
>>>>> mail client.
>>>>> I can also use the mail client to send internal emails. (Internal to
>>>>>   the
>>>>> james server)
>>>>>
>>>>> ~Garvice
>>>>>
>>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>>> <er...@u-mangate.com>****wrote:
>>>>>
>>>>>
>>>>>   You simply have to define a new email account in your favorite mail
>>>>>
>>>>>> client
>>>>>> with the username/password/host you have in James.
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>>
>>>>>>   no I have not used thunderbird or any other standard mail client, not
>>>>>>
>>>>>>> really
>>>>>>> sure even how to do that.
>>>>>>> I will search the site and see if I can find an example. If you could
>>>>>>> provide a link to one that would be great!
>>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>>> about
>>>>>>> mail servers.
>>>>>>>
>>>>>>> ~Garvice
>>>>>>>
>>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>>
>>>>>>>   Hi,
>>>>>>>
>>>>>>>   What Norman says + did you try from a standard mail client such as
>>>>>>>> thunderbird to test the server conf?
>>>>>>>> thx,
>>>>>>>> Eric
>>>>>>>>
>>>>>>>>
>>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>>
>>>>>>>>   Hi there,
>>>>>>>>
>>>>>>>>
>>>>>>>>> what exact version you are using? also are you sure the recipients
>>>>>>>>> exist
>>>>>>>>> at
>>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>>> smtpserver?
>>>>>>>>>
>>>>>>>>> bye
>>>>>>>>> norman
>>>>>>>>>
>>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>>> garviceeakins@gmail.com
>>>>>>>>>
>>>>>>>>>   :
>>>>>>>>>
>>>>>>>>>   I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>>> simple
>>>>>>>>>>
>>>>>>>>>>   java
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   application using javamail.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Here is the example I am using
>>>>>>>>>>
>>>>>>>>>> public class MailClient
>>>>>>>>>>
>>>>>>>>>>   extends Authenticator{
>>>>>>>>>>
>>>>>>>>>>   public static final int SHOW_MESSAGES = 1;
>>>>>>>>>>
>>>>>>>>>>   public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>>
>>>>>>>>>>   public static final int SHOW_AND_CLEAR =
>>>>>>>>>>
>>>>>>>>>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>>
>>>>>>>>>>   protected String from;
>>>>>>>>>>
>>>>>>>>>>   protected Session session;
>>>>>>>>>>
>>>>>>>>>>   protected PasswordAuthentication authentication;
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>>
>>>>>>>>>>     this(user, pass, host, false);
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>>   public MailClient(String user, String pass, String host, boolean
>>>>>>>>>> debug){
>>>>>>>>>>
>>>>>>>>>>     from = user + '@' + host;
>>>>>>>>>>
>>>>>>>>>>     authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>>
>>>>>>>>>>     Properties props = new Properties();
>>>>>>>>>>
>>>>>>>>>>     props.put("mail.user", user);
>>>>>>>>>>
>>>>>>>>>>     props.put("mail.host", host);
>>>>>>>>>>
>>>>>>>>>>     props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>>
>>>>>>>>>>     props.put("mail.store.********protocol", "pop3");
>>>>>>>>>>
>>>>>>>>>>     props.put("mail.transport.********protocol", "smtp");
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     //props.put("mail.smtp.auth", "true");
>>>>>>>>>>
>>>>>>>>>>     session = Session.getInstance(props, this);
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>>
>>>>>>>>>>     return authentication;
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   public void sendMessage(
>>>>>>>>>>
>>>>>>>>>>     String to, String subject, String content)
>>>>>>>>>>
>>>>>>>>>>       throws MessagingException
>>>>>>>>>>
>>>>>>>>>>   {
>>>>>>>>>>
>>>>>>>>>>     System.out.println("SENDING message from " + from + " to " +
>>>>>>>>>> to);
>>>>>>>>>>
>>>>>>>>>>     System.out.println();
>>>>>>>>>>
>>>>>>>>>>     MimeMessage msg = new MimeMessage(session);
>>>>>>>>>>
>>>>>>>>>>     msg.setFrom(new InternetAddress(from));
>>>>>>>>>>
>>>>>>>>>>     msg.addRecipients(Message.********RecipientType.TO<http://**
>>>>>>>>>> Message.RecipientType.TO<http:****//Message.RecipientType.TO<h**
>>>>>>>>>> ttp://Message.RecipientType.TO<http://Message.RecipientType.TO>**
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   ,
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> to);
>>>>>>>>>>
>>>>>>>>>>     msg.setSubject(subject);
>>>>>>>>>>
>>>>>>>>>>     msg.setText(content);
>>>>>>>>>>
>>>>>>>>>>     Transport.send(msg);
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   public void checkInbox(int mode)
>>>>>>>>>>
>>>>>>>>>>     throws MessagingException, IOException
>>>>>>>>>>
>>>>>>>>>>   {
>>>>>>>>>>
>>>>>>>>>>     if (mode == 0) return;
>>>>>>>>>>
>>>>>>>>>>     boolean show = (mode&      SHOW_MESSAGES)>      0;
>>>>>>>>>>
>>>>>>>>>>     boolean clear = (mode&      CLEAR_MESSAGES)>      0;
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     String action =
>>>>>>>>>>
>>>>>>>>>>       (show ? "Show" : "") +
>>>>>>>>>>
>>>>>>>>>>       (show&&      clear ? " and " : "") +
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>       (clear ? "Clear" : "");
>>>>>>>>>>
>>>>>>>>>>     System.out.println(action + " INBOX for " + from);
>>>>>>>>>>
>>>>>>>>>>     Store store = session.getStore();
>>>>>>>>>>
>>>>>>>>>>     store.connect();
>>>>>>>>>>
>>>>>>>>>>     Folder root = store.getDefaultFolder();
>>>>>>>>>>
>>>>>>>>>>     Folder inbox = root.getFolder("inbox");
>>>>>>>>>>
>>>>>>>>>>     inbox.open(Folder.READ_WRITE);
>>>>>>>>>>
>>>>>>>>>>     Message[] msgs = inbox.getMessages();
>>>>>>>>>>
>>>>>>>>>>     if (msgs.length == 0&&      show)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     {
>>>>>>>>>>
>>>>>>>>>>       System.out.println("No messages in inbox");
>>>>>>>>>>
>>>>>>>>>>     }
>>>>>>>>>>
>>>>>>>>>>     for (int i = 0; i<      msgs.length; i++)
>>>>>>>>>>
>>>>>>>>>>     {
>>>>>>>>>>
>>>>>>>>>>       MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>>
>>>>>>>>>>       if (show)
>>>>>>>>>>
>>>>>>>>>>       {
>>>>>>>>>>
>>>>>>>>>>         System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>>
>>>>>>>>>>         System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>>
>>>>>>>>>>         System.out.println(" Content: " + msg.getContent());
>>>>>>>>>>
>>>>>>>>>>       }
>>>>>>>>>>
>>>>>>>>>>       if (clear)
>>>>>>>>>>
>>>>>>>>>>       {
>>>>>>>>>>
>>>>>>>>>>         msg.setFlag(Flags.Flag.********DELETED, true);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>       }
>>>>>>>>>>
>>>>>>>>>>     }
>>>>>>>>>>
>>>>>>>>>>     inbox.close(true);
>>>>>>>>>>
>>>>>>>>>>     store.close();
>>>>>>>>>>
>>>>>>>>>>     System.out.println();
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> public class JamesConfigTest
>>>>>>>>>>
>>>>>>>>>> {
>>>>>>>>>>
>>>>>>>>>>   public static void main(String[] args)
>>>>>>>>>>
>>>>>>>>>>     throws Exception
>>>>>>>>>>
>>>>>>>>>>   {
>>>>>>>>>>
>>>>>>>>>>     // CREATE CLIENT INSTANCES
>>>>>>>>>>
>>>>>>>>>>     MailClient redClient = new MailClient("red@smo.tld","red"**
>>>>>>>>>> ******,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>
>>>>>>>>>>     MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>>> "green",
>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>
>>>>>>>>>>     MailClient blueClient = new MailClient("blue@smo.tld","*******
>>>>>>>>>>
>>>>>>>>>> *blue",
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> "192.168.55.119");
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     // CLEAR EVERYBODY'S INBOX
>>>>>>>>>>
>>>>>>>>>>     redClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>
>>>>>>>>>>     greenClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>
>>>>>>>>>>     blueClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>>
>>>>>>>>>>     //redClient.********getPasswordAuthentication();
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     redClient.sendMessage(
>>>>>>>>>>
>>>>>>>>>>       "garvicee@h5sw.com",
>>>>>>>>>>
>>>>>>>>>>       "Testing blue from red",
>>>>>>>>>>
>>>>>>>>>>       "This is a test message");
>>>>>>>>>>
>>>>>>>>>>     //greenClient.********getPasswordAuthentication();
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     greenClient.sendMessage(
>>>>>>>>>>
>>>>>>>>>>       "blue@smo.tld",
>>>>>>>>>>
>>>>>>>>>>       "Testing blue from green",
>>>>>>>>>>
>>>>>>>>>>       "This is a test message");
>>>>>>>>>>
>>>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>>
>>>>>>>>>>     blueClient.checkInbox(********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   }
>>>>>>>>>>
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Here is the output from the console
>>>>>>>>>>
>>>>>>>>>>   Exception in thread "main" javax.mail.********
>>>>>>>>>> SendFailedException:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Invalid
>>>>>>>>>> Addresses;
>>>>>>>>>>
>>>>>>>>>>   nested exception is:
>>>>>>>>>>
>>>>>>>>>> com.sun.mail.smtp.********SMTPAddressFailedException: 530 5.7.1
>>>>>>>>>> Authentication
>>>>>>>>>> Required
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>
>>>>>>>>>> at com.sun.mail.smtp.********SMTPTransport.sendMessage(**
>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>
>>>>>>>>>> at javax.mail.Transport.send0(********Transport.java:195)
>>>>>>>>>>
>>>>>>>>>> at javax.mail.Transport.send(********Transport.java:124)
>>>>>>>>>>
>>>>>>>>>> at MailClient.sendMessage(********MailClient.java:55)
>>>>>>>>>>
>>>>>>>>>> at JamesConfigTest.main(********JamesConfigTest.java:20)
>>>>>>>>>>
>>>>>>>>>> Caused by: com.sun.mail.smtp.********SMTPAddressFailedException:
>>>>>>>>>> 530
>>>>>>>>>> 5.7.1
>>>>>>>>>> Authentication Required
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 5 more
>>>>>>>>>>
>>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>
>>>>>>>>>>   established
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>> org.apache.james.smtpserver.**********AuthRequiredToRelayRcptHook:
>>>>>>>>>>
>>>>>>>>>> result=2
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> (DENY)
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 530
>>>>>>>>>> [5.7.1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Authentication
>>>>>>>>>> Required]
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>> closed
>>>>>>>>>> for
>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Here is the SMTP:
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>>
>>>>>>>>>>   established
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>>> org.apache.james.smtpserver.**********AuthRequiredToRelayRcptHook:
>>>>>>>>>>
>>>>>>>>>> result=2
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> (DENY)
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 530
>>>>>>>>>> [5.7.1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Authentication
>>>>>>>>>> Required]
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>> closed
>>>>>>>>>> for
>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>>
>>>>>>>>>> I get this error message:
>>>>>>>>>>
>>>>>>>>>> Exception in thread "main" javax.mail.********SendFailedException:
>>>>>>>>>>
>>>>>>>>>> Invalid
>>>>>>>>>> Addresses;
>>>>>>>>>>
>>>>>>>>>>   nested exception is:
>>>>>>>>>>
>>>>>>>>>> com.sun.mail.smtp.********SMTPAddressFailedException: 503 5.7.1
>>>>>>>>>>
>>>>>>>>>> Incorrect
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>>
>>>>>>>>>> at com.sun.mail.smtp.********SMTPTransport.sendMessage(**
>>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>>
>>>>>>>>>> at javax.mail.Transport.send0(********Transport.java:195)
>>>>>>>>>>
>>>>>>>>>> at javax.mail.Transport.send(********Transport.java:124)
>>>>>>>>>>
>>>>>>>>>> at MailClient.sendMessage(********MailClient.java:55)
>>>>>>>>>>
>>>>>>>>>> at JamesConfigTest.main(********JamesConfigTest.java:20)
>>>>>>>>>>
>>>>>>>>>> Caused by: com.sun.mail.smtp.********SMTPAddressFailedException:
>>>>>>>>>> 503
>>>>>>>>>> 5.7.1
>>>>>>>>>>
>>>>>>>>>>   Incorrect
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   Authentication for Specified Email Address
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ... 5 more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> With these Logfiles:
>>>>>>>>>>
>>>>>>>>>> SMTPServer.log
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>
>>>>>>>>>>   established
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>> org.apache.james.smtpserver.************
>>>>>>>>>> SenderAuthIdentifyVerification****
>>>>>>>>>> **
>>>>>>>>>> **RcptHook:
>>>>>>>>>>
>>>>>>>>>>   result=2
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   (DENY)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 503
>>>>>>>>>> [5.7.1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Incorrect
>>>>>>>>>>
>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>> closed
>>>>>>>>>> for
>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>> James-Server.log
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>>
>>>>>>>>>>   established
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>>> org.apache.james.smtpserver.************
>>>>>>>>>> SenderAuthIdentifyVerification****
>>>>>>>>>> **
>>>>>>>>>> **RcptHook:
>>>>>>>>>>
>>>>>>>>>>   result=2
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   (DENY)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 503
>>>>>>>>>> [5.7.1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Incorrect
>>>>>>>>>>
>>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>>
>>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>> closed
>>>>>>>>>> for
>>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>>> doing
>>>>>>>>>>
>>>>>>>>>>   wrong.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   I don't know if it's a setting in james or a property I need to set
>>>>>>>>> in
>>>>>>>>>
>>>>>>>>>   JavaMail for the Transport.
>>>>>>>>>>
>>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>>
>>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>>
>>>>>>>>>>   <bind>0.0.0.0:25</bind>
>>>>>>>>>>
>>>>>>>>>>   <connectionBacklog>200</********connectionBacklog>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   <tls socketTLS="false" startTLS="false">
>>>>>>>>>>
>>>>>>>>>>   </tls>
>>>>>>>>>>
>>>>>>>>>>   <connectiontimeout>360</********connectiontimeout>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   <connectionLimit>      0</connectionLimit>
>>>>>>>>>>
>>>>>>>>>>   <connectionLimitPerIP>      0</connectionLimitPerIP>
>>>>>>>>>>
>>>>>>>>>>   <authorizedAddresses>127.0.0.********0/8<http://127.0.0.0/8>
>>>>>>>>>> </authorizedAddresses>
>>>>>>>>>>
>>>>>>>>>>   <authRequired>false</********authRequired>
>>>>>>>>>>
>>>>>>>>>>   <verifyIdentity>false</********verifyIdentity>
>>>>>>>>>>
>>>>>>>>>>   <maxmessagesize>0</********maxmessagesize>
>>>>>>>>>>
>>>>>>>>>>   <addressBracketsEnforcement>********true</******
>>>>>>>>>>
>>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>>
>>>>>>>>>>   <handlerchain enableJmx="true">
>>>>>>>>>>
>>>>>>>>>>     <handler
>>>>>>>>>>
>>>>>>>>>>   class="org.apache.james.********smtpserver.fastfail.****
>>>>>>>>>>
>>>>>>>>>>   ValidRcptHandler"/>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>      <handler class="org.apache.james.********smtpserver.**
>>>>>>>>>
>>>>>>>>>   CoreCmdHandlerLoader"/>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   </handlerchain>
>>>>>>>>>>
>>>>>>>>>> </smtpserver>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    --
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Eric
>>>>>>>> http://about.echarles.net
>>>>>>>>
>>>>>>>> ------------------------------********------------------------**
>>>>>>>> --**--**
>>>>>>>> --**---------
>>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>>> apache.org
>>>>>>>> <
>>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>>> <un...@james.apache.org>>
>>>>>>>>
>>>>>>>> <se...@james.apache.org>
>>>>>>>> <se...@james.apache.org>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>>> **
>>>>>>>>>
>>>>>>>> ****org<
>>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>    --
>>>>>>>
>>>>>> Eric
>>>>>> http://about.echarles.net
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>>> <
>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>> <se...@james.apache.org>
>>>>>>>
>>>>>>
>>>>>>>
>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.**
>>>>>> ****org<
>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>   --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>>
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org<se...@james.apache.org>>
>>>>
>>>>
>>>>
>>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
If I uncomment the line  //props.put("mail.smtp.auth", "true");

I get this error message:

Exception in thread "main" javax.mail.SendFailedException: Invalid
Addresses;

  nested exception is:

com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
Authentication for Specified Email Address


at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)

at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)

at javax.mail.Transport.send0(Transport.java:195)

at javax.mail.Transport.send(Transport.java:124)

at MailClient.sendMessage(MailClient.java:55)

at JamesConfigTest.main(JamesConfigTest.java:20)

Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
Authentication for Specified Email Address


at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)

... 5 more


On Wed, Oct 19, 2011 at 9:50 AM, Eric Charles <er...@apache.org> wrote:

> H Garvice,
>
> If you can send from your mail client to external mails, you must ensure
> your java client sends the needed credentials.
>
> From the initial mail, I see that you have commented the mail.smtp.auth
> line:
>
> //props.put("mail.smtp.auth", "true");
>
> Can you try after uncommenting that line.
>
> Thx,
>
> Eric
>
>
> On 19/10/11 17:23, Garvice Eakins wrote:
>
>> But my original question still stands. Why am I getting an authentication
>> error from James when I try and send emails to an external email from my
>> Java app?
>> What part am I missing, I authenticated before I checked for message, and
>> that works fine but not send as it does when I send internal emails.
>>
>> ~Garvice
>>
>> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
>> <er...@u-mangate.com>**wrote:
>>
>>  Glad it is now OK.
>>> Thx,
>>> Eric
>>>
>>>
>>> On 19/10/11 01:30, Garvice Eakins wrote:
>>>
>>>  Eric,
>>>>
>>>> Ok I have attached an email client to the James Server (Apple Mail) I
>>>> can
>>>> send emails to internal addresses on the same domain, and I can send
>>>> external emails as well.
>>>> Using the Java Program I submitted earlier I can send internal emails,
>>>> retrieve and print them to console. I can also view these emails using
>>>> the
>>>> mail client.
>>>> I can also use the mail client to send internal emails. (Internal to
>>>>  the
>>>> james server)
>>>>
>>>> ~Garvice
>>>>
>>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>>> <er...@u-mangate.com>****wrote:
>>>>
>>>>
>>>>  You simply have to define a new email account in your favorite mail
>>>>
>>>>> client
>>>>> with the username/password/host you have in James.
>>>>>
>>>>> Eric
>>>>>
>>>>>
>>>>>
>>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>>
>>>>>  no I have not used thunderbird or any other standard mail client, not
>>>>>
>>>>>> really
>>>>>> sure even how to do that.
>>>>>> I will search the site and see if I can find an example. If you could
>>>>>> provide a link to one that would be great!
>>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>>> about
>>>>>> mail servers.
>>>>>>
>>>>>> ~Garvice
>>>>>>
>>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>>> <er...@u-mangate.com>******wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>>  What Norman says + did you try from a standard mail client such as
>>>>>>> thunderbird to test the server conf?
>>>>>>> thx,
>>>>>>> Eric
>>>>>>>
>>>>>>>
>>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>>
>>>>>>>  Hi there,
>>>>>>>
>>>>>>>
>>>>>>>> what exact version you are using? also are you sure the recipients
>>>>>>>> exist
>>>>>>>> at
>>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>>> smtpserver?
>>>>>>>>
>>>>>>>> bye
>>>>>>>> norman
>>>>>>>>
>>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>>> garviceeakins@gmail.com
>>>>>>>>
>>>>>>>>  :
>>>>>>>>
>>>>>>>>  I am having problems sending SMTP messages from James3.0 using a
>>>>>>>>> simple
>>>>>>>>>
>>>>>>>>>  java
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  application using javamail.
>>>>>>>>
>>>>>>>>
>>>>>>>>> Here is the example I am using
>>>>>>>>>
>>>>>>>>> public class MailClient
>>>>>>>>>
>>>>>>>>>  extends Authenticator{
>>>>>>>>>
>>>>>>>>>  public static final int SHOW_MESSAGES = 1;
>>>>>>>>>
>>>>>>>>>  public static final int CLEAR_MESSAGES = 2;
>>>>>>>>>
>>>>>>>>>  public static final int SHOW_AND_CLEAR =
>>>>>>>>>
>>>>>>>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>>
>>>>>>>>>  protected String from;
>>>>>>>>>
>>>>>>>>>  protected Session session;
>>>>>>>>>
>>>>>>>>>  protected PasswordAuthentication authentication;
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>>
>>>>>>>>>    this(user, pass, host, false);
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>  public MailClient(String user, String pass, String host, boolean
>>>>>>>>> debug){
>>>>>>>>>
>>>>>>>>>    from = user + '@' + host;
>>>>>>>>>
>>>>>>>>>    authentication = new PasswordAuthentication(user, pass);
>>>>>>>>>
>>>>>>>>>    Properties props = new Properties();
>>>>>>>>>
>>>>>>>>>    props.put("mail.user", user);
>>>>>>>>>
>>>>>>>>>    props.put("mail.host", host);
>>>>>>>>>
>>>>>>>>>    props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>>
>>>>>>>>>    props.put("mail.store.********protocol", "pop3");
>>>>>>>>>
>>>>>>>>>    props.put("mail.transport.********protocol", "smtp");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    //props.put("mail.smtp.auth", "true");
>>>>>>>>>
>>>>>>>>>    session = Session.getInstance(props, this);
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>>
>>>>>>>>>    return authentication;
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  public void sendMessage(
>>>>>>>>>
>>>>>>>>>    String to, String subject, String content)
>>>>>>>>>
>>>>>>>>>      throws MessagingException
>>>>>>>>>
>>>>>>>>>  {
>>>>>>>>>
>>>>>>>>>    System.out.println("SENDING message from " + from + " to " +
>>>>>>>>> to);
>>>>>>>>>
>>>>>>>>>    System.out.println();
>>>>>>>>>
>>>>>>>>>    MimeMessage msg = new MimeMessage(session);
>>>>>>>>>
>>>>>>>>>    msg.setFrom(new InternetAddress(from));
>>>>>>>>>
>>>>>>>>>    msg.addRecipients(Message.********RecipientType.TO<http://**
>>>>>>>>> Message.RecipientType.TO<http:****//Message.RecipientType.TO<h**
>>>>>>>>> ttp://Message.RecipientType.TO <http://Message.RecipientType.TO>**
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>>  ,
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> to);
>>>>>>>>>
>>>>>>>>>    msg.setSubject(subject);
>>>>>>>>>
>>>>>>>>>    msg.setText(content);
>>>>>>>>>
>>>>>>>>>    Transport.send(msg);
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  public void checkInbox(int mode)
>>>>>>>>>
>>>>>>>>>    throws MessagingException, IOException
>>>>>>>>>
>>>>>>>>>  {
>>>>>>>>>
>>>>>>>>>    if (mode == 0) return;
>>>>>>>>>
>>>>>>>>>    boolean show = (mode&     SHOW_MESSAGES)>     0;
>>>>>>>>>
>>>>>>>>>    boolean clear = (mode&     CLEAR_MESSAGES)>     0;
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    String action =
>>>>>>>>>
>>>>>>>>>      (show ? "Show" : "") +
>>>>>>>>>
>>>>>>>>>      (show&&     clear ? " and " : "") +
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>      (clear ? "Clear" : "");
>>>>>>>>>
>>>>>>>>>    System.out.println(action + " INBOX for " + from);
>>>>>>>>>
>>>>>>>>>    Store store = session.getStore();
>>>>>>>>>
>>>>>>>>>    store.connect();
>>>>>>>>>
>>>>>>>>>    Folder root = store.getDefaultFolder();
>>>>>>>>>
>>>>>>>>>    Folder inbox = root.getFolder("inbox");
>>>>>>>>>
>>>>>>>>>    inbox.open(Folder.READ_WRITE);
>>>>>>>>>
>>>>>>>>>    Message[] msgs = inbox.getMessages();
>>>>>>>>>
>>>>>>>>>    if (msgs.length == 0&&     show)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    {
>>>>>>>>>
>>>>>>>>>      System.out.println("No messages in inbox");
>>>>>>>>>
>>>>>>>>>    }
>>>>>>>>>
>>>>>>>>>    for (int i = 0; i<     msgs.length; i++)
>>>>>>>>>
>>>>>>>>>    {
>>>>>>>>>
>>>>>>>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>>
>>>>>>>>>      if (show)
>>>>>>>>>
>>>>>>>>>      {
>>>>>>>>>
>>>>>>>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>>
>>>>>>>>>        System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>>
>>>>>>>>>        System.out.println(" Content: " + msg.getContent());
>>>>>>>>>
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      if (clear)
>>>>>>>>>
>>>>>>>>>      {
>>>>>>>>>
>>>>>>>>>        msg.setFlag(Flags.Flag.********DELETED, true);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>    }
>>>>>>>>>
>>>>>>>>>    inbox.close(true);
>>>>>>>>>
>>>>>>>>>    store.close();
>>>>>>>>>
>>>>>>>>>    System.out.println();
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> public class JamesConfigTest
>>>>>>>>>
>>>>>>>>> {
>>>>>>>>>
>>>>>>>>>  public static void main(String[] args)
>>>>>>>>>
>>>>>>>>>    throws Exception
>>>>>>>>>
>>>>>>>>>  {
>>>>>>>>>
>>>>>>>>>    // CREATE CLIENT INSTANCES
>>>>>>>>>
>>>>>>>>>    MailClient redClient = new MailClient("red@smo.tld","red"**
>>>>>>>>> ******,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "192.168.55.119");
>>>>>>>>>
>>>>>>>>>    MailClient greenClient = new MailClient("green@smo.tld",
>>>>>>>>> "green",
>>>>>>>>> "192.168.55.119");
>>>>>>>>>
>>>>>>>>>    MailClient blueClient = new MailClient("blue@smo.tld","*******
>>>>>>>>>
>>>>>>>>> *blue",
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "192.168.55.119");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    // CLEAR EVERYBODY'S INBOX
>>>>>>>>>
>>>>>>>>>    redClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>
>>>>>>>>>    greenClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>
>>>>>>>>>    blueClient.checkInbox(********MailClient.CLEAR_MESSAGES);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>>
>>>>>>>>>    //redClient.********getPasswordAuthentication();
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    redClient.sendMessage(
>>>>>>>>>
>>>>>>>>>      "garvicee@h5sw.com",
>>>>>>>>>
>>>>>>>>>      "Testing blue from red",
>>>>>>>>>
>>>>>>>>>      "This is a test message");
>>>>>>>>>
>>>>>>>>>    //greenClient.********getPasswordAuthentication();
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    greenClient.sendMessage(
>>>>>>>>>
>>>>>>>>>      "blue@smo.tld",
>>>>>>>>>
>>>>>>>>>      "Testing blue from green",
>>>>>>>>>
>>>>>>>>>      "This is a test message");
>>>>>>>>>
>>>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>>
>>>>>>>>>    blueClient.checkInbox(********MailClient.SHOW_AND_CLEAR);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  }
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here is the output from the console
>>>>>>>>>
>>>>>>>>>  Exception in thread "main" javax.mail.********
>>>>>>>>> SendFailedException:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Invalid
>>>>>>>>> Addresses;
>>>>>>>>>
>>>>>>>>>  nested exception is:
>>>>>>>>>
>>>>>>>>> com.sun.mail.smtp.********SMTPAddressFailedException: 530 5.7.1
>>>>>>>>> Authentication
>>>>>>>>> Required
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>
>>>>>>>>> at com.sun.mail.smtp.********SMTPTransport.sendMessage(**
>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>
>>>>>>>>> at javax.mail.Transport.send0(********Transport.java:195)
>>>>>>>>>
>>>>>>>>> at javax.mail.Transport.send(********Transport.java:124)
>>>>>>>>>
>>>>>>>>> at MailClient.sendMessage(********MailClient.java:55)
>>>>>>>>>
>>>>>>>>> at JamesConfigTest.main(********JamesConfigTest.java:20)
>>>>>>>>>
>>>>>>>>> Caused by: com.sun.mail.smtp.********SMTPAddressFailedException:
>>>>>>>>> 530
>>>>>>>>> 5.7.1
>>>>>>>>> Authentication Required
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ... 5 more
>>>>>>>>>
>>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>
>>>>>>>>>  established
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>> org.apache.james.smtpserver.**********AuthRequiredToRelayRcptHook:
>>>>>>>>>
>>>>>>>>> result=2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> (DENY)
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 530
>>>>>>>>> [5.7.1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Authentication
>>>>>>>>> Required]
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>> closed
>>>>>>>>> for
>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Here is the SMTP:
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>>
>>>>>>>>>  established
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>>> org.apache.james.smtpserver.**********AuthRequiredToRelayRcptHook:
>>>>>>>>>
>>>>>>>>> result=2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> (DENY)
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 530
>>>>>>>>> [5.7.1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Authentication
>>>>>>>>> Required]
>>>>>>>>>
>>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>>> closed
>>>>>>>>> for
>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>>
>>>>>>>>> I get this error message:
>>>>>>>>>
>>>>>>>>> Exception in thread "main" javax.mail.********SendFailedException:
>>>>>>>>>
>>>>>>>>> Invalid
>>>>>>>>> Addresses;
>>>>>>>>>
>>>>>>>>>  nested exception is:
>>>>>>>>>
>>>>>>>>> com.sun.mail.smtp.********SMTPAddressFailedException: 503 5.7.1
>>>>>>>>>
>>>>>>>>> Incorrect
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Authentication for Specified Email Address
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>>
>>>>>>>>> at com.sun.mail.smtp.********SMTPTransport.sendMessage(**
>>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>>
>>>>>>>>> at javax.mail.Transport.send0(********Transport.java:195)
>>>>>>>>>
>>>>>>>>> at javax.mail.Transport.send(********Transport.java:124)
>>>>>>>>>
>>>>>>>>> at MailClient.sendMessage(********MailClient.java:55)
>>>>>>>>>
>>>>>>>>> at JamesConfigTest.main(********JamesConfigTest.java:20)
>>>>>>>>>
>>>>>>>>> Caused by: com.sun.mail.smtp.********SMTPAddressFailedException:
>>>>>>>>> 503
>>>>>>>>> 5.7.1
>>>>>>>>>
>>>>>>>>>  Incorrect
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  Authentication for Specified Email Address
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>>  at com.sun.mail.smtp.********SMTPTransport.rcptTo(****
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ... 5 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> With these Logfiles:
>>>>>>>>>
>>>>>>>>> SMTPServer.log
>>>>>>>>>
>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>
>>>>>>>>>  established
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>> org.apache.james.smtpserver.************
>>>>>>>>> SenderAuthIdentifyVerification****
>>>>>>>>> **
>>>>>>>>> **RcptHook:
>>>>>>>>>
>>>>>>>>>  result=2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  (DENY)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 503
>>>>>>>>> [5.7.1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Incorrect
>>>>>>>>>
>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>
>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>> closed
>>>>>>>>> for
>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>> James-Server.log
>>>>>>>>>
>>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>>
>>>>>>>>>  established
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>>> org.apache.james.smtpserver.************
>>>>>>>>> SenderAuthIdentifyVerification****
>>>>>>>>> **
>>>>>>>>> **RcptHook:
>>>>>>>>>
>>>>>>>>>  result=2
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  (DENY)
>>>>>>>>
>>>>>>>>
>>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>>> org.apache.james.smtpserver.********JamesRcptCmdHandler: 503
>>>>>>>>> [5.7.1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Incorrect
>>>>>>>>>
>>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>>
>>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>>> closed
>>>>>>>>> for
>>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Any help with this would be great. I'm not really sure what I"m
>>>>>>>>> doing
>>>>>>>>>
>>>>>>>>>  wrong.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>  I don't know if it's a setting in james or a property I need to set
>>>>>>>> in
>>>>>>>>
>>>>>>>>  JavaMail for the Transport.
>>>>>>>>>
>>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>>
>>>>>>>>> <smtpserver enabled="true">
>>>>>>>>>
>>>>>>>>>  <bind>0.0.0.0:25</bind>
>>>>>>>>>
>>>>>>>>>  <connectionBacklog>200</********connectionBacklog>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  <tls socketTLS="false" startTLS="false">
>>>>>>>>>
>>>>>>>>>  </tls>
>>>>>>>>>
>>>>>>>>>  <connectiontimeout>360</********connectiontimeout>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  <connectionLimit>     0</connectionLimit>
>>>>>>>>>
>>>>>>>>>  <connectionLimitPerIP>     0</connectionLimitPerIP>
>>>>>>>>>
>>>>>>>>>  <authorizedAddresses>127.0.0.********0/8<http://127.0.0.0/8>
>>>>>>>>> </authorizedAddresses>
>>>>>>>>>
>>>>>>>>>  <authRequired>false</********authRequired>
>>>>>>>>>
>>>>>>>>>  <verifyIdentity>false</********verifyIdentity>
>>>>>>>>>
>>>>>>>>>  <maxmessagesize>0</********maxmessagesize>
>>>>>>>>>
>>>>>>>>>  <addressBracketsEnforcement>********true</******
>>>>>>>>>
>>>>>>>>> addressBracketsEnforcement>
>>>>>>>>>
>>>>>>>>>  <handlerchain enableJmx="true">
>>>>>>>>>
>>>>>>>>>    <handler
>>>>>>>>>
>>>>>>>>>  class="org.apache.james.********smtpserver.fastfail.****
>>>>>>>>>
>>>>>>>>>  ValidRcptHandler"/>
>>>>>>>>
>>>>>>>>
>>>>>>>>     <handler class="org.apache.james.********smtpserver.**
>>>>>>>>
>>>>>>>>  CoreCmdHandlerLoader"/>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  </handlerchain>
>>>>>>>>>
>>>>>>>>> </smtpserver>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   --
>>>>>>>>>
>>>>>>>>
>>>>>>>>  Eric
>>>>>>> http://about.echarles.net
>>>>>>>
>>>>>>> ------------------------------********------------------------**
>>>>>>> --**--**
>>>>>>> --**---------
>>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.********
>>>>>>> apache.org
>>>>>>> <
>>>>>>> server-user-**unsubscribe@**ja**mes.apache.org<http://james.apache.org>
>>>>>>> <unsubscribe@**james.apache.org <un...@james.apache.org>>
>>>>>>>
>>>>>>> <se...@james.apache.org>
>>>>>>> <se...@james.apache.org>
>>>>>>> >
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>>>>> **
>>>>>>>>
>>>>>>> ****org<
>>>>>>> server-user-help@james.****apach**e.org<http://apache.org**><
>>>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>> >
>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   --
>>>>>>
>>>>> Eric
>>>>> http://about.echarles.net
>>>>>
>>>>> ------------------------------******--------------------------**--**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>> <
>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>> <se...@james.apache.org>
>>>>> >
>>>>>
>>>>>>
>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>> ****org<
>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>> >>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>  --
>>> Eric
>>> http://about.echarles.net
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>> >
>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>> server-user-help@james.**apache.org <se...@james.apache.org>>
>>>
>>>
>>>
>>
> --
> Eric
> http://about.echarles.net
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@apache.org>.
H Garvice,

If you can send from your mail client to external mails, you must ensure 
your java client sends the needed credentials.

 From the initial mail, I see that you have commented the mail.smtp.auth 
line:
//props.put("mail.smtp.auth", "true");

Can you try after uncommenting that line.

Thx,

Eric

On 19/10/11 17:23, Garvice Eakins wrote:
> But my original question still stands. Why am I getting an authentication
> error from James when I try and send emails to an external email from my
> Java app?
> What part am I missing, I authenticated before I checked for message, and
> that works fine but not send as it does when I send internal emails.
>
> ~Garvice
>
> On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
> <er...@u-mangate.com>wrote:
>
>> Glad it is now OK.
>> Thx,
>> Eric
>>
>>
>> On 19/10/11 01:30, Garvice Eakins wrote:
>>
>>> Eric,
>>>
>>> Ok I have attached an email client to the James Server (Apple Mail) I can
>>> send emails to internal addresses on the same domain, and I can send
>>> external emails as well.
>>> Using the Java Program I submitted earlier I can send internal emails,
>>> retrieve and print them to console. I can also view these emails using the
>>> mail client.
>>> I can also use the mail client to send internal emails. (Internal to  the
>>> james server)
>>>
>>> ~Garvice
>>>
>>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>>> <er...@u-mangate.com>**wrote:
>>>
>>>   You simply have to define a new email account in your favorite mail
>>>> client
>>>> with the username/password/host you have in James.
>>>>
>>>> Eric
>>>>
>>>>
>>>>
>>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>>
>>>>   no I have not used thunderbird or any other standard mail client, not
>>>>> really
>>>>> sure even how to do that.
>>>>> I will search the site and see if I can find an example. If you could
>>>>> provide a link to one that would be great!
>>>>> I really am going blindly into this as I have almost zero knowledge
>>>>> about
>>>>> mail servers.
>>>>>
>>>>> ~Garvice
>>>>>
>>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>>> <er...@u-mangate.com>****wrote:
>>>>>
>>>>>   Hi,
>>>>>
>>>>>> What Norman says + did you try from a standard mail client such as
>>>>>> thunderbird to test the server conf?
>>>>>> thx,
>>>>>> Eric
>>>>>>
>>>>>>
>>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>>
>>>>>>   Hi there,
>>>>>>
>>>>>>>
>>>>>>> what exact version you are using? also are you sure the recipients
>>>>>>> exist
>>>>>>> at
>>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>>> smtpserver?
>>>>>>>
>>>>>>> bye
>>>>>>> norman
>>>>>>>
>>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>>> garviceeakins@gmail.com
>>>>>>>
>>>>>>>   :
>>>>>>>
>>>>>>>> I am having problems sending SMTP messages from James3.0 using a
>>>>>>>> simple
>>>>>>>>
>>>>>>>>   java
>>>>>>>>
>>>>>>>
>>>>>>>   application using javamail.
>>>>>>>
>>>>>>>>
>>>>>>>> Here is the example I am using
>>>>>>>>
>>>>>>>> public class MailClient
>>>>>>>>
>>>>>>>>   extends Authenticator{
>>>>>>>>
>>>>>>>>   public static final int SHOW_MESSAGES = 1;
>>>>>>>>
>>>>>>>>   public static final int CLEAR_MESSAGES = 2;
>>>>>>>>
>>>>>>>>   public static final int SHOW_AND_CLEAR =
>>>>>>>>
>>>>>>>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>>
>>>>>>>>   protected String from;
>>>>>>>>
>>>>>>>>   protected Session session;
>>>>>>>>
>>>>>>>>   protected PasswordAuthentication authentication;
>>>>>>>>
>>>>>>>>
>>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>>
>>>>>>>>     this(user, pass, host, false);
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>>   public MailClient(String user, String pass, String host, boolean
>>>>>>>> debug){
>>>>>>>>
>>>>>>>>     from = user + '@' + host;
>>>>>>>>
>>>>>>>>     authentication = new PasswordAuthentication(user, pass);
>>>>>>>>
>>>>>>>>     Properties props = new Properties();
>>>>>>>>
>>>>>>>>     props.put("mail.user", user);
>>>>>>>>
>>>>>>>>     props.put("mail.host", host);
>>>>>>>>
>>>>>>>>     props.put("mail.debug", debug ? "true" : "false");
>>>>>>>>
>>>>>>>>     props.put("mail.store.******protocol", "pop3");
>>>>>>>>
>>>>>>>>     props.put("mail.transport.******protocol", "smtp");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     //props.put("mail.smtp.auth", "true");
>>>>>>>>
>>>>>>>>     session = Session.getInstance(props, this);
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>>
>>>>>>>>     return authentication;
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   public void sendMessage(
>>>>>>>>
>>>>>>>>     String to, String subject, String content)
>>>>>>>>
>>>>>>>>       throws MessagingException
>>>>>>>>
>>>>>>>>   {
>>>>>>>>
>>>>>>>>     System.out.println("SENDING message from " + from + " to " + to);
>>>>>>>>
>>>>>>>>     System.out.println();
>>>>>>>>
>>>>>>>>     MimeMessage msg = new MimeMessage(session);
>>>>>>>>
>>>>>>>>     msg.setFrom(new InternetAddress(from));
>>>>>>>>
>>>>>>>>     msg.addRecipients(Message.******RecipientType.TO<http://**
>>>>>>>> Message.RecipientType.TO<http:**//Message.RecipientType.TO<http://Message.RecipientType.TO>
>>>>>>>>>> ,
>>>>>>>>
>>>>>>>>
>>>>>>>> to);
>>>>>>>>
>>>>>>>>     msg.setSubject(subject);
>>>>>>>>
>>>>>>>>     msg.setText(content);
>>>>>>>>
>>>>>>>>     Transport.send(msg);
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   public void checkInbox(int mode)
>>>>>>>>
>>>>>>>>     throws MessagingException, IOException
>>>>>>>>
>>>>>>>>   {
>>>>>>>>
>>>>>>>>     if (mode == 0) return;
>>>>>>>>
>>>>>>>>     boolean show = (mode&     SHOW_MESSAGES)>     0;
>>>>>>>>
>>>>>>>>     boolean clear = (mode&     CLEAR_MESSAGES)>     0;
>>>>>>>>
>>>>>>>>
>>>>>>>>     String action =
>>>>>>>>
>>>>>>>>       (show ? "Show" : "") +
>>>>>>>>
>>>>>>>>       (show&&     clear ? " and " : "") +
>>>>>>>>
>>>>>>>>
>>>>>>>>       (clear ? "Clear" : "");
>>>>>>>>
>>>>>>>>     System.out.println(action + " INBOX for " + from);
>>>>>>>>
>>>>>>>>     Store store = session.getStore();
>>>>>>>>
>>>>>>>>     store.connect();
>>>>>>>>
>>>>>>>>     Folder root = store.getDefaultFolder();
>>>>>>>>
>>>>>>>>     Folder inbox = root.getFolder("inbox");
>>>>>>>>
>>>>>>>>     inbox.open(Folder.READ_WRITE);
>>>>>>>>
>>>>>>>>     Message[] msgs = inbox.getMessages();
>>>>>>>>
>>>>>>>>     if (msgs.length == 0&&     show)
>>>>>>>>
>>>>>>>>
>>>>>>>>     {
>>>>>>>>
>>>>>>>>       System.out.println("No messages in inbox");
>>>>>>>>
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     for (int i = 0; i<     msgs.length; i++)
>>>>>>>>
>>>>>>>>     {
>>>>>>>>
>>>>>>>>       MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>>
>>>>>>>>       if (show)
>>>>>>>>
>>>>>>>>       {
>>>>>>>>
>>>>>>>>         System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>>
>>>>>>>>         System.out.println(" Subject: " + msg.getSubject());
>>>>>>>>
>>>>>>>>         System.out.println(" Content: " + msg.getContent());
>>>>>>>>
>>>>>>>>       }
>>>>>>>>
>>>>>>>>       if (clear)
>>>>>>>>
>>>>>>>>       {
>>>>>>>>
>>>>>>>>         msg.setFlag(Flags.Flag.******DELETED, true);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>       }
>>>>>>>>
>>>>>>>>     }
>>>>>>>>
>>>>>>>>     inbox.close(true);
>>>>>>>>
>>>>>>>>     store.close();
>>>>>>>>
>>>>>>>>     System.out.println();
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> public class JamesConfigTest
>>>>>>>>
>>>>>>>> {
>>>>>>>>
>>>>>>>>   public static void main(String[] args)
>>>>>>>>
>>>>>>>>     throws Exception
>>>>>>>>
>>>>>>>>   {
>>>>>>>>
>>>>>>>>     // CREATE CLIENT INSTANCES
>>>>>>>>
>>>>>>>>     MailClient redClient = new MailClient("red@smo.tld","red"******,
>>>>>>>>
>>>>>>>>
>>>>>>>> "192.168.55.119");
>>>>>>>>
>>>>>>>>     MailClient greenClient = new MailClient("green@smo.tld", "green",
>>>>>>>> "192.168.55.119");
>>>>>>>>
>>>>>>>>     MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>>> *blue",
>>>>>>>>
>>>>>>>>
>>>>>>>> "192.168.55.119");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     // CLEAR EVERYBODY'S INBOX
>>>>>>>>
>>>>>>>>     redClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>>
>>>>>>>>     greenClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>>
>>>>>>>>     blueClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>>
>>>>>>>>     //redClient.******getPasswordAuthentication();
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     redClient.sendMessage(
>>>>>>>>
>>>>>>>>       "garvicee@h5sw.com",
>>>>>>>>
>>>>>>>>       "Testing blue from red",
>>>>>>>>
>>>>>>>>       "This is a test message");
>>>>>>>>
>>>>>>>>     //greenClient.******getPasswordAuthentication();
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     greenClient.sendMessage(
>>>>>>>>
>>>>>>>>       "blue@smo.tld",
>>>>>>>>
>>>>>>>>       "Testing blue from green",
>>>>>>>>
>>>>>>>>       "This is a test message");
>>>>>>>>
>>>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>>
>>>>>>>>     blueClient.checkInbox(******MailClient.SHOW_AND_CLEAR);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   }
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is the output from the console
>>>>>>>>
>>>>>>>>   Exception in thread "main" javax.mail.******SendFailedException:
>>>>>>>>
>>>>>>>> Invalid
>>>>>>>> Addresses;
>>>>>>>>
>>>>>>>>   nested exception is:
>>>>>>>>
>>>>>>>> com.sun.mail.smtp.******SMTPAddressFailedException: 530 5.7.1
>>>>>>>> Authentication
>>>>>>>> Required
>>>>>>>>
>>>>>>>>
>>>>>>>>   at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>
>>>>>>>> at com.sun.mail.smtp.******SMTPTransport.sendMessage(**
>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>
>>>>>>>> at javax.mail.Transport.send0(******Transport.java:195)
>>>>>>>>
>>>>>>>> at javax.mail.Transport.send(******Transport.java:124)
>>>>>>>>
>>>>>>>> at MailClient.sendMessage(******MailClient.java:55)
>>>>>>>>
>>>>>>>> at JamesConfigTest.main(******JamesConfigTest.java:20)
>>>>>>>>
>>>>>>>> Caused by: com.sun.mail.smtp.******SMTPAddressFailedException: 530
>>>>>>>> 5.7.1
>>>>>>>> Authentication Required
>>>>>>>>
>>>>>>>>
>>>>>>>>   at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>>
>>>>>>>> SMTPTransport.java:1733)
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 5 more
>>>>>>>>
>>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>>
>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>
>>>>>>>>   established
>>>>>>>>
>>>>>>>
>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>> org.apache.james.smtpserver.******AuthRequiredToRelayRcptHook:
>>>>>>>> result=2
>>>>>>>>
>>>>>>>>
>>>>>>>> (DENY)
>>>>>>>>
>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 530 [5.7.1
>>>>>>>>
>>>>>>>>
>>>>>>>> Authentication
>>>>>>>> Required]
>>>>>>>>
>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>> closed
>>>>>>>> for
>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>> Here is the SMTP:
>>>>>>>>
>>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>>
>>>>>>>>   established
>>>>>>>>
>>>>>>>
>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>>> org.apache.james.smtpserver.******AuthRequiredToRelayRcptHook:
>>>>>>>> result=2
>>>>>>>>
>>>>>>>>
>>>>>>>> (DENY)
>>>>>>>>
>>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 530 [5.7.1
>>>>>>>>
>>>>>>>>
>>>>>>>> Authentication
>>>>>>>> Required]
>>>>>>>>
>>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>>> closed
>>>>>>>> for
>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>>
>>>>>>>> I get this error message:
>>>>>>>>
>>>>>>>> Exception in thread "main" javax.mail.******SendFailedException:
>>>>>>>> Invalid
>>>>>>>> Addresses;
>>>>>>>>
>>>>>>>>   nested exception is:
>>>>>>>>
>>>>>>>> com.sun.mail.smtp.******SMTPAddressFailedException: 503 5.7.1
>>>>>>>> Incorrect
>>>>>>>>
>>>>>>>>
>>>>>>>> Authentication for Specified Email Address
>>>>>>>>
>>>>>>>>
>>>>>>>>   at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>> SMTPTransport.java:1835)
>>>>>>>>
>>>>>>>> at com.sun.mail.smtp.******SMTPTransport.sendMessage(**
>>>>>>>> SMTPTransport.java:1098)
>>>>>>>>
>>>>>>>> at javax.mail.Transport.send0(******Transport.java:195)
>>>>>>>>
>>>>>>>> at javax.mail.Transport.send(******Transport.java:124)
>>>>>>>>
>>>>>>>> at MailClient.sendMessage(******MailClient.java:55)
>>>>>>>>
>>>>>>>> at JamesConfigTest.main(******JamesConfigTest.java:20)
>>>>>>>>
>>>>>>>> Caused by: com.sun.mail.smtp.******SMTPAddressFailedException: 503
>>>>>>>> 5.7.1
>>>>>>>>
>>>>>>>>   Incorrect
>>>>>>>>
>>>>>>>
>>>>>>>   Authentication for Specified Email Address
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>>
>>>>>>>> SMTPTransport.java:1686)
>>>>>>>>
>>>>>>>>
>>>>>>>> ... 5 more
>>>>>>>>
>>>>>>>>
>>>>>>>> With these Logfiles:
>>>>>>>>
>>>>>>>> SMTPServer.log
>>>>>>>>
>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>
>>>>>>>>   established
>>>>>>>>
>>>>>>>
>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>> org.apache.james.smtpserver.********SenderAuthIdentifyVerification**
>>>>>>>> **
>>>>>>>> **RcptHook:
>>>>>>>>
>>>>>>>>   result=2
>>>>>>>>
>>>>>>>
>>>>>>>   (DENY)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 503 [5.7.1
>>>>>>>>
>>>>>>>> Incorrect
>>>>>>>>
>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>
>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>> closed
>>>>>>>> for
>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>> James-Server.log
>>>>>>>>
>>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>>
>>>>>>>>   established
>>>>>>>>
>>>>>>>
>>>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>>> org.apache.james.smtpserver.********SenderAuthIdentifyVerification**
>>>>>>>> **
>>>>>>>> **RcptHook:
>>>>>>>>
>>>>>>>>   result=2
>>>>>>>>
>>>>>>>
>>>>>>>   (DENY)
>>>>>>>
>>>>>>>>
>>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 503 [5.7.1
>>>>>>>>
>>>>>>>> Incorrect
>>>>>>>>
>>>>>>>> Authentication for Specified Email Address]
>>>>>>>>
>>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>>> closed
>>>>>>>> for
>>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>>
>>>>>>>>
>>>>>>>> Any help with this would be great. I'm not really sure what I"m doing
>>>>>>>>
>>>>>>>>   wrong.
>>>>>>>>
>>>>>>>
>>>>>>>   I don't know if it's a setting in james or a property I need to set
>>>>>>> in
>>>>>>>
>>>>>>>> JavaMail for the Transport.
>>>>>>>>
>>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>>
>>>>>>>> <smtpserver enabled="true">
>>>>>>>>
>>>>>>>>   <bind>0.0.0.0:25</bind>
>>>>>>>>
>>>>>>>>   <connectionBacklog>200</******connectionBacklog>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   <tls socketTLS="false" startTLS="false">
>>>>>>>>
>>>>>>>>   </tls>
>>>>>>>>
>>>>>>>>   <connectiontimeout>360</******connectiontimeout>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   <connectionLimit>     0</connectionLimit>
>>>>>>>>
>>>>>>>>   <connectionLimitPerIP>     0</connectionLimitPerIP>
>>>>>>>>
>>>>>>>>   <authorizedAddresses>127.0.0.******0/8<http://127.0.0.0/8>
>>>>>>>> </authorizedAddresses>
>>>>>>>>
>>>>>>>>   <authRequired>false</******authRequired>
>>>>>>>>
>>>>>>>>   <verifyIdentity>false</******verifyIdentity>
>>>>>>>>
>>>>>>>>   <maxmessagesize>0</******maxmessagesize>
>>>>>>>>
>>>>>>>>   <addressBracketsEnforcement>******true</******
>>>>>>>> addressBracketsEnforcement>
>>>>>>>>
>>>>>>>>   <handlerchain enableJmx="true">
>>>>>>>>
>>>>>>>>     <handler
>>>>>>>>
>>>>>>>>   class="org.apache.james.******smtpserver.fastfail.****
>>>>>>>>
>>>>>>> ValidRcptHandler"/>
>>>>>>>
>>>>>>>
>>>>>>>      <handler class="org.apache.james.******smtpserver.**
>>>>>>>> CoreCmdHandlerLoader"/>
>>>>>>>>
>>>>>>>>
>>>>>>>>   </handlerchain>
>>>>>>>>
>>>>>>>> </smtpserver>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>    --
>>>>>>>
>>>>>> Eric
>>>>>> http://about.echarles.net
>>>>>>
>>>>>> ------------------------------******--------------------------**--**
>>>>>> --**---------
>>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>>> <
>>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>>> <se...@james.apache.org>
>>>>>>>
>>>>>>
>>>>>>>
>>>>>>>   For additional commands, e-mail: server-user-help@james.apache.**
>>>>>> ****org<
>>>>>> server-user-help@james.**apach**e.org<http://apache.org><
>>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>   --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>>
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org<se...@james.apache.org>>
>>>>
>>>>
>>>>
>>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
But my original question still stands. Why am I getting an authentication
error from James when I try and send emails to an external email from my
Java app?
What part am I missing, I authenticated before I checked for message, and
that works fine but not send as it does when I send internal emails.

~Garvice

On Tue, Oct 18, 2011 at 11:12 PM, Eric Charles
<er...@u-mangate.com>wrote:

> Glad it is now OK.
> Thx,
> Eric
>
>
> On 19/10/11 01:30, Garvice Eakins wrote:
>
>> Eric,
>>
>> Ok I have attached an email client to the James Server (Apple Mail) I can
>> send emails to internal addresses on the same domain, and I can send
>> external emails as well.
>> Using the Java Program I submitted earlier I can send internal emails,
>> retrieve and print them to console. I can also view these emails using the
>> mail client.
>> I can also use the mail client to send internal emails. (Internal to  the
>> james server)
>>
>> ~Garvice
>>
>> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
>> <er...@u-mangate.com>**wrote:
>>
>>  You simply have to define a new email account in your favorite mail
>>> client
>>> with the username/password/host you have in James.
>>>
>>> Eric
>>>
>>>
>>>
>>> On 17/10/11 21:58, Garvice Eakins wrote:
>>>
>>>  no I have not used thunderbird or any other standard mail client, not
>>>> really
>>>> sure even how to do that.
>>>> I will search the site and see if I can find an example. If you could
>>>> provide a link to one that would be great!
>>>> I really am going blindly into this as I have almost zero knowledge
>>>> about
>>>> mail servers.
>>>>
>>>> ~Garvice
>>>>
>>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>>> <er...@u-mangate.com>****wrote:
>>>>
>>>>  Hi,
>>>>
>>>>> What Norman says + did you try from a standard mail client such as
>>>>> thunderbird to test the server conf?
>>>>> thx,
>>>>> Eric
>>>>>
>>>>>
>>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>>
>>>>>  Hi there,
>>>>>
>>>>>>
>>>>>> what exact version you are using? also are you sure the recipients
>>>>>> exist
>>>>>> at
>>>>>> the james server or do you try to deliver the mailmto a remote
>>>>>> smtpserver?
>>>>>>
>>>>>> bye
>>>>>> norman
>>>>>>
>>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>>> garviceeakins@gmail.com
>>>>>>
>>>>>>  :
>>>>>>
>>>>>>> I am having problems sending SMTP messages from James3.0 using a
>>>>>>> simple
>>>>>>>
>>>>>>>  java
>>>>>>>
>>>>>>
>>>>>>  application using javamail.
>>>>>>
>>>>>>>
>>>>>>> Here is the example I am using
>>>>>>>
>>>>>>> public class MailClient
>>>>>>>
>>>>>>>  extends Authenticator{
>>>>>>>
>>>>>>>  public static final int SHOW_MESSAGES = 1;
>>>>>>>
>>>>>>>  public static final int CLEAR_MESSAGES = 2;
>>>>>>>
>>>>>>>  public static final int SHOW_AND_CLEAR =
>>>>>>>
>>>>>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>>
>>>>>>>  protected String from;
>>>>>>>
>>>>>>>  protected Session session;
>>>>>>>
>>>>>>>  protected PasswordAuthentication authentication;
>>>>>>>
>>>>>>>
>>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>>
>>>>>>>    this(user, pass, host, false);
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>>  public MailClient(String user, String pass, String host, boolean
>>>>>>> debug){
>>>>>>>
>>>>>>>    from = user + '@' + host;
>>>>>>>
>>>>>>>    authentication = new PasswordAuthentication(user, pass);
>>>>>>>
>>>>>>>    Properties props = new Properties();
>>>>>>>
>>>>>>>    props.put("mail.user", user);
>>>>>>>
>>>>>>>    props.put("mail.host", host);
>>>>>>>
>>>>>>>    props.put("mail.debug", debug ? "true" : "false");
>>>>>>>
>>>>>>>    props.put("mail.store.******protocol", "pop3");
>>>>>>>
>>>>>>>    props.put("mail.transport.******protocol", "smtp");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    //props.put("mail.smtp.auth", "true");
>>>>>>>
>>>>>>>    session = Session.getInstance(props, this);
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  public PasswordAuthentication getPasswordAuthentication(){
>>>>>>>
>>>>>>>    return authentication;
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  public void sendMessage(
>>>>>>>
>>>>>>>    String to, String subject, String content)
>>>>>>>
>>>>>>>      throws MessagingException
>>>>>>>
>>>>>>>  {
>>>>>>>
>>>>>>>    System.out.println("SENDING message from " + from + " to " + to);
>>>>>>>
>>>>>>>    System.out.println();
>>>>>>>
>>>>>>>    MimeMessage msg = new MimeMessage(session);
>>>>>>>
>>>>>>>    msg.setFrom(new InternetAddress(from));
>>>>>>>
>>>>>>>    msg.addRecipients(Message.******RecipientType.TO<http://**
>>>>>>> Message.RecipientType.TO<http:**//Message.RecipientType.TO<http://Message.RecipientType.TO>
>>>>>>> >>,
>>>>>>>
>>>>>>>
>>>>>>> to);
>>>>>>>
>>>>>>>    msg.setSubject(subject);
>>>>>>>
>>>>>>>    msg.setText(content);
>>>>>>>
>>>>>>>    Transport.send(msg);
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  public void checkInbox(int mode)
>>>>>>>
>>>>>>>    throws MessagingException, IOException
>>>>>>>
>>>>>>>  {
>>>>>>>
>>>>>>>    if (mode == 0) return;
>>>>>>>
>>>>>>>    boolean show = (mode&    SHOW_MESSAGES)>    0;
>>>>>>>
>>>>>>>    boolean clear = (mode&    CLEAR_MESSAGES)>    0;
>>>>>>>
>>>>>>>
>>>>>>>    String action =
>>>>>>>
>>>>>>>      (show ? "Show" : "") +
>>>>>>>
>>>>>>>      (show&&    clear ? " and " : "") +
>>>>>>>
>>>>>>>
>>>>>>>      (clear ? "Clear" : "");
>>>>>>>
>>>>>>>    System.out.println(action + " INBOX for " + from);
>>>>>>>
>>>>>>>    Store store = session.getStore();
>>>>>>>
>>>>>>>    store.connect();
>>>>>>>
>>>>>>>    Folder root = store.getDefaultFolder();
>>>>>>>
>>>>>>>    Folder inbox = root.getFolder("inbox");
>>>>>>>
>>>>>>>    inbox.open(Folder.READ_WRITE);
>>>>>>>
>>>>>>>    Message[] msgs = inbox.getMessages();
>>>>>>>
>>>>>>>    if (msgs.length == 0&&    show)
>>>>>>>
>>>>>>>
>>>>>>>    {
>>>>>>>
>>>>>>>      System.out.println("No messages in inbox");
>>>>>>>
>>>>>>>    }
>>>>>>>
>>>>>>>    for (int i = 0; i<    msgs.length; i++)
>>>>>>>
>>>>>>>    {
>>>>>>>
>>>>>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>>
>>>>>>>      if (show)
>>>>>>>
>>>>>>>      {
>>>>>>>
>>>>>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>>
>>>>>>>        System.out.println(" Subject: " + msg.getSubject());
>>>>>>>
>>>>>>>        System.out.println(" Content: " + msg.getContent());
>>>>>>>
>>>>>>>      }
>>>>>>>
>>>>>>>      if (clear)
>>>>>>>
>>>>>>>      {
>>>>>>>
>>>>>>>        msg.setFlag(Flags.Flag.******DELETED, true);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>      }
>>>>>>>
>>>>>>>    }
>>>>>>>
>>>>>>>    inbox.close(true);
>>>>>>>
>>>>>>>    store.close();
>>>>>>>
>>>>>>>    System.out.println();
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> public class JamesConfigTest
>>>>>>>
>>>>>>> {
>>>>>>>
>>>>>>>  public static void main(String[] args)
>>>>>>>
>>>>>>>    throws Exception
>>>>>>>
>>>>>>>  {
>>>>>>>
>>>>>>>    // CREATE CLIENT INSTANCES
>>>>>>>
>>>>>>>    MailClient redClient = new MailClient("red@smo.tld","red"******,
>>>>>>>
>>>>>>>
>>>>>>> "192.168.55.119");
>>>>>>>
>>>>>>>    MailClient greenClient = new MailClient("green@smo.tld", "green",
>>>>>>> "192.168.55.119");
>>>>>>>
>>>>>>>    MailClient blueClient = new MailClient("blue@smo.tld","*****
>>>>>>> *blue",
>>>>>>>
>>>>>>>
>>>>>>> "192.168.55.119");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    // CLEAR EVERYBODY'S INBOX
>>>>>>>
>>>>>>>    redClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>
>>>>>>>    greenClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>
>>>>>>>    blueClient.checkInbox(******MailClient.CLEAR_MESSAGES);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>>
>>>>>>>    //redClient.******getPasswordAuthentication();
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    redClient.sendMessage(
>>>>>>>
>>>>>>>      "garvicee@h5sw.com",
>>>>>>>
>>>>>>>      "Testing blue from red",
>>>>>>>
>>>>>>>      "This is a test message");
>>>>>>>
>>>>>>>    //greenClient.******getPasswordAuthentication();
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    greenClient.sendMessage(
>>>>>>>
>>>>>>>      "blue@smo.tld",
>>>>>>>
>>>>>>>      "Testing blue from green",
>>>>>>>
>>>>>>>      "This is a test message");
>>>>>>>
>>>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>>
>>>>>>>    blueClient.checkInbox(******MailClient.SHOW_AND_CLEAR);
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  }
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Here is the output from the console
>>>>>>>
>>>>>>>  Exception in thread "main" javax.mail.******SendFailedException:
>>>>>>>
>>>>>>> Invalid
>>>>>>> Addresses;
>>>>>>>
>>>>>>>  nested exception is:
>>>>>>>
>>>>>>> com.sun.mail.smtp.******SMTPAddressFailedException: 530 5.7.1
>>>>>>> Authentication
>>>>>>> Required
>>>>>>>
>>>>>>>
>>>>>>>  at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>> SMTPTransport.java:1835)
>>>>>>>
>>>>>>> at com.sun.mail.smtp.******SMTPTransport.sendMessage(**
>>>>>>> SMTPTransport.java:1098)
>>>>>>>
>>>>>>> at javax.mail.Transport.send0(******Transport.java:195)
>>>>>>>
>>>>>>> at javax.mail.Transport.send(******Transport.java:124)
>>>>>>>
>>>>>>> at MailClient.sendMessage(******MailClient.java:55)
>>>>>>>
>>>>>>> at JamesConfigTest.main(******JamesConfigTest.java:20)
>>>>>>>
>>>>>>> Caused by: com.sun.mail.smtp.******SMTPAddressFailedException: 530
>>>>>>> 5.7.1
>>>>>>> Authentication Required
>>>>>>>
>>>>>>>
>>>>>>>  at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>
>>>>>>> SMTPTransport.java:1733)
>>>>>>>
>>>>>>>
>>>>>>> ... 5 more
>>>>>>>
>>>>>>> Here is the output in the JamesServer.log:
>>>>>>>
>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>
>>>>>>>  established
>>>>>>>
>>>>>>
>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>> org.apache.james.smtpserver.******AuthRequiredToRelayRcptHook:
>>>>>>> result=2
>>>>>>>
>>>>>>>
>>>>>>> (DENY)
>>>>>>>
>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 530 [5.7.1
>>>>>>>
>>>>>>>
>>>>>>> Authentication
>>>>>>> Required]
>>>>>>>
>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>> closed
>>>>>>> for
>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>
>>>>>>> Here is the SMTP:
>>>>>>>
>>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>>
>>>>>>>  established
>>>>>>>
>>>>>>
>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>>> org.apache.james.smtpserver.******AuthRequiredToRelayRcptHook:
>>>>>>> result=2
>>>>>>>
>>>>>>>
>>>>>>> (DENY)
>>>>>>>
>>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 530 [5.7.1
>>>>>>>
>>>>>>>
>>>>>>> Authentication
>>>>>>> Required]
>>>>>>>
>>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection
>>>>>>> closed
>>>>>>> for
>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>
>>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>>
>>>>>>> I get this error message:
>>>>>>>
>>>>>>> Exception in thread "main" javax.mail.******SendFailedException:
>>>>>>> Invalid
>>>>>>> Addresses;
>>>>>>>
>>>>>>>  nested exception is:
>>>>>>>
>>>>>>> com.sun.mail.smtp.******SMTPAddressFailedException: 503 5.7.1
>>>>>>> Incorrect
>>>>>>>
>>>>>>>
>>>>>>> Authentication for Specified Email Address
>>>>>>>
>>>>>>>
>>>>>>>  at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>> SMTPTransport.java:1835)
>>>>>>>
>>>>>>> at com.sun.mail.smtp.******SMTPTransport.sendMessage(**
>>>>>>> SMTPTransport.java:1098)
>>>>>>>
>>>>>>> at javax.mail.Transport.send0(******Transport.java:195)
>>>>>>>
>>>>>>> at javax.mail.Transport.send(******Transport.java:124)
>>>>>>>
>>>>>>> at MailClient.sendMessage(******MailClient.java:55)
>>>>>>>
>>>>>>> at JamesConfigTest.main(******JamesConfigTest.java:20)
>>>>>>>
>>>>>>> Caused by: com.sun.mail.smtp.******SMTPAddressFailedException: 503
>>>>>>> 5.7.1
>>>>>>>
>>>>>>>  Incorrect
>>>>>>>
>>>>>>
>>>>>>  Authentication for Specified Email Address
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  at com.sun.mail.smtp.******SMTPTransport.rcptTo(****
>>>>>>>
>>>>>>> SMTPTransport.java:1686)
>>>>>>>
>>>>>>>
>>>>>>> ... 5 more
>>>>>>>
>>>>>>>
>>>>>>> With these Logfiles:
>>>>>>>
>>>>>>> SMTPServer.log
>>>>>>>
>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>
>>>>>>>  established
>>>>>>>
>>>>>>
>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>> org.apache.james.smtpserver.********SenderAuthIdentifyVerification**
>>>>>>> **
>>>>>>> **RcptHook:
>>>>>>>
>>>>>>>  result=2
>>>>>>>
>>>>>>
>>>>>>  (DENY)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 503 [5.7.1
>>>>>>>
>>>>>>> Incorrect
>>>>>>>
>>>>>>> Authentication for Specified Email Address]
>>>>>>>
>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>> closed
>>>>>>> for
>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>> James-Server.log
>>>>>>>
>>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>>
>>>>>>>  established
>>>>>>>
>>>>>>
>>>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>>> org.apache.james.smtpserver.********SenderAuthIdentifyVerification**
>>>>>>> **
>>>>>>> **RcptHook:
>>>>>>>
>>>>>>>  result=2
>>>>>>>
>>>>>>
>>>>>>  (DENY)
>>>>>>
>>>>>>>
>>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>>> org.apache.james.smtpserver.******JamesRcptCmdHandler: 503 [5.7.1
>>>>>>>
>>>>>>> Incorrect
>>>>>>>
>>>>>>> Authentication for Specified Email Address]
>>>>>>>
>>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection
>>>>>>> closed
>>>>>>> for
>>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>>
>>>>>>>
>>>>>>> Any help with this would be great. I'm not really sure what I"m doing
>>>>>>>
>>>>>>>  wrong.
>>>>>>>
>>>>>>
>>>>>>  I don't know if it's a setting in james or a property I need to set
>>>>>> in
>>>>>>
>>>>>>> JavaMail for the Transport.
>>>>>>>
>>>>>>> Also here is the SMTPServer.xml file
>>>>>>>
>>>>>>> <smtpserver enabled="true">
>>>>>>>
>>>>>>>  <bind>0.0.0.0:25</bind>
>>>>>>>
>>>>>>>  <connectionBacklog>200</******connectionBacklog>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  <tls socketTLS="false" startTLS="false">
>>>>>>>
>>>>>>>  </tls>
>>>>>>>
>>>>>>>  <connectiontimeout>360</******connectiontimeout>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  <connectionLimit>    0</connectionLimit>
>>>>>>>
>>>>>>>  <connectionLimitPerIP>    0</connectionLimitPerIP>
>>>>>>>
>>>>>>>  <authorizedAddresses>127.0.0.******0/8<http://127.0.0.0/8>
>>>>>>> </authorizedAddresses>
>>>>>>>
>>>>>>>  <authRequired>false</******authRequired>
>>>>>>>
>>>>>>>  <verifyIdentity>false</******verifyIdentity>
>>>>>>>
>>>>>>>  <maxmessagesize>0</******maxmessagesize>
>>>>>>>
>>>>>>>  <addressBracketsEnforcement>******true</******
>>>>>>> addressBracketsEnforcement>
>>>>>>>
>>>>>>>  <handlerchain enableJmx="true">
>>>>>>>
>>>>>>>    <handler
>>>>>>>
>>>>>>>  class="org.apache.james.******smtpserver.fastfail.****
>>>>>>>
>>>>>> ValidRcptHandler"/>
>>>>>>
>>>>>>
>>>>>>     <handler class="org.apache.james.******smtpserver.**
>>>>>>> CoreCmdHandlerLoader"/>
>>>>>>>
>>>>>>>
>>>>>>>  </handlerchain>
>>>>>>>
>>>>>>> </smtpserver>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   --
>>>>>>
>>>>> Eric
>>>>> http://about.echarles.net
>>>>>
>>>>> ------------------------------******--------------------------**--**
>>>>> --**---------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.******apache.org
>>>>> <
>>>>> server-user-**unsubscribe@**james.apache.org<un...@james.apache.org>
>>>>> <se...@james.apache.org>
>>>>> >
>>>>>
>>>>>>
>>>>>>  For additional commands, e-mail: server-user-help@james.apache.**
>>>>> ****org<
>>>>> server-user-help@james.**apach**e.org <http://apache.org><
>>>>> server-user-help@james.**apache.org<se...@james.apache.org>
>>>>> >>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>  --
>>> Eric
>>> http://about.echarles.net
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>> >
>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>> server-user-help@james.**apache.org <se...@james.apache.org>>
>>>
>>>
>>>
>>
> --
> Eric
> http://about.echarles.net
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@u-mangate.com>.
Glad it is now OK.
Thx,
Eric

On 19/10/11 01:30, Garvice Eakins wrote:
> Eric,
>
> Ok I have attached an email client to the James Server (Apple Mail) I can
> send emails to internal addresses on the same domain, and I can send
> external emails as well.
> Using the Java Program I submitted earlier I can send internal emails,
> retrieve and print them to console. I can also view these emails using the
> mail client.
> I can also use the mail client to send internal emails. (Internal to  the
> james server)
>
> ~Garvice
>
> On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
> <er...@u-mangate.com>wrote:
>
>> You simply have to define a new email account in your favorite mail client
>> with the username/password/host you have in James.
>>
>> Eric
>>
>>
>>
>> On 17/10/11 21:58, Garvice Eakins wrote:
>>
>>> no I have not used thunderbird or any other standard mail client, not
>>> really
>>> sure even how to do that.
>>> I will search the site and see if I can find an example. If you could
>>> provide a link to one that would be great!
>>> I really am going blindly into this as I have almost zero knowledge about
>>> mail servers.
>>>
>>> ~Garvice
>>>
>>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>>> <er...@u-mangate.com>**wrote:
>>>
>>>   Hi,
>>>> What Norman says + did you try from a standard mail client such as
>>>> thunderbird to test the server conf?
>>>> thx,
>>>> Eric
>>>>
>>>>
>>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>>
>>>>   Hi there,
>>>>>
>>>>> what exact version you are using? also are you sure the recipients exist
>>>>> at
>>>>> the james server or do you try to deliver the mailmto a remote
>>>>> smtpserver?
>>>>>
>>>>> bye
>>>>> norman
>>>>>
>>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>>> garviceeakins@gmail.com
>>>>>
>>>>>   :
>>>>>> I am having problems sending SMTP messages from James3.0 using a simple
>>>>>>
>>>>>>   java
>>>>>
>>>>>   application using javamail.
>>>>>>
>>>>>> Here is the example I am using
>>>>>>
>>>>>> public class MailClient
>>>>>>
>>>>>>   extends Authenticator{
>>>>>>
>>>>>>   public static final int SHOW_MESSAGES = 1;
>>>>>>
>>>>>>   public static final int CLEAR_MESSAGES = 2;
>>>>>>
>>>>>>   public static final int SHOW_AND_CLEAR =
>>>>>>
>>>>>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>>
>>>>>>   protected String from;
>>>>>>
>>>>>>   protected Session session;
>>>>>>
>>>>>>   protected PasswordAuthentication authentication;
>>>>>>
>>>>>>
>>>>>> public MailClient(String user, String pass, String host)  {
>>>>>>
>>>>>>     this(user, pass, host, false);
>>>>>>
>>>>>>   }
>>>>>>
>>>>>>   public MailClient(String user, String pass, String host, boolean
>>>>>> debug){
>>>>>>
>>>>>>     from = user + '@' + host;
>>>>>>
>>>>>>     authentication = new PasswordAuthentication(user, pass);
>>>>>>
>>>>>>     Properties props = new Properties();
>>>>>>
>>>>>>     props.put("mail.user", user);
>>>>>>
>>>>>>     props.put("mail.host", host);
>>>>>>
>>>>>>     props.put("mail.debug", debug ? "true" : "false");
>>>>>>
>>>>>>     props.put("mail.store.****protocol", "pop3");
>>>>>>
>>>>>>     props.put("mail.transport.****protocol", "smtp");
>>>>>>
>>>>>>
>>>>>>     //props.put("mail.smtp.auth", "true");
>>>>>>
>>>>>>     session = Session.getInstance(props, this);
>>>>>>
>>>>>>   }
>>>>>>
>>>>>>
>>>>>>
>>>>>>   public PasswordAuthentication getPasswordAuthentication(){
>>>>>>
>>>>>>     return authentication;
>>>>>>
>>>>>>   }
>>>>>>
>>>>>>
>>>>>>
>>>>>>   public void sendMessage(
>>>>>>
>>>>>>     String to, String subject, String content)
>>>>>>
>>>>>>       throws MessagingException
>>>>>>
>>>>>>   {
>>>>>>
>>>>>>     System.out.println("SENDING message from " + from + " to " + to);
>>>>>>
>>>>>>     System.out.println();
>>>>>>
>>>>>>     MimeMessage msg = new MimeMessage(session);
>>>>>>
>>>>>>     msg.setFrom(new InternetAddress(from));
>>>>>>
>>>>>>     msg.addRecipients(Message.****RecipientType.TO<http://**
>>>>>> Message.RecipientType.TO<http://Message.RecipientType.TO>>,
>>>>>>
>>>>>> to);
>>>>>>
>>>>>>     msg.setSubject(subject);
>>>>>>
>>>>>>     msg.setText(content);
>>>>>>
>>>>>>     Transport.send(msg);
>>>>>>
>>>>>>   }
>>>>>>
>>>>>>
>>>>>>
>>>>>>   public void checkInbox(int mode)
>>>>>>
>>>>>>     throws MessagingException, IOException
>>>>>>
>>>>>>   {
>>>>>>
>>>>>>     if (mode == 0) return;
>>>>>>
>>>>>>     boolean show = (mode&    SHOW_MESSAGES)>    0;
>>>>>>
>>>>>>     boolean clear = (mode&    CLEAR_MESSAGES)>    0;
>>>>>>
>>>>>>
>>>>>>     String action =
>>>>>>
>>>>>>       (show ? "Show" : "") +
>>>>>>
>>>>>>       (show&&    clear ? " and " : "") +
>>>>>>
>>>>>>
>>>>>>       (clear ? "Clear" : "");
>>>>>>
>>>>>>     System.out.println(action + " INBOX for " + from);
>>>>>>
>>>>>>     Store store = session.getStore();
>>>>>>
>>>>>>     store.connect();
>>>>>>
>>>>>>     Folder root = store.getDefaultFolder();
>>>>>>
>>>>>>     Folder inbox = root.getFolder("inbox");
>>>>>>
>>>>>>     inbox.open(Folder.READ_WRITE);
>>>>>>
>>>>>>     Message[] msgs = inbox.getMessages();
>>>>>>
>>>>>>     if (msgs.length == 0&&    show)
>>>>>>
>>>>>>
>>>>>>     {
>>>>>>
>>>>>>       System.out.println("No messages in inbox");
>>>>>>
>>>>>>     }
>>>>>>
>>>>>>     for (int i = 0; i<    msgs.length; i++)
>>>>>>
>>>>>>     {
>>>>>>
>>>>>>       MimeMessage msg = (MimeMessage)msgs[i];
>>>>>>
>>>>>>       if (show)
>>>>>>
>>>>>>       {
>>>>>>
>>>>>>         System.out.println("    From: " + msg.getFrom()[0]);
>>>>>>
>>>>>>         System.out.println(" Subject: " + msg.getSubject());
>>>>>>
>>>>>>         System.out.println(" Content: " + msg.getContent());
>>>>>>
>>>>>>       }
>>>>>>
>>>>>>       if (clear)
>>>>>>
>>>>>>       {
>>>>>>
>>>>>>         msg.setFlag(Flags.Flag.****DELETED, true);
>>>>>>
>>>>>>
>>>>>>       }
>>>>>>
>>>>>>     }
>>>>>>
>>>>>>     inbox.close(true);
>>>>>>
>>>>>>     store.close();
>>>>>>
>>>>>>     System.out.println();
>>>>>>
>>>>>>   }
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>> public class JamesConfigTest
>>>>>>
>>>>>> {
>>>>>>
>>>>>>   public static void main(String[] args)
>>>>>>
>>>>>>     throws Exception
>>>>>>
>>>>>>   {
>>>>>>
>>>>>>     // CREATE CLIENT INSTANCES
>>>>>>
>>>>>>     MailClient redClient = new MailClient("red@smo.tld","red"****,
>>>>>>
>>>>>> "192.168.55.119");
>>>>>>
>>>>>>     MailClient greenClient = new MailClient("green@smo.tld", "green",
>>>>>> "192.168.55.119");
>>>>>>
>>>>>>     MailClient blueClient = new MailClient("blue@smo.tld","****blue",
>>>>>>
>>>>>> "192.168.55.119");
>>>>>>
>>>>>>
>>>>>>
>>>>>>     // CLEAR EVERYBODY'S INBOX
>>>>>>
>>>>>>     redClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>>
>>>>>>     greenClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>>
>>>>>>     blueClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>>
>>>>>>
>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>
>>>>>>
>>>>>>
>>>>>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>>
>>>>>>     //redClient.****getPasswordAuthentication();
>>>>>>
>>>>>>
>>>>>>     redClient.sendMessage(
>>>>>>
>>>>>>       "garvicee@h5sw.com",
>>>>>>
>>>>>>       "Testing blue from red",
>>>>>>
>>>>>>       "This is a test message");
>>>>>>
>>>>>>     //greenClient.****getPasswordAuthentication();
>>>>>>
>>>>>>
>>>>>>     greenClient.sendMessage(
>>>>>>
>>>>>>       "blue@smo.tld",
>>>>>>
>>>>>>       "Testing blue from green",
>>>>>>
>>>>>>       "This is a test message");
>>>>>>
>>>>>>     Thread.sleep(500); // Let the server catch up
>>>>>>
>>>>>>
>>>>>>
>>>>>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>>
>>>>>>     blueClient.checkInbox(****MailClient.SHOW_AND_CLEAR);
>>>>>>
>>>>>>
>>>>>>   }
>>>>>>
>>>>>> }
>>>>>>
>>>>>>
>>>>>> Here is the output from the console
>>>>>>
>>>>>>   Exception in thread "main" javax.mail.****SendFailedException:
>>>>>> Invalid
>>>>>> Addresses;
>>>>>>
>>>>>>   nested exception is:
>>>>>>
>>>>>> com.sun.mail.smtp.****SMTPAddressFailedException: 530 5.7.1
>>>>>> Authentication
>>>>>> Required
>>>>>>
>>>>>>
>>>>>>   at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>>> SMTPTransport.java:1835)
>>>>>>
>>>>>> at com.sun.mail.smtp.****SMTPTransport.sendMessage(**
>>>>>> SMTPTransport.java:1098)
>>>>>>
>>>>>> at javax.mail.Transport.send0(****Transport.java:195)
>>>>>>
>>>>>> at javax.mail.Transport.send(****Transport.java:124)
>>>>>>
>>>>>> at MailClient.sendMessage(****MailClient.java:55)
>>>>>>
>>>>>> at JamesConfigTest.main(****JamesConfigTest.java:20)
>>>>>>
>>>>>> Caused by: com.sun.mail.smtp.****SMTPAddressFailedException: 530 5.7.1
>>>>>> Authentication Required
>>>>>>
>>>>>>
>>>>>>   at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>>> SMTPTransport.java:1733)
>>>>>>
>>>>>>
>>>>>> ... 5 more
>>>>>>
>>>>>> Here is the output in the JamesServer.log:
>>>>>>
>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>
>>>>>>   established
>>>>>
>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>> org.apache.james.smtpserver.****AuthRequiredToRelayRcptHook: result=2
>>>>>>
>>>>>> (DENY)
>>>>>>
>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 530 [5.7.1
>>>>>>
>>>>>> Authentication
>>>>>> Required]
>>>>>>
>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>>>> for
>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>
>>>>>> Here is the SMTP:
>>>>>>
>>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>>
>>>>>>   established
>>>>>
>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>>> org.apache.james.smtpserver.****AuthRequiredToRelayRcptHook: result=2
>>>>>>
>>>>>> (DENY)
>>>>>>
>>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 530 [5.7.1
>>>>>>
>>>>>> Authentication
>>>>>> Required]
>>>>>>
>>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>>>> for
>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>
>>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>>
>>>>>> I get this error message:
>>>>>>
>>>>>> Exception in thread "main" javax.mail.****SendFailedException: Invalid
>>>>>> Addresses;
>>>>>>
>>>>>>   nested exception is:
>>>>>>
>>>>>> com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1 Incorrect
>>>>>>
>>>>>> Authentication for Specified Email Address
>>>>>>
>>>>>>
>>>>>>   at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>>> SMTPTransport.java:1835)
>>>>>>
>>>>>> at com.sun.mail.smtp.****SMTPTransport.sendMessage(**
>>>>>> SMTPTransport.java:1098)
>>>>>>
>>>>>> at javax.mail.Transport.send0(****Transport.java:195)
>>>>>>
>>>>>> at javax.mail.Transport.send(****Transport.java:124)
>>>>>>
>>>>>> at MailClient.sendMessage(****MailClient.java:55)
>>>>>>
>>>>>> at JamesConfigTest.main(****JamesConfigTest.java:20)
>>>>>>
>>>>>> Caused by: com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1
>>>>>>
>>>>>>   Incorrect
>>>>>
>>>>>   Authentication for Specified Email Address
>>>>>>
>>>>>>
>>>>>>   at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>>> SMTPTransport.java:1686)
>>>>>>
>>>>>>
>>>>>> ... 5 more
>>>>>>
>>>>>>
>>>>>> With these Logfiles:
>>>>>>
>>>>>> SMTPServer.log
>>>>>>
>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>
>>>>>>   established
>>>>>
>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>> org.apache.james.smtpserver.****SenderAuthIdentifyVerification**
>>>>>> **RcptHook:
>>>>>>
>>>>>>   result=2
>>>>>
>>>>>   (DENY)
>>>>>>
>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 503 [5.7.1
>>>>>> Incorrect
>>>>>>
>>>>>> Authentication for Specified Email Address]
>>>>>>
>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>>>> for
>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>> James-Server.log
>>>>>>
>>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>>
>>>>>>   established
>>>>>
>>>>>   from Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>>> org.apache.james.smtpserver.****SenderAuthIdentifyVerification**
>>>>>> **RcptHook:
>>>>>>
>>>>>>   result=2
>>>>>
>>>>>   (DENY)
>>>>>>
>>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 503 [5.7.1
>>>>>> Incorrect
>>>>>>
>>>>>> Authentication for Specified Email Address]
>>>>>>
>>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>>>> for
>>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>>
>>>>>>
>>>>>> Any help with this would be great. I'm not really sure what I"m doing
>>>>>>
>>>>>>   wrong.
>>>>>
>>>>>   I don't know if it's a setting in james or a property I need to set in
>>>>>> JavaMail for the Transport.
>>>>>>
>>>>>> Also here is the SMTPServer.xml file
>>>>>>
>>>>>> <smtpserver enabled="true">
>>>>>>
>>>>>>   <bind>0.0.0.0:25</bind>
>>>>>>
>>>>>>   <connectionBacklog>200</****connectionBacklog>
>>>>>>
>>>>>>
>>>>>>   <tls socketTLS="false" startTLS="false">
>>>>>>
>>>>>>   </tls>
>>>>>>
>>>>>>   <connectiontimeout>360</****connectiontimeout>
>>>>>>
>>>>>>
>>>>>>   <connectionLimit>    0</connectionLimit>
>>>>>>
>>>>>>   <connectionLimitPerIP>    0</connectionLimitPerIP>
>>>>>>
>>>>>>   <authorizedAddresses>127.0.0.****0/8<http://127.0.0.0/8>
>>>>>> </authorizedAddresses>
>>>>>>
>>>>>>   <authRequired>false</****authRequired>
>>>>>>
>>>>>>   <verifyIdentity>false</****verifyIdentity>
>>>>>>
>>>>>>   <maxmessagesize>0</****maxmessagesize>
>>>>>>
>>>>>>   <addressBracketsEnforcement>****true</****addressBracketsEnforcement>
>>>>>>
>>>>>>   <handlerchain enableJmx="true">
>>>>>>
>>>>>>     <handler
>>>>>>
>>>>>>   class="org.apache.james.****smtpserver.fastfail.****
>>>>> ValidRcptHandler"/>
>>>>>
>>>>>
>>>>>>     <handler class="org.apache.james.****smtpserver.**
>>>>>> CoreCmdHandlerLoader"/>
>>>>>>
>>>>>>
>>>>>>   </handlerchain>
>>>>>>
>>>>>> </smtpserver>
>>>>>>
>>>>>>
>>>>>>
>>>>>   --
>>>> Eric
>>>> http://about.echarles.net
>>>>
>>>> ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>>>>
>>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>>> server-user-help@james.**apache.org<se...@james.apache.org>>
>>>>
>>>>
>>>>
>>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
Eric,

Ok I have attached an email client to the James Server (Apple Mail) I can
send emails to internal addresses on the same domain, and I can send
external emails as well.
Using the Java Program I submitted earlier I can send internal emails,
retrieve and print them to console. I can also view these emails using the
mail client.
I can also use the mail client to send internal emails. (Internal to  the
james server)

~Garvice

On Tue, Oct 18, 2011 at 12:32 AM, Eric Charles
<er...@u-mangate.com>wrote:

> You simply have to define a new email account in your favorite mail client
> with the username/password/host you have in James.
>
> Eric
>
>
>
> On 17/10/11 21:58, Garvice Eakins wrote:
>
>> no I have not used thunderbird or any other standard mail client, not
>> really
>> sure even how to do that.
>> I will search the site and see if I can find an example. If you could
>> provide a link to one that would be great!
>> I really am going blindly into this as I have almost zero knowledge about
>> mail servers.
>>
>> ~Garvice
>>
>> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
>> <er...@u-mangate.com>**wrote:
>>
>>  Hi,
>>> What Norman says + did you try from a standard mail client such as
>>> thunderbird to test the server conf?
>>> thx,
>>> Eric
>>>
>>>
>>> On 15/10/11 09:27, Norman Maurer wrote:
>>>
>>>  Hi there,
>>>>
>>>> what exact version you are using? also are you sure the recipients exist
>>>> at
>>>> the james server or do you try to deliver the mailmto a remote
>>>> smtpserver?
>>>>
>>>> bye
>>>> norman
>>>>
>>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>>> garviceeakins@gmail.com
>>>>
>>>>  :
>>>>> I am having problems sending SMTP messages from James3.0 using a simple
>>>>>
>>>>>  java
>>>>
>>>>  application using javamail.
>>>>>
>>>>> Here is the example I am using
>>>>>
>>>>> public class MailClient
>>>>>
>>>>>  extends Authenticator{
>>>>>
>>>>>  public static final int SHOW_MESSAGES = 1;
>>>>>
>>>>>  public static final int CLEAR_MESSAGES = 2;
>>>>>
>>>>>  public static final int SHOW_AND_CLEAR =
>>>>>
>>>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>>
>>>>>  protected String from;
>>>>>
>>>>>  protected Session session;
>>>>>
>>>>>  protected PasswordAuthentication authentication;
>>>>>
>>>>>
>>>>> public MailClient(String user, String pass, String host)  {
>>>>>
>>>>>    this(user, pass, host, false);
>>>>>
>>>>>  }
>>>>>
>>>>>  public MailClient(String user, String pass, String host, boolean
>>>>> debug){
>>>>>
>>>>>    from = user + '@' + host;
>>>>>
>>>>>    authentication = new PasswordAuthentication(user, pass);
>>>>>
>>>>>    Properties props = new Properties();
>>>>>
>>>>>    props.put("mail.user", user);
>>>>>
>>>>>    props.put("mail.host", host);
>>>>>
>>>>>    props.put("mail.debug", debug ? "true" : "false");
>>>>>
>>>>>    props.put("mail.store.****protocol", "pop3");
>>>>>
>>>>>    props.put("mail.transport.****protocol", "smtp");
>>>>>
>>>>>
>>>>>    //props.put("mail.smtp.auth", "true");
>>>>>
>>>>>    session = Session.getInstance(props, this);
>>>>>
>>>>>  }
>>>>>
>>>>>
>>>>>
>>>>>  public PasswordAuthentication getPasswordAuthentication(){
>>>>>
>>>>>    return authentication;
>>>>>
>>>>>  }
>>>>>
>>>>>
>>>>>
>>>>>  public void sendMessage(
>>>>>
>>>>>    String to, String subject, String content)
>>>>>
>>>>>      throws MessagingException
>>>>>
>>>>>  {
>>>>>
>>>>>    System.out.println("SENDING message from " + from + " to " + to);
>>>>>
>>>>>    System.out.println();
>>>>>
>>>>>    MimeMessage msg = new MimeMessage(session);
>>>>>
>>>>>    msg.setFrom(new InternetAddress(from));
>>>>>
>>>>>    msg.addRecipients(Message.****RecipientType.TO<http://**
>>>>> Message.RecipientType.TO <http://Message.RecipientType.TO>>,
>>>>>
>>>>> to);
>>>>>
>>>>>    msg.setSubject(subject);
>>>>>
>>>>>    msg.setText(content);
>>>>>
>>>>>    Transport.send(msg);
>>>>>
>>>>>  }
>>>>>
>>>>>
>>>>>
>>>>>  public void checkInbox(int mode)
>>>>>
>>>>>    throws MessagingException, IOException
>>>>>
>>>>>  {
>>>>>
>>>>>    if (mode == 0) return;
>>>>>
>>>>>    boolean show = (mode&   SHOW_MESSAGES)>   0;
>>>>>
>>>>>    boolean clear = (mode&   CLEAR_MESSAGES)>   0;
>>>>>
>>>>>
>>>>>    String action =
>>>>>
>>>>>      (show ? "Show" : "") +
>>>>>
>>>>>      (show&&   clear ? " and " : "") +
>>>>>
>>>>>
>>>>>      (clear ? "Clear" : "");
>>>>>
>>>>>    System.out.println(action + " INBOX for " + from);
>>>>>
>>>>>    Store store = session.getStore();
>>>>>
>>>>>    store.connect();
>>>>>
>>>>>    Folder root = store.getDefaultFolder();
>>>>>
>>>>>    Folder inbox = root.getFolder("inbox");
>>>>>
>>>>>    inbox.open(Folder.READ_WRITE);
>>>>>
>>>>>    Message[] msgs = inbox.getMessages();
>>>>>
>>>>>    if (msgs.length == 0&&   show)
>>>>>
>>>>>
>>>>>    {
>>>>>
>>>>>      System.out.println("No messages in inbox");
>>>>>
>>>>>    }
>>>>>
>>>>>    for (int i = 0; i<   msgs.length; i++)
>>>>>
>>>>>    {
>>>>>
>>>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>>>
>>>>>      if (show)
>>>>>
>>>>>      {
>>>>>
>>>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>>>
>>>>>        System.out.println(" Subject: " + msg.getSubject());
>>>>>
>>>>>        System.out.println(" Content: " + msg.getContent());
>>>>>
>>>>>      }
>>>>>
>>>>>      if (clear)
>>>>>
>>>>>      {
>>>>>
>>>>>        msg.setFlag(Flags.Flag.****DELETED, true);
>>>>>
>>>>>
>>>>>      }
>>>>>
>>>>>    }
>>>>>
>>>>>    inbox.close(true);
>>>>>
>>>>>    store.close();
>>>>>
>>>>>    System.out.println();
>>>>>
>>>>>  }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> public class JamesConfigTest
>>>>>
>>>>> {
>>>>>
>>>>>  public static void main(String[] args)
>>>>>
>>>>>    throws Exception
>>>>>
>>>>>  {
>>>>>
>>>>>    // CREATE CLIENT INSTANCES
>>>>>
>>>>>    MailClient redClient = new MailClient("red@smo.tld","red"****,
>>>>>
>>>>> "192.168.55.119");
>>>>>
>>>>>    MailClient greenClient = new MailClient("green@smo.tld", "green",
>>>>> "192.168.55.119");
>>>>>
>>>>>    MailClient blueClient = new MailClient("blue@smo.tld","****blue",
>>>>>
>>>>> "192.168.55.119");
>>>>>
>>>>>
>>>>>
>>>>>    // CLEAR EVERYBODY'S INBOX
>>>>>
>>>>>    redClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>
>>>>>    greenClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>
>>>>>    blueClient.checkInbox(****MailClient.CLEAR_MESSAGES);
>>>>>
>>>>>
>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>
>>>>>
>>>>>
>>>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>>
>>>>>    //redClient.****getPasswordAuthentication();
>>>>>
>>>>>
>>>>>    redClient.sendMessage(
>>>>>
>>>>>      "garvicee@h5sw.com",
>>>>>
>>>>>      "Testing blue from red",
>>>>>
>>>>>      "This is a test message");
>>>>>
>>>>>    //greenClient.****getPasswordAuthentication();
>>>>>
>>>>>
>>>>>    greenClient.sendMessage(
>>>>>
>>>>>      "blue@smo.tld",
>>>>>
>>>>>      "Testing blue from green",
>>>>>
>>>>>      "This is a test message");
>>>>>
>>>>>    Thread.sleep(500); // Let the server catch up
>>>>>
>>>>>
>>>>>
>>>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>>
>>>>>    blueClient.checkInbox(****MailClient.SHOW_AND_CLEAR);
>>>>>
>>>>>
>>>>>  }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> Here is the output from the console
>>>>>
>>>>>  Exception in thread "main" javax.mail.****SendFailedException:
>>>>> Invalid
>>>>> Addresses;
>>>>>
>>>>>  nested exception is:
>>>>>
>>>>> com.sun.mail.smtp.****SMTPAddressFailedException: 530 5.7.1
>>>>> Authentication
>>>>> Required
>>>>>
>>>>>
>>>>>  at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1835)
>>>>>
>>>>> at com.sun.mail.smtp.****SMTPTransport.sendMessage(**
>>>>> SMTPTransport.java:1098)
>>>>>
>>>>> at javax.mail.Transport.send0(****Transport.java:195)
>>>>>
>>>>> at javax.mail.Transport.send(****Transport.java:124)
>>>>>
>>>>> at MailClient.sendMessage(****MailClient.java:55)
>>>>>
>>>>> at JamesConfigTest.main(****JamesConfigTest.java:20)
>>>>>
>>>>> Caused by: com.sun.mail.smtp.****SMTPAddressFailedException: 530 5.7.1
>>>>> Authentication Required
>>>>>
>>>>>
>>>>>  at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1733)
>>>>>
>>>>>
>>>>> ... 5 more
>>>>>
>>>>> Here is the output in the JamesServer.log:
>>>>>
>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>
>>>>>  established
>>>>
>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>> org.apache.james.smtpserver.****AuthRequiredToRelayRcptHook: result=2
>>>>>
>>>>> (DENY)
>>>>>
>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 530 [5.7.1
>>>>>
>>>>> Authentication
>>>>> Required]
>>>>>
>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>>> for
>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>>
>>>>> Here is the SMTP:
>>>>>
>>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>>
>>>>>  established
>>>>
>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>>> org.apache.james.smtpserver.****AuthRequiredToRelayRcptHook: result=2
>>>>>
>>>>> (DENY)
>>>>>
>>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 530 [5.7.1
>>>>>
>>>>> Authentication
>>>>> Required]
>>>>>
>>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>>> for
>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>>
>>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>>
>>>>> I get this error message:
>>>>>
>>>>> Exception in thread "main" javax.mail.****SendFailedException: Invalid
>>>>> Addresses;
>>>>>
>>>>>  nested exception is:
>>>>>
>>>>> com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1 Incorrect
>>>>>
>>>>> Authentication for Specified Email Address
>>>>>
>>>>>
>>>>>  at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1835)
>>>>>
>>>>> at com.sun.mail.smtp.****SMTPTransport.sendMessage(**
>>>>> SMTPTransport.java:1098)
>>>>>
>>>>> at javax.mail.Transport.send0(****Transport.java:195)
>>>>>
>>>>> at javax.mail.Transport.send(****Transport.java:124)
>>>>>
>>>>> at MailClient.sendMessage(****MailClient.java:55)
>>>>>
>>>>> at JamesConfigTest.main(****JamesConfigTest.java:20)
>>>>>
>>>>> Caused by: com.sun.mail.smtp.****SMTPAddressFailedException: 503 5.7.1
>>>>>
>>>>>  Incorrect
>>>>
>>>>  Authentication for Specified Email Address
>>>>>
>>>>>
>>>>>  at com.sun.mail.smtp.****SMTPTransport.rcptTo(****
>>>>> SMTPTransport.java:1686)
>>>>>
>>>>>
>>>>> ... 5 more
>>>>>
>>>>>
>>>>> With these Logfiles:
>>>>>
>>>>> SMTPServer.log
>>>>>
>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>
>>>>>  established
>>>>
>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>> org.apache.james.smtpserver.****SenderAuthIdentifyVerification**
>>>>> **RcptHook:
>>>>>
>>>>>  result=2
>>>>
>>>>  (DENY)
>>>>>
>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 503 [5.7.1
>>>>> Incorrect
>>>>>
>>>>> Authentication for Specified Email Address]
>>>>>
>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>>> for
>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>> James-Server.log
>>>>>
>>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>>
>>>>>  established
>>>>
>>>>  from Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>>> org.apache.james.smtpserver.****SenderAuthIdentifyVerification**
>>>>> **RcptHook:
>>>>>
>>>>>  result=2
>>>>
>>>>  (DENY)
>>>>>
>>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>>> org.apache.james.smtpserver.****JamesRcptCmdHandler: 503 [5.7.1
>>>>> Incorrect
>>>>>
>>>>> Authentication for Specified Email Address]
>>>>>
>>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>>> for
>>>>> Garvice-MacBook.local (192.168.55.116)
>>>>>
>>>>>
>>>>> Any help with this would be great. I'm not really sure what I"m doing
>>>>>
>>>>>  wrong.
>>>>
>>>>  I don't know if it's a setting in james or a property I need to set in
>>>>> JavaMail for the Transport.
>>>>>
>>>>> Also here is the SMTPServer.xml file
>>>>>
>>>>> <smtpserver enabled="true">
>>>>>
>>>>>  <bind>0.0.0.0:25</bind>
>>>>>
>>>>>  <connectionBacklog>200</****connectionBacklog>
>>>>>
>>>>>
>>>>>  <tls socketTLS="false" startTLS="false">
>>>>>
>>>>>  </tls>
>>>>>
>>>>>  <connectiontimeout>360</****connectiontimeout>
>>>>>
>>>>>
>>>>>  <connectionLimit>   0</connectionLimit>
>>>>>
>>>>>  <connectionLimitPerIP>   0</connectionLimitPerIP>
>>>>>
>>>>>  <authorizedAddresses>127.0.0.****0/8<http://127.0.0.0/8>
>>>>> </authorizedAddresses>
>>>>>
>>>>>  <authRequired>false</****authRequired>
>>>>>
>>>>>  <verifyIdentity>false</****verifyIdentity>
>>>>>
>>>>>  <maxmessagesize>0</****maxmessagesize>
>>>>>
>>>>>  <addressBracketsEnforcement>****true</****addressBracketsEnforcement>
>>>>>
>>>>>  <handlerchain enableJmx="true">
>>>>>
>>>>>    <handler
>>>>>
>>>>>  class="org.apache.james.****smtpserver.fastfail.****
>>>> ValidRcptHandler"/>
>>>>
>>>>
>>>>>    <handler class="org.apache.james.****smtpserver.**
>>>>> CoreCmdHandlerLoader"/>
>>>>>
>>>>>
>>>>>  </handlerchain>
>>>>>
>>>>> </smtpserver>
>>>>>
>>>>>
>>>>>
>>>>  --
>>> Eric
>>> http://about.echarles.net
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.****apache.org<
>>> server-user-**unsubscribe@james.apache.org<se...@james.apache.org>
>>> >
>>> For additional commands, e-mail: server-user-help@james.apache.****org<
>>> server-user-help@james.**apache.org <se...@james.apache.org>>
>>>
>>>
>>>
>>
> --
> Eric
> http://about.echarles.net
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@u-mangate.com>.
You simply have to define a new email account in your favorite mail 
client with the username/password/host you have in James.

Eric


On 17/10/11 21:58, Garvice Eakins wrote:
> no I have not used thunderbird or any other standard mail client, not really
> sure even how to do that.
> I will search the site and see if I can find an example. If you could
> provide a link to one that would be great!
> I really am going blindly into this as I have almost zero knowledge about
> mail servers.
>
> ~Garvice
>
> On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
> <er...@u-mangate.com>wrote:
>
>> Hi,
>> What Norman says + did you try from a standard mail client such as
>> thunderbird to test the server conf?
>> thx,
>> Eric
>>
>>
>> On 15/10/11 09:27, Norman Maurer wrote:
>>
>>> Hi there,
>>>
>>> what exact version you are using? also are you sure the recipients exist
>>> at
>>> the james server or do you try to deliver the mailmto a remote smtpserver?
>>>
>>> bye
>>> norman
>>>
>>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>>> garviceeakins@gmail.com
>>>
>>>> :
>>>> I am having problems sending SMTP messages from James3.0 using a simple
>>>>
>>> java
>>>
>>>> application using javamail.
>>>>
>>>> Here is the example I am using
>>>>
>>>> public class MailClient
>>>>
>>>>   extends Authenticator{
>>>>
>>>>   public static final int SHOW_MESSAGES = 1;
>>>>
>>>>   public static final int CLEAR_MESSAGES = 2;
>>>>
>>>>   public static final int SHOW_AND_CLEAR =
>>>>
>>>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>>>
>>>>   protected String from;
>>>>
>>>>   protected Session session;
>>>>
>>>>   protected PasswordAuthentication authentication;
>>>>
>>>>
>>>> public MailClient(String user, String pass, String host)  {
>>>>
>>>>     this(user, pass, host, false);
>>>>
>>>>   }
>>>>
>>>>   public MailClient(String user, String pass, String host, boolean debug){
>>>>
>>>>     from = user + '@' + host;
>>>>
>>>>     authentication = new PasswordAuthentication(user, pass);
>>>>
>>>>     Properties props = new Properties();
>>>>
>>>>     props.put("mail.user", user);
>>>>
>>>>     props.put("mail.host", host);
>>>>
>>>>     props.put("mail.debug", debug ? "true" : "false");
>>>>
>>>>     props.put("mail.store.**protocol", "pop3");
>>>>
>>>>     props.put("mail.transport.**protocol", "smtp");
>>>>
>>>>     //props.put("mail.smtp.auth", "true");
>>>>
>>>>     session = Session.getInstance(props, this);
>>>>
>>>>   }
>>>>
>>>>
>>>>
>>>>   public PasswordAuthentication getPasswordAuthentication(){
>>>>
>>>>     return authentication;
>>>>
>>>>   }
>>>>
>>>>
>>>>
>>>>   public void sendMessage(
>>>>
>>>>     String to, String subject, String content)
>>>>
>>>>       throws MessagingException
>>>>
>>>>   {
>>>>
>>>>     System.out.println("SENDING message from " + from + " to " + to);
>>>>
>>>>     System.out.println();
>>>>
>>>>     MimeMessage msg = new MimeMessage(session);
>>>>
>>>>     msg.setFrom(new InternetAddress(from));
>>>>
>>>>     msg.addRecipients(Message.**RecipientType.TO<http://Message.RecipientType.TO>,
>>>> to);
>>>>
>>>>     msg.setSubject(subject);
>>>>
>>>>     msg.setText(content);
>>>>
>>>>     Transport.send(msg);
>>>>
>>>>   }
>>>>
>>>>
>>>>
>>>>   public void checkInbox(int mode)
>>>>
>>>>     throws MessagingException, IOException
>>>>
>>>>   {
>>>>
>>>>     if (mode == 0) return;
>>>>
>>>>     boolean show = (mode&   SHOW_MESSAGES)>   0;
>>>>
>>>>     boolean clear = (mode&   CLEAR_MESSAGES)>   0;
>>>>
>>>>
>>>>     String action =
>>>>
>>>>       (show ? "Show" : "") +
>>>>
>>>>       (show&&   clear ? " and " : "") +
>>>>
>>>>
>>>>       (clear ? "Clear" : "");
>>>>
>>>>     System.out.println(action + " INBOX for " + from);
>>>>
>>>>     Store store = session.getStore();
>>>>
>>>>     store.connect();
>>>>
>>>>     Folder root = store.getDefaultFolder();
>>>>
>>>>     Folder inbox = root.getFolder("inbox");
>>>>
>>>>     inbox.open(Folder.READ_WRITE);
>>>>
>>>>     Message[] msgs = inbox.getMessages();
>>>>
>>>>     if (msgs.length == 0&&   show)
>>>>
>>>>
>>>>     {
>>>>
>>>>       System.out.println("No messages in inbox");
>>>>
>>>>     }
>>>>
>>>>     for (int i = 0; i<   msgs.length; i++)
>>>>
>>>>     {
>>>>
>>>>       MimeMessage msg = (MimeMessage)msgs[i];
>>>>
>>>>       if (show)
>>>>
>>>>       {
>>>>
>>>>         System.out.println("    From: " + msg.getFrom()[0]);
>>>>
>>>>         System.out.println(" Subject: " + msg.getSubject());
>>>>
>>>>         System.out.println(" Content: " + msg.getContent());
>>>>
>>>>       }
>>>>
>>>>       if (clear)
>>>>
>>>>       {
>>>>
>>>>         msg.setFlag(Flags.Flag.**DELETED, true);
>>>>
>>>>       }
>>>>
>>>>     }
>>>>
>>>>     inbox.close(true);
>>>>
>>>>     store.close();
>>>>
>>>>     System.out.println();
>>>>
>>>>   }
>>>>
>>>> }
>>>>
>>>>
>>>> public class JamesConfigTest
>>>>
>>>> {
>>>>
>>>>   public static void main(String[] args)
>>>>
>>>>     throws Exception
>>>>
>>>>   {
>>>>
>>>>     // CREATE CLIENT INSTANCES
>>>>
>>>>     MailClient redClient = new MailClient("red@smo.tld","red"**,
>>>> "192.168.55.119");
>>>>
>>>>     MailClient greenClient = new MailClient("green@smo.tld", "green",
>>>> "192.168.55.119");
>>>>
>>>>     MailClient blueClient = new MailClient("blue@smo.tld","**blue",
>>>> "192.168.55.119");
>>>>
>>>>
>>>>
>>>>     // CLEAR EVERYBODY'S INBOX
>>>>
>>>>     redClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>>
>>>>     greenClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>>
>>>>     blueClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>>
>>>>     Thread.sleep(500); // Let the server catch up
>>>>
>>>>
>>>>
>>>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>>
>>>>     //redClient.**getPasswordAuthentication();
>>>>
>>>>     redClient.sendMessage(
>>>>
>>>>       "garvicee@h5sw.com",
>>>>
>>>>       "Testing blue from red",
>>>>
>>>>       "This is a test message");
>>>>
>>>>     //greenClient.**getPasswordAuthentication();
>>>>
>>>>     greenClient.sendMessage(
>>>>
>>>>       "blue@smo.tld",
>>>>
>>>>       "Testing blue from green",
>>>>
>>>>       "This is a test message");
>>>>
>>>>     Thread.sleep(500); // Let the server catch up
>>>>
>>>>
>>>>
>>>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>>
>>>>     blueClient.checkInbox(**MailClient.SHOW_AND_CLEAR);
>>>>
>>>>   }
>>>>
>>>> }
>>>>
>>>>
>>>> Here is the output from the console
>>>>
>>>>   Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>>> Addresses;
>>>>
>>>>   nested exception is:
>>>>
>>>> com.sun.mail.smtp.**SMTPAddressFailedException: 530 5.7.1 Authentication
>>>> Required
>>>>
>>>>
>>>>   at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>>
>>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>>> SMTPTransport.java:1098)
>>>>
>>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>>
>>>> at javax.mail.Transport.send(**Transport.java:124)
>>>>
>>>> at MailClient.sendMessage(**MailClient.java:55)
>>>>
>>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>>
>>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 530 5.7.1
>>>> Authentication Required
>>>>
>>>>
>>>>   at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1733)
>>>>
>>>> ... 5 more
>>>>
>>>> Here is the output in the JamesServer.log:
>>>>
>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>
>>> established
>>>
>>>> from Garvice-MacBook.local (192.168.55.116)
>>>>
>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>> org.apache.james.smtpserver.**AuthRequiredToRelayRcptHook: result=2
>>>> (DENY)
>>>>
>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 530 [5.7.1
>>>> Authentication
>>>> Required]
>>>>
>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>> for
>>>> Garvice-MacBook.local (192.168.55.116)
>>>>
>>>>
>>>> Here is the SMTP:
>>>>
>>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>>
>>> established
>>>
>>>> from Garvice-MacBook.local (192.168.55.116)
>>>>
>>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>>> org.apache.james.smtpserver.**AuthRequiredToRelayRcptHook: result=2
>>>> (DENY)
>>>>
>>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 530 [5.7.1
>>>> Authentication
>>>> Required]
>>>>
>>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>>> for
>>>> Garvice-MacBook.local (192.168.55.116)
>>>>
>>>>
>>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>>
>>>> I get this error message:
>>>>
>>>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>>> Addresses;
>>>>
>>>>   nested exception is:
>>>>
>>>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>>>> Authentication for Specified Email Address
>>>>
>>>>
>>>>   at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>>
>>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>>> SMTPTransport.java:1098)
>>>>
>>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>>
>>>> at javax.mail.Transport.send(**Transport.java:124)
>>>>
>>>> at MailClient.sendMessage(**MailClient.java:55)
>>>>
>>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>>
>>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>>>>
>>> Incorrect
>>>
>>>> Authentication for Specified Email Address
>>>>
>>>>
>>>>   at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>>>
>>>> ... 5 more
>>>>
>>>>
>>>> With these Logfiles:
>>>>
>>>> SMTPServer.log
>>>>
>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>
>>> established
>>>
>>>> from Garvice-MacBook.local (192.168.55.116)
>>>>
>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>> org.apache.james.smtpserver.**SenderAuthIdentifyVerification**RcptHook:
>>>>
>>> result=2
>>>
>>>> (DENY)
>>>>
>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>>>> Authentication for Specified Email Address]
>>>>
>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>> for
>>>> Garvice-MacBook.local (192.168.55.116)
>>>>
>>>> James-Server.log
>>>>
>>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>>
>>> established
>>>
>>>> from Garvice-MacBook.local (192.168.55.116)
>>>>
>>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>>> org.apache.james.smtpserver.**SenderAuthIdentifyVerification**RcptHook:
>>>>
>>> result=2
>>>
>>>> (DENY)
>>>>
>>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>>>> Authentication for Specified Email Address]
>>>>
>>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>>> for
>>>> Garvice-MacBook.local (192.168.55.116)
>>>>
>>>>
>>>> Any help with this would be great. I'm not really sure what I"m doing
>>>>
>>> wrong.
>>>
>>>> I don't know if it's a setting in james or a property I need to set in
>>>> JavaMail for the Transport.
>>>>
>>>> Also here is the SMTPServer.xml file
>>>>
>>>> <smtpserver enabled="true">
>>>>
>>>>   <bind>0.0.0.0:25</bind>
>>>>
>>>>   <connectionBacklog>200</**connectionBacklog>
>>>>
>>>>   <tls socketTLS="false" startTLS="false">
>>>>
>>>>   </tls>
>>>>
>>>>   <connectiontimeout>360</**connectiontimeout>
>>>>
>>>>   <connectionLimit>   0</connectionLimit>
>>>>
>>>>   <connectionLimitPerIP>   0</connectionLimitPerIP>
>>>>
>>>>   <authorizedAddresses>127.0.0.**0/8<http://127.0.0.0/8>
>>>> </authorizedAddresses>
>>>>
>>>>   <authRequired>false</**authRequired>
>>>>
>>>>   <verifyIdentity>false</**verifyIdentity>
>>>>
>>>>   <maxmessagesize>0</**maxmessagesize>
>>>>
>>>>   <addressBracketsEnforcement>**true</**addressBracketsEnforcement>
>>>>
>>>>   <handlerchain enableJmx="true">
>>>>
>>>>     <handler
>>>>
>>> class="org.apache.james.**smtpserver.fastfail.**ValidRcptHandler"/>
>>>
>>>>
>>>>     <handler class="org.apache.james.**smtpserver.**
>>>> CoreCmdHandlerLoader"/>
>>>>
>>>>
>>>>   </handlerchain>
>>>>
>>>> </smtpserver>
>>>>
>>>>
>>>
>> --
>> Eric
>> http://about.echarles.net
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
>> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
no I have not used thunderbird or any other standard mail client, not really
sure even how to do that.
I will search the site and see if I can find an example. If you could
provide a link to one that would be great!
I really am going blindly into this as I have almost zero knowledge about
mail servers.

~Garvice

On Mon, Oct 17, 2011 at 12:56 AM, Eric Charles
<er...@u-mangate.com>wrote:

> Hi,
> What Norman says + did you try from a standard mail client such as
> thunderbird to test the server conf?
> thx,
> Eric
>
>
> On 15/10/11 09:27, Norman Maurer wrote:
>
>> Hi there,
>>
>> what exact version you are using? also are you sure the recipients exist
>> at
>> the james server or do you try to deliver the mailmto a remote smtpserver?
>>
>> bye
>> norman
>>
>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<
>> garviceeakins@gmail.com
>>
>>> :
>>> I am having problems sending SMTP messages from James3.0 using a simple
>>>
>> java
>>
>>> application using javamail.
>>>
>>> Here is the example I am using
>>>
>>> public class MailClient
>>>
>>>  extends Authenticator{
>>>
>>>  public static final int SHOW_MESSAGES = 1;
>>>
>>>  public static final int CLEAR_MESSAGES = 2;
>>>
>>>  public static final int SHOW_AND_CLEAR =
>>>
>>>    SHOW_MESSAGES + CLEAR_MESSAGES;
>>>
>>>  protected String from;
>>>
>>>  protected Session session;
>>>
>>>  protected PasswordAuthentication authentication;
>>>
>>>
>>> public MailClient(String user, String pass, String host)  {
>>>
>>>    this(user, pass, host, false);
>>>
>>>  }
>>>
>>>  public MailClient(String user, String pass, String host, boolean debug){
>>>
>>>    from = user + '@' + host;
>>>
>>>    authentication = new PasswordAuthentication(user, pass);
>>>
>>>    Properties props = new Properties();
>>>
>>>    props.put("mail.user", user);
>>>
>>>    props.put("mail.host", host);
>>>
>>>    props.put("mail.debug", debug ? "true" : "false");
>>>
>>>    props.put("mail.store.**protocol", "pop3");
>>>
>>>    props.put("mail.transport.**protocol", "smtp");
>>>
>>>    //props.put("mail.smtp.auth", "true");
>>>
>>>    session = Session.getInstance(props, this);
>>>
>>>  }
>>>
>>>
>>>
>>>  public PasswordAuthentication getPasswordAuthentication(){
>>>
>>>    return authentication;
>>>
>>>  }
>>>
>>>
>>>
>>>  public void sendMessage(
>>>
>>>    String to, String subject, String content)
>>>
>>>      throws MessagingException
>>>
>>>  {
>>>
>>>    System.out.println("SENDING message from " + from + " to " + to);
>>>
>>>    System.out.println();
>>>
>>>    MimeMessage msg = new MimeMessage(session);
>>>
>>>    msg.setFrom(new InternetAddress(from));
>>>
>>>    msg.addRecipients(Message.**RecipientType.TO<http://Message.RecipientType.TO>,
>>> to);
>>>
>>>    msg.setSubject(subject);
>>>
>>>    msg.setText(content);
>>>
>>>    Transport.send(msg);
>>>
>>>  }
>>>
>>>
>>>
>>>  public void checkInbox(int mode)
>>>
>>>    throws MessagingException, IOException
>>>
>>>  {
>>>
>>>    if (mode == 0) return;
>>>
>>>    boolean show = (mode&  SHOW_MESSAGES)>  0;
>>>
>>>    boolean clear = (mode&  CLEAR_MESSAGES)>  0;
>>>
>>>
>>>    String action =
>>>
>>>      (show ? "Show" : "") +
>>>
>>>      (show&&  clear ? " and " : "") +
>>>
>>>
>>>      (clear ? "Clear" : "");
>>>
>>>    System.out.println(action + " INBOX for " + from);
>>>
>>>    Store store = session.getStore();
>>>
>>>    store.connect();
>>>
>>>    Folder root = store.getDefaultFolder();
>>>
>>>    Folder inbox = root.getFolder("inbox");
>>>
>>>    inbox.open(Folder.READ_WRITE);
>>>
>>>    Message[] msgs = inbox.getMessages();
>>>
>>>    if (msgs.length == 0&&  show)
>>>
>>>
>>>    {
>>>
>>>      System.out.println("No messages in inbox");
>>>
>>>    }
>>>
>>>    for (int i = 0; i<  msgs.length; i++)
>>>
>>>    {
>>>
>>>      MimeMessage msg = (MimeMessage)msgs[i];
>>>
>>>      if (show)
>>>
>>>      {
>>>
>>>        System.out.println("    From: " + msg.getFrom()[0]);
>>>
>>>        System.out.println(" Subject: " + msg.getSubject());
>>>
>>>        System.out.println(" Content: " + msg.getContent());
>>>
>>>      }
>>>
>>>      if (clear)
>>>
>>>      {
>>>
>>>        msg.setFlag(Flags.Flag.**DELETED, true);
>>>
>>>      }
>>>
>>>    }
>>>
>>>    inbox.close(true);
>>>
>>>    store.close();
>>>
>>>    System.out.println();
>>>
>>>  }
>>>
>>> }
>>>
>>>
>>> public class JamesConfigTest
>>>
>>> {
>>>
>>>  public static void main(String[] args)
>>>
>>>    throws Exception
>>>
>>>  {
>>>
>>>    // CREATE CLIENT INSTANCES
>>>
>>>    MailClient redClient = new MailClient("red@smo.tld","red"**,
>>> "192.168.55.119");
>>>
>>>    MailClient greenClient = new MailClient("green@smo.tld", "green",
>>> "192.168.55.119");
>>>
>>>    MailClient blueClient = new MailClient("blue@smo.tld","**blue",
>>> "192.168.55.119");
>>>
>>>
>>>
>>>    // CLEAR EVERYBODY'S INBOX
>>>
>>>    redClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>
>>>    greenClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>
>>>    blueClient.checkInbox(**MailClient.CLEAR_MESSAGES);
>>>
>>>    Thread.sleep(500); // Let the server catch up
>>>
>>>
>>>
>>>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>>
>>>    //redClient.**getPasswordAuthentication();
>>>
>>>    redClient.sendMessage(
>>>
>>>      "garvicee@h5sw.com",
>>>
>>>      "Testing blue from red",
>>>
>>>      "This is a test message");
>>>
>>>    //greenClient.**getPasswordAuthentication();
>>>
>>>    greenClient.sendMessage(
>>>
>>>      "blue@smo.tld",
>>>
>>>      "Testing blue from green",
>>>
>>>      "This is a test message");
>>>
>>>    Thread.sleep(500); // Let the server catch up
>>>
>>>
>>>
>>>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>>
>>>    blueClient.checkInbox(**MailClient.SHOW_AND_CLEAR);
>>>
>>>  }
>>>
>>> }
>>>
>>>
>>> Here is the output from the console
>>>
>>>  Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>> Addresses;
>>>
>>>  nested exception is:
>>>
>>> com.sun.mail.smtp.**SMTPAddressFailedException: 530 5.7.1 Authentication
>>> Required
>>>
>>>
>>>  at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>
>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>> SMTPTransport.java:1098)
>>>
>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>
>>> at javax.mail.Transport.send(**Transport.java:124)
>>>
>>> at MailClient.sendMessage(**MailClient.java:55)
>>>
>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>
>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 530 5.7.1
>>> Authentication Required
>>>
>>>
>>>  at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1733)
>>>
>>> ... 5 more
>>>
>>> Here is the output in the JamesServer.log:
>>>
>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>
>> established
>>
>>> from Garvice-MacBook.local (192.168.55.116)
>>>
>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>> org.apache.james.smtpserver.**AuthRequiredToRelayRcptHook: result=2
>>> (DENY)
>>>
>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 530 [5.7.1
>>> Authentication
>>> Required]
>>>
>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>> for
>>> Garvice-MacBook.local (192.168.55.116)
>>>
>>>
>>> Here is the SMTP:
>>>
>>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>>>
>> established
>>
>>> from Garvice-MacBook.local (192.168.55.116)
>>>
>>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>>> org.apache.james.smtpserver.**AuthRequiredToRelayRcptHook: result=2
>>> (DENY)
>>>
>>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 530 [5.7.1
>>> Authentication
>>> Required]
>>>
>>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>>> for
>>> Garvice-MacBook.local (192.168.55.116)
>>>
>>>
>>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>>
>>> I get this error message:
>>>
>>> Exception in thread "main" javax.mail.**SendFailedException: Invalid
>>> Addresses;
>>>
>>>  nested exception is:
>>>
>>> com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1 Incorrect
>>> Authentication for Specified Email Address
>>>
>>>
>>>  at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1835)
>>>
>>> at com.sun.mail.smtp.**SMTPTransport.sendMessage(**
>>> SMTPTransport.java:1098)
>>>
>>> at javax.mail.Transport.send0(**Transport.java:195)
>>>
>>> at javax.mail.Transport.send(**Transport.java:124)
>>>
>>> at MailClient.sendMessage(**MailClient.java:55)
>>>
>>> at JamesConfigTest.main(**JamesConfigTest.java:20)
>>>
>>> Caused by: com.sun.mail.smtp.**SMTPAddressFailedException: 503 5.7.1
>>>
>> Incorrect
>>
>>> Authentication for Specified Email Address
>>>
>>>
>>>  at com.sun.mail.smtp.**SMTPTransport.rcptTo(**SMTPTransport.java:1686)
>>>
>>> ... 5 more
>>>
>>>
>>> With these Logfiles:
>>>
>>> SMTPServer.log
>>>
>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>
>> established
>>
>>> from Garvice-MacBook.local (192.168.55.116)
>>>
>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>> org.apache.james.smtpserver.**SenderAuthIdentifyVerification**RcptHook:
>>>
>> result=2
>>
>>> (DENY)
>>>
>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>>> Authentication for Specified Email Address]
>>>
>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>> for
>>> Garvice-MacBook.local (192.168.55.116)
>>>
>>> James-Server.log
>>>
>>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>>>
>> established
>>
>>> from Garvice-MacBook.local (192.168.55.116)
>>>
>>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>>> org.apache.james.smtpserver.**SenderAuthIdentifyVerification**RcptHook:
>>>
>> result=2
>>
>>> (DENY)
>>>
>>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>>> org.apache.james.smtpserver.**JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>>> Authentication for Specified Email Address]
>>>
>>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>>> for
>>> Garvice-MacBook.local (192.168.55.116)
>>>
>>>
>>> Any help with this would be great. I'm not really sure what I"m doing
>>>
>> wrong.
>>
>>> I don't know if it's a setting in james or a property I need to set in
>>> JavaMail for the Transport.
>>>
>>> Also here is the SMTPServer.xml file
>>>
>>> <smtpserver enabled="true">
>>>
>>>  <bind>0.0.0.0:25</bind>
>>>
>>>  <connectionBacklog>200</**connectionBacklog>
>>>
>>>  <tls socketTLS="false" startTLS="false">
>>>
>>>  </tls>
>>>
>>>  <connectiontimeout>360</**connectiontimeout>
>>>
>>>  <connectionLimit>  0</connectionLimit>
>>>
>>>  <connectionLimitPerIP>  0</connectionLimitPerIP>
>>>
>>>  <authorizedAddresses>127.0.0.**0/8 <http://127.0.0.0/8>
>>> </authorizedAddresses>
>>>
>>>  <authRequired>false</**authRequired>
>>>
>>>  <verifyIdentity>false</**verifyIdentity>
>>>
>>>  <maxmessagesize>0</**maxmessagesize>
>>>
>>>  <addressBracketsEnforcement>**true</**addressBracketsEnforcement>
>>>
>>>  <handlerchain enableJmx="true">
>>>
>>>    <handler
>>>
>> class="org.apache.james.**smtpserver.fastfail.**ValidRcptHandler"/>
>>
>>>
>>>    <handler class="org.apache.james.**smtpserver.**
>>> CoreCmdHandlerLoader"/>
>>>
>>>
>>>  </handlerchain>
>>>
>>> </smtpserver>
>>>
>>>
>>
> --
> Eric
> http://about.echarles.net
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: server-user-unsubscribe@james.**apache.org<se...@james.apache.org>
> For additional commands, e-mail: server-user-help@james.apache.**org<se...@james.apache.org>
>
>

Re: Authentication errors SMTP

Posted by Eric Charles <er...@u-mangate.com>.
Hi,
What Norman says + did you try from a standard mail client such as 
thunderbird to test the server conf?
thx,
Eric

On 15/10/11 09:27, Norman Maurer wrote:
> Hi there,
>
> what exact version you are using? also are you sure the recipients exist at
> the james server or do you try to deliver the mailmto a remote smtpserver?
>
> bye
> norman
>
> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins<garviceeakins@gmail.com
>> :
>> I am having problems sending SMTP messages from James3.0 using a simple
> java
>> application using javamail.
>>
>> Here is the example I am using
>>
>> public class MailClient
>>
>>   extends Authenticator{
>>
>>   public static final int SHOW_MESSAGES = 1;
>>
>>   public static final int CLEAR_MESSAGES = 2;
>>
>>   public static final int SHOW_AND_CLEAR =
>>
>>     SHOW_MESSAGES + CLEAR_MESSAGES;
>>
>>   protected String from;
>>
>>   protected Session session;
>>
>>   protected PasswordAuthentication authentication;
>>
>>
>> public MailClient(String user, String pass, String host)  {
>>
>>     this(user, pass, host, false);
>>
>>   }
>>
>>   public MailClient(String user, String pass, String host, boolean debug){
>>
>>     from = user + '@' + host;
>>
>>     authentication = new PasswordAuthentication(user, pass);
>>
>>     Properties props = new Properties();
>>
>>     props.put("mail.user", user);
>>
>>     props.put("mail.host", host);
>>
>>     props.put("mail.debug", debug ? "true" : "false");
>>
>>     props.put("mail.store.protocol", "pop3");
>>
>>     props.put("mail.transport.protocol", "smtp");
>>
>>     //props.put("mail.smtp.auth", "true");
>>
>>     session = Session.getInstance(props, this);
>>
>>   }
>>
>>
>>
>>   public PasswordAuthentication getPasswordAuthentication(){
>>
>>     return authentication;
>>
>>   }
>>
>>
>>
>>   public void sendMessage(
>>
>>     String to, String subject, String content)
>>
>>       throws MessagingException
>>
>>   {
>>
>>     System.out.println("SENDING message from " + from + " to " + to);
>>
>>     System.out.println();
>>
>>     MimeMessage msg = new MimeMessage(session);
>>
>>     msg.setFrom(new InternetAddress(from));
>>
>>     msg.addRecipients(Message.RecipientType.TO, to);
>>
>>     msg.setSubject(subject);
>>
>>     msg.setText(content);
>>
>>     Transport.send(msg);
>>
>>   }
>>
>>
>>
>>   public void checkInbox(int mode)
>>
>>     throws MessagingException, IOException
>>
>>   {
>>
>>     if (mode == 0) return;
>>
>>     boolean show = (mode&  SHOW_MESSAGES)>  0;
>>
>>     boolean clear = (mode&  CLEAR_MESSAGES)>  0;
>>
>>     String action =
>>
>>       (show ? "Show" : "") +
>>
>>       (show&&  clear ? " and " : "") +
>>
>>       (clear ? "Clear" : "");
>>
>>     System.out.println(action + " INBOX for " + from);
>>
>>     Store store = session.getStore();
>>
>>     store.connect();
>>
>>     Folder root = store.getDefaultFolder();
>>
>>     Folder inbox = root.getFolder("inbox");
>>
>>     inbox.open(Folder.READ_WRITE);
>>
>>     Message[] msgs = inbox.getMessages();
>>
>>     if (msgs.length == 0&&  show)
>>
>>     {
>>
>>       System.out.println("No messages in inbox");
>>
>>     }
>>
>>     for (int i = 0; i<  msgs.length; i++)
>>
>>     {
>>
>>       MimeMessage msg = (MimeMessage)msgs[i];
>>
>>       if (show)
>>
>>       {
>>
>>         System.out.println("    From: " + msg.getFrom()[0]);
>>
>>         System.out.println(" Subject: " + msg.getSubject());
>>
>>         System.out.println(" Content: " + msg.getContent());
>>
>>       }
>>
>>       if (clear)
>>
>>       {
>>
>>         msg.setFlag(Flags.Flag.DELETED, true);
>>
>>       }
>>
>>     }
>>
>>     inbox.close(true);
>>
>>     store.close();
>>
>>     System.out.println();
>>
>>   }
>>
>> }
>>
>>
>> public class JamesConfigTest
>>
>> {
>>
>>   public static void main(String[] args)
>>
>>     throws Exception
>>
>>   {
>>
>>     // CREATE CLIENT INSTANCES
>>
>>     MailClient redClient = new MailClient("red@smo.tld","red",
>> "192.168.55.119");
>>
>>     MailClient greenClient = new MailClient("green@smo.tld", "green",
>> "192.168.55.119");
>>
>>     MailClient blueClient = new MailClient("blue@smo.tld","blue",
>> "192.168.55.119");
>>
>>
>>
>>     // CLEAR EVERYBODY'S INBOX
>>
>>     redClient.checkInbox(MailClient.CLEAR_MESSAGES);
>>
>>     greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
>>
>>     blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
>>
>>     Thread.sleep(500); // Let the server catch up
>>
>>
>>
>>     // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>>
>>     //redClient.getPasswordAuthentication();
>>
>>     redClient.sendMessage(
>>
>>       "garvicee@h5sw.com",
>>
>>       "Testing blue from red",
>>
>>       "This is a test message");
>>
>>     //greenClient.getPasswordAuthentication();
>>
>>     greenClient.sendMessage(
>>
>>       "blue@smo.tld",
>>
>>       "Testing blue from green",
>>
>>       "This is a test message");
>>
>>     Thread.sleep(500); // Let the server catch up
>>
>>
>>
>>     // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>>
>>     blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
>>
>>   }
>>
>> }
>>
>>
>> Here is the output from the console
>>
>>   Exception in thread "main" javax.mail.SendFailedException: Invalid
>> Addresses;
>>
>>   nested exception is:
>>
>> com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Authentication
>> Required
>>
>>
>>   at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>>
>> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>>
>> at javax.mail.Transport.send0(Transport.java:195)
>>
>> at javax.mail.Transport.send(Transport.java:124)
>>
>> at MailClient.sendMessage(MailClient.java:55)
>>
>> at JamesConfigTest.main(JamesConfigTest.java:20)
>>
>> Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1
>> Authentication Required
>>
>>
>>   at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1733)
>>
>> ... 5 more
>>
>> Here is the output in the JamesServer.log:
>>
>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
> established
>> from Garvice-MacBook.local (192.168.55.116)
>>
>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>> org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>>
>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>> org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
>> Required]
>>
>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
>> Garvice-MacBook.local (192.168.55.116)
>>
>>
>> Here is the SMTP:
>>
>> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
> established
>> from Garvice-MacBook.local (192.168.55.116)
>>
>> INFO  13:38:51,477 | james.smtpserver | ID=128768368
>> org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>>
>> INFO  13:38:51,479 | james.smtpserver | ID=128768368
>> org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
>> Required]
>>
>> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
>> Garvice-MacBook.local (192.168.55.116)
>>
>>
>> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>>
>> I get this error message:
>>
>> Exception in thread "main" javax.mail.SendFailedException: Invalid
>> Addresses;
>>
>>   nested exception is:
>>
>> com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
>> Authentication for Specified Email Address
>>
>>
>>   at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>>
>> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>>
>> at javax.mail.Transport.send0(Transport.java:195)
>>
>> at javax.mail.Transport.send(Transport.java:124)
>>
>> at MailClient.sendMessage(MailClient.java:55)
>>
>> at JamesConfigTest.main(JamesConfigTest.java:20)
>>
>> Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1
> Incorrect
>> Authentication for Specified Email Address
>>
>>
>>   at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
>>
>> ... 5 more
>>
>>
>> With these Logfiles:
>>
>> SMTPServer.log
>>
>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
> established
>> from Garvice-MacBook.local (192.168.55.116)
>>
>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>> org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
> result=2
>> (DENY)
>>
>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>> org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>> Authentication for Specified Email Address]
>>
>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
>> Garvice-MacBook.local (192.168.55.116)
>>
>> James-Server.log
>>
>> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
> established
>> from Garvice-MacBook.local (192.168.55.116)
>>
>> INFO  13:38:37,221 | james.smtpserver | ID=192071567
>> org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
> result=2
>> (DENY)
>>
>> INFO  13:38:37,223 | james.smtpserver | ID=192071567
>> org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>> Authentication for Specified Email Address]
>>
>> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
>> Garvice-MacBook.local (192.168.55.116)
>>
>>
>> Any help with this would be great. I'm not really sure what I"m doing
> wrong.
>> I don't know if it's a setting in james or a property I need to set in
>> JavaMail for the Transport.
>>
>> Also here is the SMTPServer.xml file
>>
>> <smtpserver enabled="true">
>>
>>   <bind>0.0.0.0:25</bind>
>>
>>   <connectionBacklog>200</connectionBacklog>
>>
>>   <tls socketTLS="false" startTLS="false">
>>
>>   </tls>
>>
>>   <connectiontimeout>360</connectiontimeout>
>>
>>   <connectionLimit>  0</connectionLimit>
>>
>>   <connectionLimitPerIP>  0</connectionLimitPerIP>
>>
>>   <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
>>
>>   <authRequired>false</authRequired>
>>
>>   <verifyIdentity>false</verifyIdentity>
>>
>>   <maxmessagesize>0</maxmessagesize>
>>
>>   <addressBracketsEnforcement>true</addressBracketsEnforcement>
>>
>>   <handlerchain enableJmx="true">
>>
>>     <handler
> class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
>>
>>     <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
>>
>>
>>   </handlerchain>
>>
>> </smtpserver>
>>
>

-- 
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Norman Maurer <no...@googlemail.com>.
The problem is that you try to send to "blue" and not "blue@smo.tld".
If you want to have "smo.tld" used if there is not domainpart in the
recipient then you need to specify it as default domain in the
domainlist.xml.


Bye,
Norman


2011/10/17 Garvice Eakins <ga...@gmail.com>:
> I am using James 3 Beta 3. The users do exist, (except not the recipient of
> one, that is an external email with google as the provider)
> bash james-cli.sh -h localhost -p 9999 listusers
> blue@smo.tld
> green@smo.tld
> red@smo.tld
> test@smo.tld
>
> listusers command executed sucessfully in 539 ms.
>
> I am able to access James Server from the terminal and send out an email
> using telnet, which works just fine.
>
> ~Garvice
>
>
> On Sat, Oct 15, 2011 at 12:27 AM, Norman Maurer <
> norman.maurer@googlemail.com> wrote:
>
>> Hi there,
>>
>> what exact version you are using? also are you sure the recipients exist at
>> the james server or do you try to deliver the mailmto a remote smtpserver?
>>
>> bye
>> norman
>>
>> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins <
>> garviceeakins@gmail.com
>> >:
>> > I am having problems sending SMTP messages from James3.0 using a simple
>> java
>> > application using javamail.
>> >
>> > Here is the example I am using
>> >
>> > public class MailClient
>> >
>> >  extends Authenticator{
>> >
>> >  public static final int SHOW_MESSAGES = 1;
>> >
>> >  public static final int CLEAR_MESSAGES = 2;
>> >
>> >  public static final int SHOW_AND_CLEAR =
>> >
>> >    SHOW_MESSAGES + CLEAR_MESSAGES;
>> >
>> >  protected String from;
>> >
>> >  protected Session session;
>> >
>> >  protected PasswordAuthentication authentication;
>> >
>> >
>> > public MailClient(String user, String pass, String host)  {
>> >
>> >    this(user, pass, host, false);
>> >
>> >  }
>> >
>> >  public MailClient(String user, String pass, String host, boolean debug){
>> >
>> >    from = user + '@' + host;
>> >
>> >    authentication = new PasswordAuthentication(user, pass);
>> >
>> >    Properties props = new Properties();
>> >
>> >    props.put("mail.user", user);
>> >
>> >    props.put("mail.host", host);
>> >
>> >    props.put("mail.debug", debug ? "true" : "false");
>> >
>> >    props.put("mail.store.protocol", "pop3");
>> >
>> >    props.put("mail.transport.protocol", "smtp");
>> >
>> >    //props.put("mail.smtp.auth", "true");
>> >
>> >    session = Session.getInstance(props, this);
>> >
>> >  }
>> >
>> >
>> >
>> >  public PasswordAuthentication getPasswordAuthentication(){
>> >
>> >    return authentication;
>> >
>> >  }
>> >
>> >
>> >
>> >  public void sendMessage(
>> >
>> >    String to, String subject, String content)
>> >
>> >      throws MessagingException
>> >
>> >  {
>> >
>> >    System.out.println("SENDING message from " + from + " to " + to);
>> >
>> >    System.out.println();
>> >
>> >    MimeMessage msg = new MimeMessage(session);
>> >
>> >    msg.setFrom(new InternetAddress(from));
>> >
>> >    msg.addRecipients(Message.RecipientType.TO, to);
>> >
>> >    msg.setSubject(subject);
>> >
>> >    msg.setText(content);
>> >
>> >    Transport.send(msg);
>> >
>> >  }
>> >
>> >
>> >
>> >  public void checkInbox(int mode)
>> >
>> >    throws MessagingException, IOException
>> >
>> >  {
>> >
>> >    if (mode == 0) return;
>> >
>> >    boolean show = (mode & SHOW_MESSAGES) > 0;
>> >
>> >    boolean clear = (mode & CLEAR_MESSAGES) > 0;
>> >
>> >    String action =
>> >
>> >      (show ? "Show" : "") +
>> >
>> >      (show && clear ? " and " : "") +
>> >
>> >      (clear ? "Clear" : "");
>> >
>> >    System.out.println(action + " INBOX for " + from);
>> >
>> >    Store store = session.getStore();
>> >
>> >    store.connect();
>> >
>> >    Folder root = store.getDefaultFolder();
>> >
>> >    Folder inbox = root.getFolder("inbox");
>> >
>> >    inbox.open(Folder.READ_WRITE);
>> >
>> >    Message[] msgs = inbox.getMessages();
>> >
>> >    if (msgs.length == 0 && show)
>> >
>> >    {
>> >
>> >      System.out.println("No messages in inbox");
>> >
>> >    }
>> >
>> >    for (int i = 0; i < msgs.length; i++)
>> >
>> >    {
>> >
>> >      MimeMessage msg = (MimeMessage)msgs[i];
>> >
>> >      if (show)
>> >
>> >      {
>> >
>> >        System.out.println("    From: " + msg.getFrom()[0]);
>> >
>> >        System.out.println(" Subject: " + msg.getSubject());
>> >
>> >        System.out.println(" Content: " + msg.getContent());
>> >
>> >      }
>> >
>> >      if (clear)
>> >
>> >      {
>> >
>> >        msg.setFlag(Flags.Flag.DELETED, true);
>> >
>> >      }
>> >
>> >    }
>> >
>> >    inbox.close(true);
>> >
>> >    store.close();
>> >
>> >    System.out.println();
>> >
>> >  }
>> >
>> > }
>> >
>> >
>> > public class JamesConfigTest
>> >
>> > {
>> >
>> >  public static void main(String[] args)
>> >
>> >    throws Exception
>> >
>> >  {
>> >
>> >    // CREATE CLIENT INSTANCES
>> >
>> >    MailClient redClient = new MailClient("red@smo.tld","red",
>> > "192.168.55.119");
>> >
>> >    MailClient greenClient = new MailClient("green@smo.tld", "green",
>> > "192.168.55.119");
>> >
>> >    MailClient blueClient = new MailClient("blue@smo.tld","blue",
>> > "192.168.55.119");
>> >
>> >
>> >
>> >    // CLEAR EVERYBODY'S INBOX
>> >
>> >    redClient.checkInbox(MailClient.CLEAR_MESSAGES);
>> >
>> >    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
>> >
>> >    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
>> >
>> >    Thread.sleep(500); // Let the server catch up
>> >
>> >
>> >
>> >    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>> >
>> >    //redClient.getPasswordAuthentication();
>> >
>> >    redClient.sendMessage(
>> >
>> >      "garvicee@h5sw.com",
>> >
>> >      "Testing blue from red",
>> >
>> >      "This is a test message");
>> >
>> >    //greenClient.getPasswordAuthentication();
>> >
>> >    greenClient.sendMessage(
>> >
>> >      "blue@smo.tld",
>> >
>> >      "Testing blue from green",
>> >
>> >      "This is a test message");
>> >
>> >    Thread.sleep(500); // Let the server catch up
>> >
>> >
>> >
>> >    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>> >
>> >    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
>> >
>> >  }
>> >
>> > }
>> >
>> >
>> > Here is the output from the console
>> >
>> >  Exception in thread "main" javax.mail.SendFailedException: Invalid
>> > Addresses;
>> >
>> >  nested exception is:
>> >
>> > com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Authentication
>> > Required
>> >
>> >
>> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>> >
>> > at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>> >
>> > at javax.mail.Transport.send0(Transport.java:195)
>> >
>> > at javax.mail.Transport.send(Transport.java:124)
>> >
>> > at MailClient.sendMessage(MailClient.java:55)
>> >
>> > at JamesConfigTest.main(JamesConfigTest.java:20)
>> >
>> > Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1
>> > Authentication Required
>> >
>> >
>> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1733)
>> >
>> > ... 5 more
>> >
>> > Here is the output in the JamesServer.log:
>> >
>> > INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>> established
>> > from Garvice-MacBook.local (192.168.55.116)
>> >
>> > INFO  13:38:51,477 | james.smtpserver | ID=128768368
>> > org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>> >
>> > INFO  13:38:51,479 | james.smtpserver | ID=128768368
>> > org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1
>> Authentication
>> > Required]
>> >
>> > INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>> for
>> > Garvice-MacBook.local (192.168.55.116)
>> >
>> >
>> > Here is the SMTP:
>> >
>> > INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
>> established
>> > from Garvice-MacBook.local (192.168.55.116)
>> >
>> > INFO  13:38:51,477 | james.smtpserver | ID=128768368
>> > org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>> >
>> > INFO  13:38:51,479 | james.smtpserver | ID=128768368
>> > org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1
>> Authentication
>> > Required]
>> >
>> > INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
>> for
>> > Garvice-MacBook.local (192.168.55.116)
>> >
>> >
>> > If I uncomment the line  //props.put("mail.smtp.auth", "true");
>> >
>> > I get this error message:
>> >
>> > Exception in thread "main" javax.mail.SendFailedException: Invalid
>> > Addresses;
>> >
>> >  nested exception is:
>> >
>> > com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
>> > Authentication for Specified Email Address
>> >
>> >
>> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>> >
>> > at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>> >
>> > at javax.mail.Transport.send0(Transport.java:195)
>> >
>> > at javax.mail.Transport.send(Transport.java:124)
>> >
>> > at MailClient.sendMessage(MailClient.java:55)
>> >
>> > at JamesConfigTest.main(JamesConfigTest.java:20)
>> >
>> > Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1
>> Incorrect
>> > Authentication for Specified Email Address
>> >
>> >
>> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
>> >
>> > ... 5 more
>> >
>> >
>> > With these Logfiles:
>> >
>> > SMTPServer.log
>> >
>> > INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>> established
>> > from Garvice-MacBook.local (192.168.55.116)
>> >
>> > INFO  13:38:37,221 | james.smtpserver | ID=192071567
>> > org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
>> result=2
>> > (DENY)
>> >
>> > INFO  13:38:37,223 | james.smtpserver | ID=192071567
>> > org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>> > Authentication for Specified Email Address]
>> >
>> > INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>> for
>> > Garvice-MacBook.local (192.168.55.116)
>> >
>> > James-Server.log
>> >
>> > INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
>> established
>> > from Garvice-MacBook.local (192.168.55.116)
>> >
>> > INFO  13:38:37,221 | james.smtpserver | ID=192071567
>> > org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
>> result=2
>> > (DENY)
>> >
>> > INFO  13:38:37,223 | james.smtpserver | ID=192071567
>> > org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
>> > Authentication for Specified Email Address]
>> >
>> > INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
>> for
>> > Garvice-MacBook.local (192.168.55.116)
>> >
>> >
>> > Any help with this would be great. I'm not really sure what I"m doing
>> wrong.
>> > I don't know if it's a setting in james or a property I need to set in
>> > JavaMail for the Transport.
>> >
>> > Also here is the SMTPServer.xml file
>> >
>> > <smtpserver enabled="true">
>> >
>> >  <bind>0.0.0.0:25</bind>
>> >
>> >  <connectionBacklog>200</connectionBacklog>
>> >
>> >  <tls socketTLS="false" startTLS="false">
>> >
>> >  </tls>
>> >
>> >  <connectiontimeout>360</connectiontimeout>
>> >
>> >  <connectionLimit> 0 </connectionLimit>
>> >
>> >  <connectionLimitPerIP> 0 </connectionLimitPerIP>
>> >
>> >  <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
>> >
>> >  <authRequired>false</authRequired>
>> >
>> >  <verifyIdentity>false</verifyIdentity>
>> >
>> >  <maxmessagesize>0</maxmessagesize>
>> >
>> >  <addressBracketsEnforcement>true</addressBracketsEnforcement>
>> >
>> >  <handlerchain enableJmx="true">
>> >
>> >    <handler
>> class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
>> >
>> >    <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
>> >
>> >
>> >  </handlerchain>
>> >
>> > </smtpserver>
>> >
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Authentication errors SMTP

Posted by Garvice Eakins <ga...@gmail.com>.
I am using James 3 Beta 3. The users do exist, (except not the recipient of
one, that is an external email with google as the provider)
bash james-cli.sh -h localhost -p 9999 listusers
blue@smo.tld
green@smo.tld
red@smo.tld
test@smo.tld

listusers command executed sucessfully in 539 ms.

I am able to access James Server from the terminal and send out an email
using telnet, which works just fine.

~Garvice


On Sat, Oct 15, 2011 at 12:27 AM, Norman Maurer <
norman.maurer@googlemail.com> wrote:

> Hi there,
>
> what exact version you are using? also are you sure the recipients exist at
> the james server or do you try to deliver the mailmto a remote smtpserver?
>
> bye
> norman
>
> Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins <
> garviceeakins@gmail.com
> >:
> > I am having problems sending SMTP messages from James3.0 using a simple
> java
> > application using javamail.
> >
> > Here is the example I am using
> >
> > public class MailClient
> >
> >  extends Authenticator{
> >
> >  public static final int SHOW_MESSAGES = 1;
> >
> >  public static final int CLEAR_MESSAGES = 2;
> >
> >  public static final int SHOW_AND_CLEAR =
> >
> >    SHOW_MESSAGES + CLEAR_MESSAGES;
> >
> >  protected String from;
> >
> >  protected Session session;
> >
> >  protected PasswordAuthentication authentication;
> >
> >
> > public MailClient(String user, String pass, String host)  {
> >
> >    this(user, pass, host, false);
> >
> >  }
> >
> >  public MailClient(String user, String pass, String host, boolean debug){
> >
> >    from = user + '@' + host;
> >
> >    authentication = new PasswordAuthentication(user, pass);
> >
> >    Properties props = new Properties();
> >
> >    props.put("mail.user", user);
> >
> >    props.put("mail.host", host);
> >
> >    props.put("mail.debug", debug ? "true" : "false");
> >
> >    props.put("mail.store.protocol", "pop3");
> >
> >    props.put("mail.transport.protocol", "smtp");
> >
> >    //props.put("mail.smtp.auth", "true");
> >
> >    session = Session.getInstance(props, this);
> >
> >  }
> >
> >
> >
> >  public PasswordAuthentication getPasswordAuthentication(){
> >
> >    return authentication;
> >
> >  }
> >
> >
> >
> >  public void sendMessage(
> >
> >    String to, String subject, String content)
> >
> >      throws MessagingException
> >
> >  {
> >
> >    System.out.println("SENDING message from " + from + " to " + to);
> >
> >    System.out.println();
> >
> >    MimeMessage msg = new MimeMessage(session);
> >
> >    msg.setFrom(new InternetAddress(from));
> >
> >    msg.addRecipients(Message.RecipientType.TO, to);
> >
> >    msg.setSubject(subject);
> >
> >    msg.setText(content);
> >
> >    Transport.send(msg);
> >
> >  }
> >
> >
> >
> >  public void checkInbox(int mode)
> >
> >    throws MessagingException, IOException
> >
> >  {
> >
> >    if (mode == 0) return;
> >
> >    boolean show = (mode & SHOW_MESSAGES) > 0;
> >
> >    boolean clear = (mode & CLEAR_MESSAGES) > 0;
> >
> >    String action =
> >
> >      (show ? "Show" : "") +
> >
> >      (show && clear ? " and " : "") +
> >
> >      (clear ? "Clear" : "");
> >
> >    System.out.println(action + " INBOX for " + from);
> >
> >    Store store = session.getStore();
> >
> >    store.connect();
> >
> >    Folder root = store.getDefaultFolder();
> >
> >    Folder inbox = root.getFolder("inbox");
> >
> >    inbox.open(Folder.READ_WRITE);
> >
> >    Message[] msgs = inbox.getMessages();
> >
> >    if (msgs.length == 0 && show)
> >
> >    {
> >
> >      System.out.println("No messages in inbox");
> >
> >    }
> >
> >    for (int i = 0; i < msgs.length; i++)
> >
> >    {
> >
> >      MimeMessage msg = (MimeMessage)msgs[i];
> >
> >      if (show)
> >
> >      {
> >
> >        System.out.println("    From: " + msg.getFrom()[0]);
> >
> >        System.out.println(" Subject: " + msg.getSubject());
> >
> >        System.out.println(" Content: " + msg.getContent());
> >
> >      }
> >
> >      if (clear)
> >
> >      {
> >
> >        msg.setFlag(Flags.Flag.DELETED, true);
> >
> >      }
> >
> >    }
> >
> >    inbox.close(true);
> >
> >    store.close();
> >
> >    System.out.println();
> >
> >  }
> >
> > }
> >
> >
> > public class JamesConfigTest
> >
> > {
> >
> >  public static void main(String[] args)
> >
> >    throws Exception
> >
> >  {
> >
> >    // CREATE CLIENT INSTANCES
> >
> >    MailClient redClient = new MailClient("red@smo.tld","red",
> > "192.168.55.119");
> >
> >    MailClient greenClient = new MailClient("green@smo.tld", "green",
> > "192.168.55.119");
> >
> >    MailClient blueClient = new MailClient("blue@smo.tld","blue",
> > "192.168.55.119");
> >
> >
> >
> >    // CLEAR EVERYBODY'S INBOX
> >
> >    redClient.checkInbox(MailClient.CLEAR_MESSAGES);
> >
> >    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
> >
> >    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
> >
> >    Thread.sleep(500); // Let the server catch up
> >
> >
> >
> >    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
> >
> >    //redClient.getPasswordAuthentication();
> >
> >    redClient.sendMessage(
> >
> >      "garvicee@h5sw.com",
> >
> >      "Testing blue from red",
> >
> >      "This is a test message");
> >
> >    //greenClient.getPasswordAuthentication();
> >
> >    greenClient.sendMessage(
> >
> >      "blue@smo.tld",
> >
> >      "Testing blue from green",
> >
> >      "This is a test message");
> >
> >    Thread.sleep(500); // Let the server catch up
> >
> >
> >
> >    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
> >
> >    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
> >
> >  }
> >
> > }
> >
> >
> > Here is the output from the console
> >
> >  Exception in thread "main" javax.mail.SendFailedException: Invalid
> > Addresses;
> >
> >  nested exception is:
> >
> > com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Authentication
> > Required
> >
> >
> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
> >
> > at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
> >
> > at javax.mail.Transport.send0(Transport.java:195)
> >
> > at javax.mail.Transport.send(Transport.java:124)
> >
> > at MailClient.sendMessage(MailClient.java:55)
> >
> > at JamesConfigTest.main(JamesConfigTest.java:20)
> >
> > Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1
> > Authentication Required
> >
> >
> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1733)
> >
> > ... 5 more
> >
> > Here is the output in the JamesServer.log:
> >
> > INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
> established
> > from Garvice-MacBook.local (192.168.55.116)
> >
> > INFO  13:38:51,477 | james.smtpserver | ID=128768368
> > org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
> >
> > INFO  13:38:51,479 | james.smtpserver | ID=128768368
> > org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1
> Authentication
> > Required]
> >
> > INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
> for
> > Garvice-MacBook.local (192.168.55.116)
> >
> >
> > Here is the SMTP:
> >
> > INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
> established
> > from Garvice-MacBook.local (192.168.55.116)
> >
> > INFO  13:38:51,477 | james.smtpserver | ID=128768368
> > org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
> >
> > INFO  13:38:51,479 | james.smtpserver | ID=128768368
> > org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1
> Authentication
> > Required]
> >
> > INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed
> for
> > Garvice-MacBook.local (192.168.55.116)
> >
> >
> > If I uncomment the line  //props.put("mail.smtp.auth", "true");
> >
> > I get this error message:
> >
> > Exception in thread "main" javax.mail.SendFailedException: Invalid
> > Addresses;
> >
> >  nested exception is:
> >
> > com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
> > Authentication for Specified Email Address
> >
> >
> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
> >
> > at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
> >
> > at javax.mail.Transport.send0(Transport.java:195)
> >
> > at javax.mail.Transport.send(Transport.java:124)
> >
> > at MailClient.sendMessage(MailClient.java:55)
> >
> > at JamesConfigTest.main(JamesConfigTest.java:20)
> >
> > Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1
> Incorrect
> > Authentication for Specified Email Address
> >
> >
> >  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
> >
> > ... 5 more
> >
> >
> > With these Logfiles:
> >
> > SMTPServer.log
> >
> > INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
> established
> > from Garvice-MacBook.local (192.168.55.116)
> >
> > INFO  13:38:37,221 | james.smtpserver | ID=192071567
> > org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
> result=2
> > (DENY)
> >
> > INFO  13:38:37,223 | james.smtpserver | ID=192071567
> > org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
> > Authentication for Specified Email Address]
> >
> > INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
> for
> > Garvice-MacBook.local (192.168.55.116)
> >
> > James-Server.log
> >
> > INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
> established
> > from Garvice-MacBook.local (192.168.55.116)
> >
> > INFO  13:38:37,221 | james.smtpserver | ID=192071567
> > org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
> result=2
> > (DENY)
> >
> > INFO  13:38:37,223 | james.smtpserver | ID=192071567
> > org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
> > Authentication for Specified Email Address]
> >
> > INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed
> for
> > Garvice-MacBook.local (192.168.55.116)
> >
> >
> > Any help with this would be great. I'm not really sure what I"m doing
> wrong.
> > I don't know if it's a setting in james or a property I need to set in
> > JavaMail for the Transport.
> >
> > Also here is the SMTPServer.xml file
> >
> > <smtpserver enabled="true">
> >
> >  <bind>0.0.0.0:25</bind>
> >
> >  <connectionBacklog>200</connectionBacklog>
> >
> >  <tls socketTLS="false" startTLS="false">
> >
> >  </tls>
> >
> >  <connectiontimeout>360</connectiontimeout>
> >
> >  <connectionLimit> 0 </connectionLimit>
> >
> >  <connectionLimitPerIP> 0 </connectionLimitPerIP>
> >
> >  <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
> >
> >  <authRequired>false</authRequired>
> >
> >  <verifyIdentity>false</verifyIdentity>
> >
> >  <maxmessagesize>0</maxmessagesize>
> >
> >  <addressBracketsEnforcement>true</addressBracketsEnforcement>
> >
> >  <handlerchain enableJmx="true">
> >
> >    <handler
> class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
> >
> >    <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
> >
> >
> >  </handlerchain>
> >
> > </smtpserver>
> >
>

Re: Authentication errors SMTP

Posted by Norman Maurer <no...@googlemail.com>.
Hi there,

what exact version you are using? also are you sure the recipients exist at
the james server or do you try to deliver the mailmto a remote smtpserver?

bye
norman

Am Freitag, 14. Oktober 2011 schrieb Garvice Eakins <garviceeakins@gmail.com
>:
> I am having problems sending SMTP messages from James3.0 using a simple
java
> application using javamail.
>
> Here is the example I am using
>
> public class MailClient
>
>  extends Authenticator{
>
>  public static final int SHOW_MESSAGES = 1;
>
>  public static final int CLEAR_MESSAGES = 2;
>
>  public static final int SHOW_AND_CLEAR =
>
>    SHOW_MESSAGES + CLEAR_MESSAGES;
>
>  protected String from;
>
>  protected Session session;
>
>  protected PasswordAuthentication authentication;
>
>
> public MailClient(String user, String pass, String host)  {
>
>    this(user, pass, host, false);
>
>  }
>
>  public MailClient(String user, String pass, String host, boolean debug){
>
>    from = user + '@' + host;
>
>    authentication = new PasswordAuthentication(user, pass);
>
>    Properties props = new Properties();
>
>    props.put("mail.user", user);
>
>    props.put("mail.host", host);
>
>    props.put("mail.debug", debug ? "true" : "false");
>
>    props.put("mail.store.protocol", "pop3");
>
>    props.put("mail.transport.protocol", "smtp");
>
>    //props.put("mail.smtp.auth", "true");
>
>    session = Session.getInstance(props, this);
>
>  }
>
>
>
>  public PasswordAuthentication getPasswordAuthentication(){
>
>    return authentication;
>
>  }
>
>
>
>  public void sendMessage(
>
>    String to, String subject, String content)
>
>      throws MessagingException
>
>  {
>
>    System.out.println("SENDING message from " + from + " to " + to);
>
>    System.out.println();
>
>    MimeMessage msg = new MimeMessage(session);
>
>    msg.setFrom(new InternetAddress(from));
>
>    msg.addRecipients(Message.RecipientType.TO, to);
>
>    msg.setSubject(subject);
>
>    msg.setText(content);
>
>    Transport.send(msg);
>
>  }
>
>
>
>  public void checkInbox(int mode)
>
>    throws MessagingException, IOException
>
>  {
>
>    if (mode == 0) return;
>
>    boolean show = (mode & SHOW_MESSAGES) > 0;
>
>    boolean clear = (mode & CLEAR_MESSAGES) > 0;
>
>    String action =
>
>      (show ? "Show" : "") +
>
>      (show && clear ? " and " : "") +
>
>      (clear ? "Clear" : "");
>
>    System.out.println(action + " INBOX for " + from);
>
>    Store store = session.getStore();
>
>    store.connect();
>
>    Folder root = store.getDefaultFolder();
>
>    Folder inbox = root.getFolder("inbox");
>
>    inbox.open(Folder.READ_WRITE);
>
>    Message[] msgs = inbox.getMessages();
>
>    if (msgs.length == 0 && show)
>
>    {
>
>      System.out.println("No messages in inbox");
>
>    }
>
>    for (int i = 0; i < msgs.length; i++)
>
>    {
>
>      MimeMessage msg = (MimeMessage)msgs[i];
>
>      if (show)
>
>      {
>
>        System.out.println("    From: " + msg.getFrom()[0]);
>
>        System.out.println(" Subject: " + msg.getSubject());
>
>        System.out.println(" Content: " + msg.getContent());
>
>      }
>
>      if (clear)
>
>      {
>
>        msg.setFlag(Flags.Flag.DELETED, true);
>
>      }
>
>    }
>
>    inbox.close(true);
>
>    store.close();
>
>    System.out.println();
>
>  }
>
> }
>
>
> public class JamesConfigTest
>
> {
>
>  public static void main(String[] args)
>
>    throws Exception
>
>  {
>
>    // CREATE CLIENT INSTANCES
>
>    MailClient redClient = new MailClient("red@smo.tld","red",
> "192.168.55.119");
>
>    MailClient greenClient = new MailClient("green@smo.tld", "green",
> "192.168.55.119");
>
>    MailClient blueClient = new MailClient("blue@smo.tld","blue",
> "192.168.55.119");
>
>
>
>    // CLEAR EVERYBODY'S INBOX
>
>    redClient.checkInbox(MailClient.CLEAR_MESSAGES);
>
>    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
>
>    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
>
>    Thread.sleep(500); // Let the server catch up
>
>
>
>    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
>
>    //redClient.getPasswordAuthentication();
>
>    redClient.sendMessage(
>
>      "garvicee@h5sw.com",
>
>      "Testing blue from red",
>
>      "This is a test message");
>
>    //greenClient.getPasswordAuthentication();
>
>    greenClient.sendMessage(
>
>      "blue@smo.tld",
>
>      "Testing blue from green",
>
>      "This is a test message");
>
>    Thread.sleep(500); // Let the server catch up
>
>
>
>    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
>
>    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
>
>  }
>
> }
>
>
> Here is the output from the console
>
>  Exception in thread "main" javax.mail.SendFailedException: Invalid
> Addresses;
>
>  nested exception is:
>
> com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1 Authentication
> Required
>
>
>  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>
> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>
> at javax.mail.Transport.send0(Transport.java:195)
>
> at javax.mail.Transport.send(Transport.java:124)
>
> at MailClient.sendMessage(MailClient.java:55)
>
> at JamesConfigTest.main(JamesConfigTest.java:20)
>
> Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 530 5.7.1
> Authentication Required
>
>
>  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1733)
>
> ... 5 more
>
> Here is the output in the JamesServer.log:
>
> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
established
> from Garvice-MacBook.local (192.168.55.116)
>
> INFO  13:38:51,477 | james.smtpserver | ID=128768368
> org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>
> INFO  13:38:51,479 | james.smtpserver | ID=128768368
> org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
> Required]
>
> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
> Garvice-MacBook.local (192.168.55.116)
>
>
> Here is the SMTP:
>
> INFO  13:38:51,436 | james.smtpserver | ID=128768368 Connection
established
> from Garvice-MacBook.local (192.168.55.116)
>
> INFO  13:38:51,477 | james.smtpserver | ID=128768368
> org.apache.james.smtpserver.AuthRequiredToRelayRcptHook: result=2 (DENY)
>
> INFO  13:38:51,479 | james.smtpserver | ID=128768368
> org.apache.james.smtpserver.JamesRcptCmdHandler: 530 [5.7.1 Authentication
> Required]
>
> INFO  13:38:51,496 | james.smtpserver | ID=128768368 Connection closed for
> Garvice-MacBook.local (192.168.55.116)
>
>
> If I uncomment the line  //props.put("mail.smtp.auth", "true");
>
> I get this error message:
>
> Exception in thread "main" javax.mail.SendFailedException: Invalid
> Addresses;
>
>  nested exception is:
>
> com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect
> Authentication for Specified Email Address
>
>
>  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835)
>
> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098)
>
> at javax.mail.Transport.send0(Transport.java:195)
>
> at javax.mail.Transport.send(Transport.java:124)
>
> at MailClient.sendMessage(MailClient.java:55)
>
> at JamesConfigTest.main(JamesConfigTest.java:20)
>
> Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1
Incorrect
> Authentication for Specified Email Address
>
>
>  at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686)
>
> ... 5 more
>
>
> With these Logfiles:
>
> SMTPServer.log
>
> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
established
> from Garvice-MacBook.local (192.168.55.116)
>
> INFO  13:38:37,221 | james.smtpserver | ID=192071567
> org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
result=2
> (DENY)
>
> INFO  13:38:37,223 | james.smtpserver | ID=192071567
> org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
> Authentication for Specified Email Address]
>
> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
> Garvice-MacBook.local (192.168.55.116)
>
> James-Server.log
>
> INFO  13:38:37,155 | james.smtpserver | ID=192071567 Connection
established
> from Garvice-MacBook.local (192.168.55.116)
>
> INFO  13:38:37,221 | james.smtpserver | ID=192071567
> org.apache.james.smtpserver.SenderAuthIdentifyVerificationRcptHook:
result=2
> (DENY)
>
> INFO  13:38:37,223 | james.smtpserver | ID=192071567
> org.apache.james.smtpserver.JamesRcptCmdHandler: 503 [5.7.1 Incorrect
> Authentication for Specified Email Address]
>
> INFO  13:38:37,248 | james.smtpserver | ID=192071567 Connection closed for
> Garvice-MacBook.local (192.168.55.116)
>
>
> Any help with this would be great. I'm not really sure what I"m doing
wrong.
> I don't know if it's a setting in james or a property I need to set in
> JavaMail for the Transport.
>
> Also here is the SMTPServer.xml file
>
> <smtpserver enabled="true">
>
>  <bind>0.0.0.0:25</bind>
>
>  <connectionBacklog>200</connectionBacklog>
>
>  <tls socketTLS="false" startTLS="false">
>
>  </tls>
>
>  <connectiontimeout>360</connectiontimeout>
>
>  <connectionLimit> 0 </connectionLimit>
>
>  <connectionLimitPerIP> 0 </connectionLimitPerIP>
>
>  <authorizedAddresses>127.0.0.0/8</authorizedAddresses>
>
>  <authRequired>false</authRequired>
>
>  <verifyIdentity>false</verifyIdentity>
>
>  <maxmessagesize>0</maxmessagesize>
>
>  <addressBracketsEnforcement>true</addressBracketsEnforcement>
>
>  <handlerchain enableJmx="true">
>
>    <handler
class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
>
>    <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
>
>
>  </handlerchain>
>
> </smtpserver>
>