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 Olga Agady <oa...@yahoo.com> on 2002/12/26 08:38:58 UTC

Adding user from external application

Hi, 

I am trying to figure out how I can add a user
programmatically from a web application. Could someone
give me a hint how I could get a reference  to James
(probably to RemoteManagerHandler) from an external
application (not using telnet). 

Thanks in advance for any help

Agady

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Adding user from external application

Posted by Olga Agady <oa...@yahoo.com>.
Thanks for help. I believe that adding users to the
database is the easiest way. But Harmeet's
ProtocolSimulator is also very helpful since I will
also have to send email messages programmatically from
my web application.

Thanks
Olga Agady

--- Harmeet Bedi <ha...@kodemuse.com> wrote:
> ----- Original Message -----
> From: "simon" <si...@sydneybluegum.com>
> > Only issue is setting the password.
> > You could hard code one in your insert statement
> or use the java to
> > encode it.
> >
> > Some thing like the following java  or maybe it
> might possible to encode
> > it with java script.
> 
> This is a pretty standard approach. I believe yahoo
> and hotmail do this.
> Look at view source, on page http://mail.yahoo.com/
> look for 'function MD5(str)'
> 
> Harmeet
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Adding user from external application

Posted by Harmeet Bedi <ha...@kodemuse.com>.
----- Original Message -----
From: "simon" <si...@sydneybluegum.com>
> Only issue is setting the password.
> You could hard code one in your insert statement or use the java to
> encode it.
>
> Some thing like the following java  or maybe it might possible to encode
> it with java script.

This is a pretty standard approach. I believe yahoo and hotmail do this.
Look at view source, on page http://mail.yahoo.com/
look for 'function MD5(str)'

Harmeet


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Configuration Issues

Posted by Alan Gerhard <al...@GerCom.Com>.
thanks Serge, that makes sense ...

but -

i must have done something wrong with the configuration or something.
i have 1,825 mails, more or less addressed to a user that does not exist - from
that user.
obviously a spoof and spam, but what seemed to happen was that james20A3 went
into a loop and these 1825 just got bigger and bigger - and with the dat files i
was looking at close to 200,000 plus files on a WinTel box and james really
didn't like that.

the following is an example of what was being generated - and the logs have been
trashed (version 20A3) but this seems to be the pattern.

with your explanation, the return-path should be empty, right ??

anyway, was just wondering if any of you guys know what might have went wrong so
i can prevent this from happening again.
tnx ...

START***************************************************************************
**********************
Return-Path: <jo...@james.com>
Received: from james.com ([xxx.xxx.xxx.xxx])
          by mail.james.com (JAMES SMTP Server 2.0a3) with SMTP ID 603
          for <jo...@james.com>;
          Mon, 23 Dec 2002 11:33:19 -0500
Received: from james.com ([xxx.xxx.xxx.xxx])
          by mail.james.com (JAMES SMTP Server 2.0a3) with SMTP ID 950
          for <jo...@james.com>;
          Mon, 23 Dec 2002 10:42:37 -0500
Received: from james.com ([xxx.xxx.xxx.xxx])
          by mail.james.com (JAMES SMTP Server 2.0a3) with SMTP ID 600
          for <jo...@james.com>;
          Mon, 23 Dec 2002 10:42:27 -0500
Received: from james.com ([xxx.xxx.xxx.xxx])
          by mail.james.com (JAMES SMTP Server 2.0a3) with SMTP ID 440
          for <jo...@james.com>;
          Mon, 23 Dec 2002 10:23:02 -0500
Message-ID: <84716.1040654325783.JavaMail.SYSTEM@[machine-name]>
Date: Mon, 23 Dec 2002 09:38:45 -0500
From: john@james.com
To: john@james.com
Subject: Re: Re:Avalanche Sweepstakes!
In-Reply-To: <6075280.1040654323861.JavaMail.SYSTEM@[machine-name]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_Part_5508_8014776.1040654325752"

------=_Part_5508_8014776.1040654325752
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

We were unable to deliver the attached message because of an error in the mail
server.

Message details:
  Subject: Re: Re:Avalanche Sweepstakes!
  Sent date: Mon Dec 23 09:38:43 EST 2002
  To: john@james.com
  Size (in bytes): 20579

------=_Part_5508_8014776.1040654325752
Content-Type: multipart/mixed;
	boundary="----=_Part_5490_2409243.1040654323814"

------=_Part_5490_2409243.1040654323814
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

We were unable to deliver the attached message because of an error in the mail
server.

Message details:
  Subject: Re: Re:Avalanche Sweepstakes!
  Sent date: Mon Dec 23 09:34:46 EST 2002
  To: john@james.com
  Size (in bytes): 20059
ENDRT***************************************************************************
**********************


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Configuration Issues

Posted by Serge Knystautas <se...@lokitech.com>.
Alan Gerhard wrote:
> an email was sent to john@james.com with a sender of john@james.com but
> john@james.com does not exist so after the isLocalHost fails, i want to
> notifySender that the address does not exist, but in this case, i get this loop
> that goes on forever ...
> 
> over the holidays, 100,000 mails took down my James 20A3 - yes James2100 is now
> up and running...
> 
> i want to notify the sender that the address they used is faulty but do not want
> to be caught with the endless loop
> 
> any suggestions on ways to process this ??
> 
> alan

There shouldn't be any risk of loop.  You get past isLocalHost, then you 
notifySender... that message is sent to john@james.com with a sender of 
<>, because it is a server-side generated notice.  This message then 
gets sent to you, it again goes through and fails isLocalHost, and then 
reaches notifySender which will swallow the message since it can't send 
a failure notice to <>.

I don't know how to configure the notify sender mailet off-hand, but 
that's logically how this situation is resolved.

Serge Knystautas
Loki Technologies
http://www.lokitech.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Configuration Issues

Posted by Alan Gerhard <al...@GerCom.Com>.
an email was sent to john@james.com with a sender of john@james.com but
john@james.com does not exist so after the isLocalHost fails, i want to
notifySender that the address does not exist, but in this case, i get this loop
that goes on forever ...

over the holidays, 100,000 mails took down my James 20A3 - yes James2100 is now
up and running...

i want to notify the sender that the address they used is faulty but do not want
to be caught with the endless loop

any suggestions on ways to process this ??

alan


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Adding user from external application

Posted by simon <si...@sydneybluegum.com>.
Second option is to store your users in a database.
James creates a table called users.

You could create a web server page to update this database table.
First step is to setup users table with james and have a look at the 
data in the table.

I use tomcat with a jsp page to add users to may james on win 2000.

Only issue is setting the password.
You could hard code one in your insert statement or use the java to 
encode it.

Some thing like the following java  or maybe it might possible to encode 
it with java script.

public String sha_pwd(String pass)  {
       try {

        MessageDigest md ;
        ByteArrayOutputStream bos;

            md = MessageDigest.getInstance("SHA");
            byte[] digest = md.digest(pass.getBytes("iso-8859-1"));
            bos = new ByteArrayOutputStream();
            OutputStream encodedStream = MimeUtility.encode(bos, "base64");
            encodedStream.write(digest);
       return   bos.toString("iso-8859-1");
      }
      catch (Exception e)
      {
 return "failed " + e;
      }
}

Regards,
Simon

Olga Agady wrote:

>Hi, 
>
>I am trying to figure out how I can add a user
>programmatically from a web application. Could someone
>give me a hint how I could get a reference  to James
>(probably to RemoteManagerHandler) from an external
>application (not using telnet). 
>
>Thanks in advance for any help
>
>Agady
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>