Opened 10 years ago

Closed 10 years ago

#16 closed task (fixed)

Bearmai GUI demo sample "mailmap"

Reported by: vcaron Owned by: sbocahu
Priority: minor Component: Bearmail
Keywords: Cc: blinet,

Description

We plan to host a Bearmail GUI demo (as http://bearmail.bearstech.com/).

We would need a sample "mailmap" demo file, and I guess we'll reset it every night on the demo site or something like that.

The exercise needs some imagination to find some probable and maybe funny domains and email addresses (not Lorem Ipsum, Foobar or such garbage, that makes for bad looking demos IMHO). Let's say 10 domains and 2 to 10 addresses per domain.

Change History (8)

comment:1 Changed 10 years ago by sbocahu

Plus:

        PerlOptions +Parent
        PerlSwitches -I/bearmail/bearmail/lib

if bearmail libs aren't in @INC (not packaged)

comment:2 follow-up: Changed 10 years ago by vcaron

Seen http://bearmail.bearstech.com/ - it's cool :).

A few features needed:

  • Have a read/write demo
  • Customize the login template to specify that admin/ours is the test account
  • Reset the mailmap every hour or so; I'd love a feature where upon login every user gets its own private copy of a mailmap, instead of testing users stomping on each other's toes
  • Make sure the mail reminder feature does not end in a spambot (we'll have to turn it off I guess)

If any of this needs some hardcoding, we'll take the opportunity to improve the configurability of Bearmail.

comment:3 in reply to: ↑ 2 Changed 10 years ago by sbocahu

Replying to vcaron:

Seen http://bearmail.bearstech.com/ - it's cool :).

A few features needed:

  • Have a read/write demo

That's already the case :) I've hardcoded a few modifications so that the mailmap is not located in /etc but in the documentroot.

  • Customize the login template to specify that admin/ours is the test account

Done, and the default password is now "ours" so that a single click is needed to log in.

  • Reset the mailmap every hour or so;

done, thanks to a cronjob

I'd love a feature where upon login every user gets its own private copy of a mailmap, instead of testing users stomping on each other's toes

mailmap temporary file based on the ip address ?

  • Make sure the mail reminder feature does not end in a spambot (we'll have to turn it off I guess)

I turned it off. This is totally useless in the demo

If any of this needs some hardcoding, we'll take the opportunity to improve the configurability of Bearmail.

mailmap and postfix/dovecot files path should be configureable.

Also, I made a few improvements that need to be commited... WIP :)

comment:4 follow-up: Changed 10 years ago by vcaron

That's already the case

I've hardcoded a few modifications so that the mailmap is not located in /etc but in the documentroot.

Rather should be in $TMP/somewhere but that's not security sensitive anyway.

Done, and the default password is now "ours" so that a single click is needed to log in.

Cool. Added some text around it (see http://bearmail.bearstech.com/bearmail/login).

mailmap temporary file based on the ip address ?

Nope, rather on the session cookie.

comment:5 Changed 10 years ago by blinet

  • Cc blinet added

comment:6 in reply to: ↑ 4 Changed 10 years ago by sbocahu

Replying to vcaron:

That's already the case

Problems due to the persistence of mod_perl2 have been fixed by turning the backend::files into a fully object module

Each tester has now its own mailmap (based on the session id) thanks to a small patch:

Index: lib/BearMail/Backend.pm
===================================================================
--- lib/BearMail/Backend.pm     (revision 531)
+++ lib/BearMail/Backend.pm     (working copy)
@@ -17,12 +17,30 @@
 
 use BearMail::Backend::Files;
 
+### #FIXME demo only
+use File::Copy;
+use Carp;
+###
+
 # Should be selected by some config file
 sub backend {
   my $backend = shift;
 
   if ($backend eq 'Files') {
-    return BearMail::Backend::Files->new(mailmap => shift @_);
+
+### #FIXME DEMO
+
+#    return BearMail::Backend::Files->new(mailmap => shift @_);
+
+    my $mm = shift(@_);
+    my $mailmap = $mm.".sid_".shift(@_);
+    if( ! -e  $mailmap) {
+      copy($mm, $mailmap) or croak "copy of mailmap reference failed: $!";    
+    }
+    return BearMail::Backend::Files->new(mailmap => $mailmap);
+
+###
+
   }
 
   die "Unknown backend '$backend', check or set the 'backend' param in your bearmail.conf file";
Index: lib/BearMail/Web.pm
===================================================================
--- lib/BearMail/Web.pm (revision 531)
+++ lib/BearMail/Web.pm (working copy)
@@ -30,7 +30,10 @@
     # Instanciate the backend
     my $backend = $self->cfg('backend');
     croak "Backend (flatfile, sql, ...) not set, please define 'backend' in bearmail.conf" if not defined $backend;
-    $self->{b} = BearMail::Backend::backend( @$backend );
+### #FIXME demo only
+#    $self->{b} = BearMail::Backend::backend( @$backend );
+    $self->{b} = BearMail::Backend::backend( @$backend, $self->session->id() );
+###
 
     # CGI.pm sets a default ISO-8859-1 charset in the Content-Type header.
     # We prefer omitting it and let browsers honor the <meta> in page <header>'s.

comment:7 Changed 10 years ago by vcaron

Don't forget to remove unused/expired "custom mailmaps" with a simple cronjob.

comment:8 Changed 10 years ago by sbocahu

  • Resolution set to fixed
  • Status changed from new to closed

a cronjob checks every hour for mailmaps that have not been accessed to within an hour

Note: See TracTickets for help on using tickets.