Obvious current issues:
- Freemail uses the current working directory to store everything, not a 
Freemail/ subdir.
- Even as a plugin it still uses FCP, instead of HighLevelSimpleClient etc.
- It logs to stderr/stdout.
- As he says below, you can't add shortnames from the web interface.

On Wednesday 07 November 2007 09:42, Dave Baker wrote:
> On Wednesday 07 November 2007 04:41:19 Robert Guerra wrote:
> > Does this version mean that Freemail can now be used as a plugin? If
> > so, would you be so kind as to describe the steps needed to add the
> > plugin to freenet.
> 
> It depends what you consider 'usable'! There has been a plugin that runs 
> Freemail for a while now, although there was no documentation provided on 
how 
> to run it as such. There is still functionality missing - the only thing you 
> can do from the web interface is add accounts.
> 
> To get it running, I'm not sure what the current stable version of Freenet 
> does plugin-wise, but I think it's a question of putting the url to the 
> Freemail plugin in the box (pick the latest from 
> http://downloads.freenetproject.org/alpha/plugins/Freemail/, or the path 
with 
> file:// in front of it to use one on your local machine) and pressing the 
> button. On Freenet trunk, you can just select 'Freemail' from the list and 
> press the button.
> 
> After that, you can go to the plugin's web interface to add an account, and 
> set up your mail client as before.
> 
> If you want to copy settings over, copy everything from your Freemail 
> directory to your node dir.
> 
> Bear in mind that Freemail as a plugin is very alpha. By all means report 
> bugs, but if it breaks, you get to keep all the pieces!
> 
> 
> Dave
> 
> 
> >
> > thanks
> >
> > regards,
> >
> > Robert
> > ---
> > Robert Guerra <rguerra at privaterra.ca>
> > Managing Director, Privaterra
> > Tel +1 416 893 0377
> >
> > On 5-Nov-07, at 6:59 PM, dbkr at freenetproject.org wrote:
> > > Author: dbkr
> > > Date: 2007-11-05 23:59:35 +0000 (Mon, 05 Nov 2007)
> > > New Revision: 15698
> > >
> > > Modified:
> > >   trunk/apps/Freemail/src/freemail/FreemailPlugin.java
> > > Log:
> > > Use post for the add account form.
> > >
> > >
> > > Modified: trunk/apps/Freemail/src/freemail/FreemailPlugin.java
> > > ===================================================================
> > > --- trunk/apps/Freemail/src/freemail/FreemailPlugin.java  2007-11-05
> > > 23:41:48 UTC (rev 15697)
> > > +++ trunk/apps/Freemail/src/freemail/FreemailPlugin.java  2007-11-05
> > > 23:59:35 UTC (rev 15698)
> > > @@ -194,21 +194,62 @@
> > >           HTMLNode pageNode = pr.getPageMaker().getPageNode("Freemail
> > > plugin", false, null);
> > >           HTMLNode contentNode = 
> > > pr.getPageMaker().getContentNode(pageNode);
> > >
> > > -         if(request.getParam("add").equals("Add account")) {
> > > -                 if(!(request.getParam("name").equals("") ||
> > > request.getParam("password").equals(""))) {
> > > +         HTMLNode addBox = contentNode.addChild("div", "class", 
> > > "infobox");
> > > +         addBox.addChild("div", "class", "infobox-header", "Add 
> > > account");
> > > +
> > > +         HTMLNode boxContent = addBox.addChild("div", "class", "infobox-
> > > content");
> > > +         HTMLNode form = pr.addFormChild(boxContent, "", 
> > > "addAccountForm");
> > > +
> > > +         HTMLNode table = form.addChild("table", "class", "plugintable");
> > > +         HTMLNode tableRowName = table.addChild("tr");
> > > +         tableRowName.addChild("td", "Name");
> > > +         tableRowName.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "text", "name",
> > > "", "30" });
> > > +         HTMLNode tableRowPassword = table.addChild("tr");
> > > +         tableRowPassword.addChild("td", "Password");
> > > +         tableRowPassword.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "password",
> > > "password", "", "30" });
> > > +         HTMLNode tableRowDomain = table.addChild("tr");
> > > +         tableRowDomain.addChild("td", "Domain");
> > > +         tableRowDomain.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "text",
> > > "domain", "", "30" });
> > > +         HTMLNode tableRowSubmit = table.addChild("tr");
> > > +         tableRowSubmit.addChild("td");
> > > +         tableRowSubmit.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value" }, new String[] { "submit", "add", "Add
> > > account"});
> > > +
> > > +         return pageNode.generate();
> > > + }
> > > +
> > > + public String handleHTTPPost(HTTPRequest request) throws
> > > PluginHTTPException {
> > > +         HTMLNode pageNode = pr.getPageMaker().getPageNode("Freemail
> > > plugin", false, null);
> > > +         HTMLNode contentNode = 
> > > pr.getPageMaker().getContentNode(pageNode);
> > > +
> > > +         String add = request.getPartAsString("add", 100);
> > > +         String name = request.getPartAsString("name", 100);
> > > +         String password = request.getPartAsString("password", 100);
> > > +         String domain = request.getPartAsString("domain", 100);
> > > +
> > > +         if(add.equals("Add account")) {
> > > +                 if(!(name.equals("") || password.equals(""))) {
> > >                           try {
> > > -                                 
> > > AccountManager.Create(request.getParam("name"));
> > > -                                 
> > > AccountManager.ChangePassword(request.getParam("name"),
> > > request.getParam("password"));
> > > -                                 
> > > if(!request.getParam("domain").equals("")) {
> > > -                                         
> > > AccountManager.addShortAddress(request.getParam("name"),
> > > request.getParam("domain"));
> > > +                                 AccountManager.Create(name);
> > > +                                 AccountManager.ChangePassword(name, 
> > > password);
> > > +                                 if(!domain.equals("")) {
> > > +                                         
> > > AccountManager.addShortAddress(name, domain);
> > >                                   }
> > > -                                 Thread t = new Thread(new 
> > > SingleAccountWatcher(new
> > > File(DATADIR, request.getParam("name"))), "Account Watcher for
> > > "+request.getParam("name"));
> > > +                                 Thread t = new Thread(new 
> > > SingleAccountWatcher(new
> > > File(DATADIR, name)), "Account Watcher for "+name);
> > >                                   t.setDaemon(true);
> > >                                   t.start();
> > > -                                 HTMLNode addedBox = 
> > > contentNode.addChild("div", "class",
> > > "infobox");
> > > -                                 addedBox.addChild("div", "class", 
> > > "infobox-header", "Added
> > > account");
> > > -                                 addedBox.addChild("div", "class", 
> > > "infobox-content", "Account
> > > for " + request.getParam("name") + " is created");
> > > -
> > > +
> > > +                                 HTMLNode successBox = 
> > > contentNode.addChild("div", "class",
> > > "infobox infobox-success");
> > > +                                 successBox.addChild("div", "class", 
> > > "infobox-header", "Account
> > > Created");
> > > +                                 // TODO: This is not the world's best 
> > > into message, but it's
> > > only temporary (hopefully...)
> > > +                                 HTMLNode text = 
> > > successBox.addChild("div", "class", "infobox-
> > > content");
> > > +                                 text.addChild("#", "The account ");
> > > +                                 text.addChild("i", name);
> > > +                                 text.addChild("#", " was created 
> > > successfully.");
> > > +                                 text.addChild("br");
> > > +                                 text.addChild("br");
> > > +                                 text.addChild("#", "You now need to 
> > > configure your email
> > > client to send and receive email through "
> > > +                                                 + "Freemail using IMAP 
> > > and SMTP. Freemail uses ports 3143
> > > and 3025 for these "
> > > +                                                 + "respectively by 
> > > default.");
> > >                           } catch (IOException ioe) {
> > >                                   HTMLNode errorBox = 
> > > contentNode.addChild("div", "class",
> > > "infobox infobox-error");
> > >                                   errorBox.addChild("div", "class", 
> > > "infobox-header", "IO Error");
> > > @@ -216,38 +257,23 @@
> > >                           } catch (Exception e) {
> > >                                   HTMLNode errorBox = 
> > > contentNode.addChild("div", "class",
> > > "infobox-error");
> > >                                   errorBox.addChild("div", "class", 
> > > "infobox-header", "Error");
> > > -                                 errorBox.addChild("div", "class", 
> > > "infobox-content", "Couldn't
> > > change password for "+request.getParam("name")+". "+e.getMessage());
> > > +                                 errorBox.addChild("div", "class", 
> > > "infobox-content", "Couldn't
> > > change password for "+name+". "+e.getMessage());
> > >                           }
> > > +
> > > +                         // XXX: There doesn't seem to be a way to get 
> > > (or set) our root
> > > in the web interface,
> > > +                         //      so we'll just have to assume it's this 
> > > and won't change
> > > +                         contentNode.addChild("a", "href", "/plugins/
> > > freemail.FreemailPlugin",
> > > +                                         "Freemail Home");
> > >                   } else {
> > >                           HTMLNode errorBox = contentNode.addChild("div", 
> > > "class",
> > > "infobox infobox-error");
> > >                           errorBox.addChild("div", "class", 
> > > "infobox-header", "Error");
> > >                           errorBox.addChild("div", "class", 
> > > "infobox-content", "Couldn't
> > > create account, name or password is missing");
> > >                   }
> > >           }
> > > -
> > > -         HTMLNode addBox = contentNode.addChild("div", "class", 
> > > "infobox");
> > > -         addBox.addChild("div", "class", "infobox-header", "Add 
> > > account");
> > > -         HTMLNode table = addBox.addChild("div", "class", "infobox-
> > > content").addChild("form").addChild("table", "class", "plugintable");
> > > -         HTMLNode tableRowName = table.addChild("tr");
> > > -         tableRowName.addChild("td", "Name");
> > > -         tableRowName.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "text", "name",
> > > "", "30" });
> > > -         HTMLNode tableRowPassword = table.addChild("tr");
> > > -         tableRowPassword.addChild("td", "Password");
> > > -         tableRowPassword.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "password",
> > > "password", "", "30" });
> > > -         HTMLNode tableRowDomain = table.addChild("tr");
> > > -         tableRowDomain.addChild("td", "Domain");
> > > -         tableRowDomain.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value", "size" }, new String[] { "text",
> > > "domain", "", "30" });
> > > -         HTMLNode tableRowSubmit = table.addChild("tr");
> > > -         tableRowSubmit.addChild("td");
> > > -         tableRowSubmit.addChild("td").addChild("input", new String[]
> > > { "type", "name", "value" }, new String[] { "submit", "add", "Add
> > > account"});
> > >
> > >           return pageNode.generate();
> > >   }
> > >
> > > - public String handleHTTPPost(HTTPRequest request) throws
> > > PluginHTTPException {
> > > -         return null;
> > > - }
> > > -
> > >   public String handleHTTPPut(HTTPRequest request) throws
> > > PluginHTTPException {
> > >           return null;
> > >   }
> > >
> > > _______________________________________________
> > > Freemail mailing list
> > > Freemail at freenetproject.org
> > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/freemail
> >
> > _______________________________________________
> > Freemail mailing list
> > Freemail at freenetproject.org
> > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/freemail
> 
> 
> _______________________________________________
> Freemail mailing list
> Freemail at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/freemail
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/freemail/attachments/20071116/236b9144/attachment.pgp>

Reply via email to