diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/JWebmail.pm | 5 | ||||
-rw-r--r-- | lib/JWebmail/Config.pm.in | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 92c5b44..c95e481 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -4,7 +4,7 @@ use Mojo::Base Mojolicious; use Module::Load 'load'; -use JWebmail::Config 'LOGIN_SCHEME'; +use JWebmail::Config qw'LOGIN_SCHEME DATADIR'; use JWebmail::Controller::Webmail; use JWebmail::Model::ReadMails::QMailAuthuser; use JWebmail::Model::WriteMails; @@ -60,6 +60,9 @@ sub startup { my $write = JWebmail::Model::WriteMails->new($self->config->{model}{write}); $self->helper(send_mail => sub { $write->sendmail($_[1]) }); + push $self->renderer->paths->@*, DATADIR . '/templates'; + push $self->static->paths->@*, DATADIR . '/public'; + $self->validator->add_check(mail_line => \&_mail_line); $self->validator->add_filter(non_empty_ul => \&_filter_empty_upload); diff --git a/lib/JWebmail/Config.pm.in b/lib/JWebmail/Config.pm.in index a899024..91c40c6 100644 --- a/lib/JWebmail/Config.pm.in +++ b/lib/JWebmail/Config.pm.in @@ -5,11 +5,12 @@ use warnings; use utf8; use Exporter 'import'; -our @EXPORT_OK = qw(MAILDIR_EXTRACTOR LOGIN_SCHEME); +our @EXPORT_OK = qw(MAILDIR_EXTRACTOR LOGIN_SCHEME DATADIR); use constant { MAILDIR_EXTRACTOR => '@MAILDIR_EXTRACTOR_BIN@', LOGIN_SCHEME => fc '@LOGIN_SCHEME@', + DATADIR => '@DESTDIR@@PREFIX@/@DATADIR@', }; 1 |