Changeset 354


Ignore:
Timestamp:
Mar 10, 2010, 6:18:48 PM (11 years ago)
Author:
zerodeux
Message:

Configuration mod: passing backend parameters from bearmail.conf up to backend + warning fixes

Location:
bearmail
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bearmail/bin/bearmail.cgi

    r350 r354  
    3131        TMPL_PATH => "$bearmail_dir/template/",
    3232        PARAMS    => {
    33             cfg_file => "$bearmail_dir/conf/bearmail.conf",
     33            cfg_file => "$bearmail_dir/etc/bearmail/bearmail.conf",
    3434        }
    3535    },
  • bearmail/lib/BearMail/Backend.pm

    r351 r354  
    2020# Should be selected by some config file
    2121sub backend {
    22   my ($backend) = @_;
    23   return new $backend;
     22  my $backend = shift;
     23  my %args;
     24
     25  if ($backend eq 'Backend::Files') {
     26    $args{mailmap} = shift(@_) if @_;
     27  }
     28  elsif ($backend eq 'not_implemented') {
     29    # ...
     30  } else {
     31    die "Unknown backend '$backend', check or set the 'backend' param in your bearmail.conf file";
     32  }
     33
     34  return $backend->new(%args);
    2435}
    2536
  • bearmail/lib/BearMail/Backend/Files.pm

    r318 r354  
    4949  bless \%args, $class;
    5050
    51   $mailmap = $args{'mailmap'} if $args{'mailmap'};
    52   $debug = 1 if ($args{'debug'} eq 1);
     51  $mailmap = $args{'mailmap'} if defined $args{'mailmap'};
     52  $debug = 1 if defined $args{'debug'};
    5353
    5454  _read_mailmap();
  • bearmail/lib/BearMail/Web.pm

    r351 r354  
    3838
    3939    # Instanciate the backend
    40     $self->{b} = BearMail::Backend::backend($self->cfg('backend'));
     40    $self->{b} = BearMail::Backend::backend( @{$self->cfg('backend')} );
    4141}
    4242
     
    4646    $self->session_config (
    4747      COOKIE_PARAMS => { -name => 'bearmail', -expires => '+8days' },
    48       SEND_COOKIE         => 1,
     48      SEND_COOKIE   => 1,
    4949    );
    5050    CGI::Session->name('bearmail');
  • bearmail/lib/BearMail/Web/Login.pm

    r351 r354  
    3838        return $self->redirect($self->url($intent));
    3939
    40     } elsif(exists(%{$self->{b}->get_postmasters()}->{$email})
    41             and %{$self->{b}->get_postmasters()}->{$email} eq md5_hex($pass)) {
     40    } elsif(exists($self->{b}->get_postmasters()->{$email})
     41            and $self->{b}->get_postmasters()->{$email} eq md5_hex($pass)) {
    4242
    4343        $self->session->param('user', $email);
Note: See TracChangeset for help on using the changeset viewer.