diff options
Diffstat (limited to 'lib/JWebmail.pm')
-rw-r--r-- | lib/JWebmail.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 8c01596..1c66001 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -39,8 +39,7 @@ sub startup { $self->moniker('jwebmail'); - my $mode = $self->mode; - $self->log->path($self->home->child('log', "$mode.log")); + $self->log->path($self->home->child('log', $self->mode . '.log')); # load plugins push @{$self->plugins->namespaces}, 'JWebmail::Plugin'; @@ -57,10 +56,10 @@ sub startup { # initialize models my $read_mails = do { - if ($mode eq 'development') { + if ($self->mode eq 'development') { my $cls = $self->config->{development}{read_mock}; eval { load $cls; 1 } || die "Issue for module $cls with: $@"; - $cls->new; + $cls->new(); } else { JWebmail::Model::ReadMails::QMailAuthuser->new( @@ -72,10 +71,15 @@ sub startup { unless $read_mails->DOES('JWebmail::Model::ReadMails::Role'); $self->helper(users => sub { $read_mails }); $self->helper(send_mail => sub { my ($c, $mail) = @_; JWebmail::Model::WriteMails::sendmail($mail) }); - $JWebmail::Model::WriteMails::Block_Writes = 1 if $mode eq 'development'; + $JWebmail::Model::WriteMails::Block_Writes = 1 if $self->mode eq 'development'; $self->defaults(version => __PACKAGE__->VERSION); + $self->sessions->cookie_name('jwebmail_session'); + $self->sessions->samesite('Strict'); + $self->sessions->secure(1); + $self->sessions->default_expiration(30 * 60); + $self->route($i18n_route); } |