diff --git a/setup/doc/administration.html b/setup/doc/administration.html deleted file mode 100644 index 2ee0dde..0000000 --- a/setup/doc/administration.html +++ /dev/null @@ -1,64 +0,0 @@ - -
--For the administration of the Resin application server, see the -documentation of Resin. -
- -Log files are located in two places: -MeasureTraffic
-filter publishes statistics in a JMX MBean object under the name
-mireka:type=TrafficSummary.
-It can be displayed either in the
-administration pages of Resin, or using the jconsole application of the JDK.
-
--All mails sent to the special Postmaster addresses are saved into the -{mirekaHome}/postmaster directory. They are sent to their assigned -destination as well. There are two types of postmaster addresses. In the -first form, no domain is specified. This is always accepted. In the second form, -domain part is also specified. These are only accepted if the domain is a local -domain. This feature is useful for debugging. The saved file shows the content -of the message before any processing. The mails are saved even if an error -occurs later in the processing chain, e.g. the back-end server cannot be -connected in proxy mode. -
- --You may need to clear the directory occasionally. -
- - - \ No newline at end of file diff --git a/setup/doc/basic-configuration/alias.html b/setup/doc/basic-configuration/alias.html new file mode 100644 index 0000000..eb51075 --- /dev/null +++ b/setup/doc/basic-configuration/alias.html @@ -0,0 +1,27 @@ + + +Alias is a virtual recipient address which is mapped to another local recipient address. +Mails sent to the alias are handled exactly as if they were sent to the other address. + +
Edit local-recipients.js
and insert the new alias mapping below the
+comment ENTER YOUR RECIPIENT-DESTINATION MAPPINGS HERE.
+For example if you have a user account with the name jane
, and you want
+to define an alternative address, jeannie
for her, you shoud insert the following line:
+
... +alias("jeannie@example.com", "jane@example.com"), +...
+ +From now, mails sent to jeannie@example.com
will be delivered to the
+existing maildrop named jane
.
+
Note: both addresses must be local addresses. + + + + diff --git a/setup/doc/basic-configuration/authenticate-by-ip.html b/setup/doc/basic-configuration/authenticate-by-ip.html new file mode 100644 index 0000000..128b1ad --- /dev/null +++ b/setup/doc/basic-configuration/authenticate-by-ip.html @@ -0,0 +1,27 @@ + +
+Clients connecting to the Message Submission port must be authenticated. +It must not be allowed that anyone on the internet could send mails through the server, +because spammers quickly find such an open-proxy SMTP server and starts to use it. +
Authentication is based on either the name-password pair of a user account, or on the IP address of the client. +For remote users with dynamic IP addresses the password authentication, +for servers the IP address based authentication is the more useful. + +
Edit submission/authorized-ip.js
and insert the IP addresses or address ranges,
+from which machines are allowed to send mail without password authentication.
+For example if your private network is 192.168.0.0/24 and you allow machines on
+your private network to send mail without password authentication,
+insert the following line:
+
... +"192.168.0.0/24", +...
+ + + diff --git a/setup/doc/basic-configuration/configuration.html b/setup/doc/basic-configuration/configuration.html new file mode 100644 index 0000000..3f1170c --- /dev/null +++ b/setup/doc/basic-configuration/configuration.html @@ -0,0 +1,39 @@ + + +Mireka configuration is stored in text files. +The configuration files are written in the JavaScript programming language, +although only the most basic elements of JavaScript is used. The configuration does two things: +
conf
subdirectory.
+ /etc/mireka/
.
+After changing the configuration you have to restart Mireka. + + + + diff --git a/setup/doc/basic-configuration/domain.html b/setup/doc/basic-configuration/domain.html new file mode 100644 index 0000000..e0abedd --- /dev/null +++ b/setup/doc/basic-configuration/domain.html @@ -0,0 +1,29 @@ + +
+If you want Mireka to accept mails from external servers then you have to specify the list of your domain names.
+For example, if john@example.com
and john@example.net
+are mail addresses of your local users, then you have to add example.com
and example.net
to the list.
+If the domain part of a recipient is not in this list, then the recipient will be rejected by the MX SMTP service.
+
+
The list is specified in the domains.js
configuration file.
+Edit the file and add your domain to the remoteParts
list.
+For the example above the file should look something like this:
+
localDomains = setup(InlineDomainRegistry, { + remoteParts: [ + "example.com", + "example.net" + ] +}); +
+The domain must be double quoted, multiple domains must be separated by commas. + + + + diff --git a/setup/doc/basic-configuration/first-steps.html b/setup/doc/basic-configuration/first-steps.html new file mode 100644 index 0000000..7349ab7 --- /dev/null +++ b/setup/doc/basic-configuration/first-steps.html @@ -0,0 +1,45 @@ + +
+After installating Mireka, you have to configure the following settings, which has no sensible defaults. +
Edit mireka.js
and change the value of the helo
variable.
+For example if your server is named mail.example.com
the result should look like this:
+
... +var helo="mail.example.com"; +... +
+ +If Mireka will be configured to sometime forward incoming mail to an external server, than it has to use a mechanism named SRS to successfully deliver the mail. +SRS needs a secret key. Choose a random hexadecimal value which should be about 32 characters long. +
Edit mireka.js
, uncomment the secretKey
line and edit its value.
+For example if you have choosen 12AB34CD
as the secret, the result should look like this:
+
... + secretKey: "12AB34CD", +... +
+ ++ +
submission/queues.js
+configuration file, to reflect your own domain. The mailer daemon address is used as the from
+address in automatically generated delivery status notification mails.
+
+
+
diff --git a/setup/doc/basic-configuration/forward.html b/setup/doc/basic-configuration/forward.html
new file mode 100644
index 0000000..22c3652
--- /dev/null
+++ b/setup/doc/basic-configuration/forward.html
@@ -0,0 +1,27 @@
+
+
+ Forwarding is used to redistribute incoming mail to one or more +other addresses, including remote addresses too. In contrast to a mailing list, +if delivery to any of the destination addresses fails, then the bounce message goes +to the original sender, not to a third person, like a mailing list owner. + +
NOTE: Before first configuring forwarding to a remote address, you must configure the SRS module. +See First steps. + +
Edit local-recipients.js
and insert a new forwarding rule below the
+comment ENTER YOUR RECIPIENT-DESTINATION MAPPINGS HERE.
+For example if you want that all mails sent to the address project-halo@example.com
be
+forwarded to john@example.com
and customer@example.net
, then insert the following line:
+
... +forward("project-halo@example.com", "john@example.com", "customer@example.net"), +...
+ + + diff --git a/setup/doc/basic-configuration/mailing-list.html b/setup/doc/basic-configuration/mailing-list.html new file mode 100644 index 0000000..b72c012 --- /dev/null +++ b/setup/doc/basic-configuration/mailing-list.html @@ -0,0 +1,47 @@ + + +Mireka provides very simple mailing lists. This implementation is +appropriate for small, internal, closed membership lists. There is no +archiving, automatized subscription/unsubscription address, moderation etc. If the +requirements are more complex, then a dedicated list manager software should be used. + +
Edit local-recipients.js
and insert a new mailing list definition below the
+comment ENTER YOUR RECIPIENT-DESTINATION MAPPINGS HERE.
+For example if you want that all mails sent to the address admin@example.com
be
+distributed to john@example.com
and jane@example.net
, then insert the following lines:
+
... +mailingList({ + address: "admin@example.com", + subjectPrefix: "[SYS-ADMIN]", // Subject of mails will be prefixed by this text. Default: no prefix. + membersOnly: false, // Only members are allowed to send mails to the list. Default: true + attachmentsAllowed: true, // Default is true. + replyToList: true, + reversePath: "list-owner@example.com", // Bounce messages will go to this address. Required. + membersOnlyMessage: "Only example.com system administrators can post onto this list.", + nonMemberSenderValidator: setup(SubjectRegexpValidator, { + pattern: ".*TICKET-NO.*" + }), + members: listMembers([ + "john@example.com", + "jane@example.net", + ]), +}), +...
+ +Fields not commented above: +
replyToList
: If true, pressing the Reply button in a mail client send a mail to the list, and not the original sender. Default: true.
+membersOnlyMessage
: Mails from non-members (if they are disabled) will be bounced with this message. Default:
+ Only members of the list are allowed to send a message to this list address.+
nonMemberSenderValidator
: Mails from non-members with subjects matching the supplied regular expressions will be always allowed. Optional.
+Any system that includes an SMTP server +supporting mail relaying or delivery MUST support the reserved mailbox "postmaster" as a +case-insensitive local name.+ +
Edit local-recipients.js
and change the value of the PostmasterAliasMapper.canonical
+attribute.
+For example if the local user, john@example.com
, should receive mails sent to the postmaster addresses
+then the result should look like this:
+
... + setup(PostmasterAliasMapper, { + canonical: "john@example.com" + }), +... +
+ +The designated Postmaster will receive mails sent to the Postmaster of any local
+domains (for example Postmaster@example.com
)
+and also to the special Postmaster
(without domain) address.
+
+
+
diff --git a/setup/doc/basic-configuration/proxy.html b/setup/doc/basic-configuration/proxy.html
new file mode 100644
index 0000000..71a9595
--- /dev/null
+++ b/setup/doc/basic-configuration/proxy.html
@@ -0,0 +1,76 @@
+
+
Mireka can relay mails sent to one or more or even any addresses to another SMTP server. +
Mireka relays the SMTP statements received in a mail +session to a backend server step-by-step in real-time. In this way both +this server and the backend server is able to reject a mail within the +SMTP session, before accepting the responsibility of delivering the +mail. This fast-fail behaviour is useful in some situations. + +
First edit mireka.js
and configure the value of the backendServer
+variable. For example if your backend server is backend.example.com
and
+listens on port 2525, your configuration should look like this:
+
... +backendServer = setup(BackendServer, { + host: "backend.example.com", + port: 2525, + clientFactory: clientFactory +}); +...
+ +Note: you can freely specify another backend server for a different set of recipient addresses. + +
Next, edit local-recipients.js
and insert the proxy mapping below the
+comment ENTER YOUR RECIPIENT-DESTINATION MAPPINGS HERE.
+For example if you want to relay everything to the backend server, then insert the following code:
+
... +massProxy(backendServer, [ setup(AnyRecipient) ]); +...
+ +Here is a complex example for selectively relaying specific addresses: +
... + +massProxy(backendServer, [ + + // Fully specified recipients + setup(InlineRecipientRegistry, { + addresses: [ + "john@example.com", + "jack@example.com" + ] + }), + + // A wildcard recipient, only the local part is specified + setup(CaseInsensitiveAnyDomainRecipient, { + localPart: "anonymous" + }), + + // Another wildcard recipient with regular expression + setup(RegexAddressSpecification, { + localPartRegex: ".*-bounces-.*", + remotePart: "lists.example.com" + }), + + // Any postmaster address + setup(AnyPostmaster), + + // Addresses corresponding to local user accounts + setup(GlobalUsersRecipientSpecification, { + users: globalUsers + }), +]), +...
+ +Tip: Proxy mappings should be placed near the end of
+local-recipients.js
, so locally handled addresses will not be shadowed
+accidentally by proxied addresses specified using wildcards.
+
+
+
diff --git a/setup/doc/basic-configuration/sendmail.html b/setup/doc/basic-configuration/sendmail.html
new file mode 100644
index 0000000..2a9e32c
--- /dev/null
+++ b/setup/doc/basic-configuration/sendmail.html
@@ -0,0 +1,24 @@
+
+
Many Linux software depends on the sendmail
program to send mail.
+We have good experience with the sSMTP application. It provides a sendmail
+implementation which sends the mail directly to an SMTP server.
+
To install sSMTP on Ubuntu: +
sudo apt-get install ssmtp
+Edit its main configuration file: +
sudoedit /etc/ssmtp/ssmtp.conf
+Set sSMTP to send mail to the Message Submission port of Mireka. For example: +
mailhub=mail.example.com:587
+You may also want to set other properties and edit the other configuration file, /etc/ssmtp/revaliases
.
+
If sSMTP is on a different host than Mireka, then set Mireka to allow message submission from the sSMTP host. +See Authenticate by IP address. + + + diff --git a/setup/doc/basic-configuration/user.html b/setup/doc/basic-configuration/user.html new file mode 100644 index 0000000..e31b02e --- /dev/null +++ b/setup/doc/basic-configuration/user.html @@ -0,0 +1,34 @@ + +
+global-users.js contains the list of users who are authorized to +use the Message Submission and POP3 services. It contains username, password pairs. +An email client (MUA) must authenticate using such an account before submitting and +retrieving messages. + +
Note: The users listed here will receive a POP maildrop and become valid recipients
+for all local domains listed in domains.js
.
+For example, you have a user account with the name john, and the local
+domains are example.com and example.net.
+In this case the Mireka accepts both john@example.com and john@example.org.
+
+
Edit the global-users.js
file and add your user to the users
list.
+For example if you have two users, John and Jane, the result should look something like this:
+
globalUsers = setup(GlobalUsers, { users: [ + + globalUser("john", "changeit"), + globalUser("jane", "changeit"), + +]});
+ +Do not forget to designate a user as postmaster. + + + diff --git a/setup/doc/configuration.html b/setup/doc/configuration.html index b136a3c..42ce6d2 100644 --- a/setup/doc/configuration.html +++ b/setup/doc/configuration.html @@ -1,6 +1,7 @@
-Mireka is using the Resin application server for configuration and startup. -Therefore it is distibuted in a standard Java Web Application archive, although -currently it has no web interface. In the unlikely event, that some additonal -configuration of Resin is needed, other than what was already done during -installation, you can find more information about Resin on its web site at -http://www.caucho.com/products/resin/. -
+-Mireka configuration files are located in the ${mirekaHome}/conf/ -directory. -
+Configuration files are located inMIREKA_HOME/conf
.
+They will be read and processed by Mireka on startup.
--mireka.xml is the primary configuration file of Mireka. -It is imported by -resin-web.xml in the Mireka web application archive during runtime. -mireka.xml in turn imports most of the other configuration -files. +
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.
-These configuration files will be read and processed by Resin. -Essentially, they control what objects must be created in runtime. The name of a tag -is a Java class name. An element assigns a value to a property of the object. -It is also possible to specify another objest as a property value, either -defining it inline, or referencing it by an EL expression. -For more information on the syntax, see the Resin documentation. -
+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.
-For more information on the Mireka classes which are referenced in the -configuration, see the javadoc. +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: "john@example.com", + name: "John Doe", +}),
+As in almost all cases, thesetup
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 "john@example.com"
,
+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.
-The import structure of configuration files should be considered as an example. -It is possible to include all data in mireka.xml. It is also possible -to divide the configuration into more files than what is supplied by default. +For more information on Mireka objects, see the Javadoc.
+mireka.xml | Enables/disables SMTP, Submission and POP3 + |
---|---|
File name | Function |
mireka.js | Enables/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
@@ -69,67 +64,58 @@ Mail servicesSee the comments in the file for more information. |
mx | Configuration files related to the -public SMTP + |
mx.js | Configures 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 | Configuration files -related to the Message Submission service, used by local users to send mails either to -other local users, or to other domains 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/pop.xml | Configures the POP3 service itself and the POP3 + |
pop.js | Configures 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.xml | List of local domain names. + |
domains.js | List 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.xml | +|
global-users.js |
Authorized users of the Mail Submission, POP3 services, in addition they are also valid wildcard recipients in the MX SMTP service. |
alias.xml | +|
local-recipients.js |
-List of aliases. An alias maps one or more virtual recipients to a -canonical recipient address. +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. |
forwards.xml | +|
circular.js |
-Forward lists. Forward lists are used to redistribute incoming mail to multiple -other addresses. +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. |
lists.xml | --List of (very) simple mailing lists. - |
others.xml | +|
logback.xml |
-Other local recipients not included in the alias.xml, forwards.xml etc. -configuration files. +It configures logging. |
-${mirekaHome}/conf/logback.xml configures logging. -For more information, see the documentation of -Logback and the -Administration section. -
- \ No newline at end of file diff --git a/setup/doc/development.html b/setup/doc/development.html index ada5adb..d8d25aa 100644 --- a/setup/doc/development.html +++ b/setup/doc/development.html @@ -8,8 +8,8 @@Almost anything can be changed in Mireka without modifying Mireka source code, -just by adding new Java classes for example in a jar and configuring them in -the XML configuration files. Particularly useful are the filters, which can +just by adding new Java classes for example in a jar and initializing these new objects in +the configuration files. Particularly useful are the filters, which can alter the processing of a mail immediately within the SMTP transaction.
@@ -20,6 +20,7 @@For an overview about the filter mechanism, see the Filters section.
A filter consists of two classes.
FilterType
@@ -42,10 +43,9 @@
-Place your jars and classes into ${mirekaHome}/lib and
-${mirekaHome}/classes,
-respectively. You can even place Java source files into
-${mirekaHome}/classes, Resin will compile it automatically.
+Place your jars and compiled classes into MIREKA_HOME/lib
and
+MIREKA_HOME/classes
+respectively.
diff --git a/setup/doc/directory.html b/setup/doc/directory.html new file mode 100644 index 0000000..ddfb049 --- /dev/null +++ b/setup/doc/directory.html @@ -0,0 +1,38 @@ + +
+/var/lib/mireka
,
+which contains a soft link named log
, which points to the /var/log/mireka
directory,
+which in turn contains the log files.
+The place of MIREKA_HOME depends on your system and installation method: +
/opt/mireka
.
+ /var/lib/mireka
.
+Directories within MIREKA_HOME: +
bin
: start programs/scripts
+classes
: custom, compiled Java classes can be but here
+conf
: configuration files
+doc
: HTML user documentation, you are reading it now
+lib
: Java libraries, including Mireka itself. Custom libraries can also be put here.
+log
: log files
+maildrops
: contains one subdirectory for each user account, received
+mails are stored here, until the user downloads and deletes them via POP3
+postmaster
: Mireka stores a copy of each mail sent to Postmaster in this directory for debugging purposes
+queues
: mails waiting for transmission to another server are stored here
+
-The filter chain is configured in mx/mx.xml and
-submission/submission.xml.
+The filter chain is configured in mx.js
and
+submission/submission.js
.
-global-users.xml contains the list of users who are authorized to -use the mail submission and POP3 services. It contains username, password pairs. -An email client (MUA) -must authenticate in the SMTP session using these accounts before submitting a -message. -
--Note: According to the default configuration, if the MX service is -enabled, then the users listed here become valid wildcard recipients in the MX -service too. Because the list contains the local-part of addresses only, they -will be accepted with any local domain on their right side. For example, the -list contains the user john, and example.com and -example.org are both local domains. In this case the MX service -accepts both john@example.com and john@example.org. -
- -diff --git a/setup/doc/global-users.html b/setup/doc/global-users.html deleted file mode 100644 index 87bc0b1..0000000 --- a/setup/doc/global-users.html +++ /dev/null @@ -1,36 +0,0 @@ - -
-
- - - -
-