Configuration files

Configuration files are located in MIREKA_HOME/conf. They will be read and processed by Mireka on startup.

mireka.js is the primary configuration file of Mireka. The JavaScript evaluator starts with this file. This file in turn imports all other .js files. It also imports helper functions from a non-configuration file: MIREKA_HOME/lib/configuration.js. These helper functions are described in detail in comment blocks within that file.

In addition to the standard EcmaScript objects and Mireka mailing specific Java objects, the script can access the mireka.startup.ScriptApi object using the configuration variable.

Essentially, the JavaScript code in the configuration files create new Mireka objects, which are written in Java, and assigns values to their properties. A typical pattern looks like this:

setup(Member, { address: "", name: "John Doe", }),

As in almost all cases, the setup JavaScript function is used. It creates a new instance of the mireka.forward.Member class, and set its properties by calling Member.setAddress with the value "", and Member.setName with "John Doe". setup does a few other things, see the comment block preceeding it.

It is also possible to specify another object as a property value, either defining it inline, or referencing it by a variable name.

For more information on Mireka objects, see the Javadoc.

List of configuration files

File nameFunction
mireka.jsEnables/disables SMTP, Message Submission and POP3 services by importing or not importing their respective configuration files. It contains common elements used by more than one services. Some of these are default objects which are referred by other parts of the configuration, but it is also possible to define and use other instances of them. It also contains a very few, mostly static configuration related to Mireka as a whole. See the comments in the file for more information.
mx.jsConfigures the public SMTP service, which receives mails sent to the local domains by any server on the internet. The service, in turn, stores the mail in a POP3 mailbox, relays it in real time to a backend server behaving like a proxy, forwards it, etc.
submission/* These files configure the Message Submission service, used by local users to send mails either to other local users, or to other domains on the internet.
pop.jsConfigures the POP3 service itself and the POP3 Importer. POP3 Importer is useful for migration. It retrieves each users' mails from another POP3 server after startup. To use it, it is necessary that the user names and the passwords match on both system.
domains.jsList of local domain names. If the domain part of a recipient is not in this list, then the recipient will be rejected by the MX SMTP service.
global-users.js Authorized users of the Mail Submission, POP3 services, in addition they are also valid wildcard recipients in the MX SMTP service.
local-recipients.js It tells what to do with mails sent to local domains. It maps recipient addresses to a destinations, like store the mail in a maildrop for later retrieval via POP3, forward it to another domain, etc.
circular.js This file exists purely for a technical reason, to break circular dependencies. If a configuration object named A refers to another object B, but B also refers to A, then neither A nor B could be created and fully initialized before the other. In such cases an unitialized A object is created in this file, then it is referenced when object B and other depending objects are created and initialized. Finally object A is initialized in the usual configuration file corresponding to its function.
logback.xml It configures logging.