PSGI/Plack Support
- Dada Mail PSGI Support
- Additional Requirements
- Configuring Dada Mail to run under PSGI
- Running the PSGI Process
- Configuring your web server
- PSGI Shortcomings in Dada Mail
Dada Mail PSGI Support
Dada Mail supports running under PSGI. Background:
PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers.
PSGI and Plack are inspired by Python's WSGI and Ruby's Rack.
PSGI is astonishing simple and incredibly powerful.
Additional Requirements
Dada Mail will require additional CPAN modules that are not shipped with Dada Mail:
Task::Plack
Plack::Builder
Plack::Middleware::Static
Configuring Dada Mail to run under PSGI
You probably will want to install Dada Mail using the command line interface of Dada Mail's included installer. Documentation to do so is located here:
https://dadamailproject.com/d/installer_dada_mail_cl.pod
One thing to note is the --deployment_running_under
flag, which you will want to pass, PSGI
:
--deployment_running_under PSGI
Running the PSGI Process
Once you've ran the installer (and the installation/configuration is successful), you will want to change back into the dada
directory, and run Dada Mail:
plackup --host 127.0.0.1 --port 9090 app.psgi
Dada Mail would then be available at: 127.0.0.1:9090
Configuring your web server
In this example, we'll be using the nginx web server to run the PSGI process via a reverse proxy. Our nginx configuration would include something like the following simplified example:
http {
server {
location / {
proxy_pass http://127.0.0.1:9090;
}
}
}
Dada Mail will then be available at, http://127.0.0.1
PSGI Shortcomings in Dada Mail
The following features current do not work when running Dada Mail under PSGI
File Browser/Manager
Neither KCFinder, nor Core5 Filemanager work under PSGI, as both will be served as static files, rather than php/perl applications. This feature is useful in Dada Mail's Send a Message/Webpage screens to upload images and place them in email messages you are composing, as well as upload files to be used as attachments.
There may be a way to have the webserver (ngnix) know to serve the backend for (as an example) KCFinder as a php app. If you do configure nginix this way, we would highly suggest to specify the exact PHP script names you would like to run, and nothing else.
Bridge Mail Forwarding
Bridge's Mail Forward feature, where messages are piped directly to the application will not work with Dada Mail running under PSGI. You may still use Dada Mail's POP3 support for your List Email.
One workaround for this is to have a separate script available just for mail forwarding - a copy of this script can be found in Dada Mail's installer directory. The name of this directory is changed to a random name, but should be located at,
dada/installer-disabled[random]/templates
Where,
[random]
is random string of letters and numbers. Inside thistemplates
directory is a file called,mail.cgi.tmpl
. Copy this file into the,dada
directory and rename it to whatever you'd like (we would suggest giving it a file ending of, ".pl", example:mail.pl
.Change its permissions to,
755
and use this as the script used for mail forwarding. Bridge will probably give something like the following as the absolute path to this script:|/home/youraccount/dada/app.psgi --inject --list listshortname
This would be wrong.
Rather, you would use something like the following:
|/home/youraccount/dada/mail.pl --inject --list listshortname