Installation and quick start
----------------------------

1. For OS/2 only, skip this step if using Windows.
   Install the required libraries and utilites:

   >yum install install libc libgcc1 libxml2 openssl icu sqlite

2. Unpack the Manjary server archive to any convenient location on your local
   drive (for example "C:\Program Files" in which subdirectory "Manjary" will
   be created).

3. Copy the *.xml files from the .\examples\full directory to the top where
   the manjary.exe executable is located.

   Open the copied manjary-mail.xml file in any text editor and replace the
   value of the following node:

   <default-domain>...</default-domain>
   The main or default mail domain that will be served by this server.

4. Run manjary.exe and go to http://localhost:81/management/
   Login: postmaster, password: ChangeMe
   Change the password in the web interface.
   Now you can create users and connect to the server using a mail client.

Full documentation: http://localhost:81/documentation/
or local path: .\Manjary\doc


Updating to a new version
-------------------------

You can update Manjary by simply unzipping the archive into the directory
where the previous version is installed, overwriting all files.


Notes to version 2.x.x
----------------------

Starting with version 2.0.0 a new method for storing local mailboxes is used.
A mailbox is converted the first time it is accessed after upgrading to the
new version. Therefore, it is impossible to downgrade from version 2.x.x to
1.x.x without losing new messages. But it is possible to reverse convert
mailboxes for use with the older version.

To do this, you need to stop the server 2.x.x correctly (by running
'manjary -k stop'), unpack the previous version into the installation
directory (replacing the files), and run the mbtool utility:

>mbtool.exe -S -R path

where 'path' is the path to your mail-root directory specified in the Mail
module section of the configuration. Please note that the -S and -R switches
are specified in capital letters. After this you will be able to run Manjary
version below 2.0.0.


History of changes
------------------

YYYY-MM-DD

2026-01-06 ver. 2.0.4
- The '*' address in the host/bind nodes implies binding to any IPv6 address
  and any IPv4 address unless the IPv6only="1" attribute is specified.
  Previously, the asterisk meant binding only to IPv4.
- Fixed an issue where DNS server addresses would not be set after
  reconfiguration if system settings were used.
- The module-SMTP/server/no-auth-port configuration parameter is no longer
  used. The module-SMTP/server/submission parameter has been introduced, which
  sets the interfaces and ports on which authentication is allowed.
- Reorganized and supplemented documentation. It was not mentioned earlier
  that the module-SMTP/client/relays/relay/to parameter can contain template
  metacharacters. The configuration example has been updated accordingly.
- AB module: A global username and password can be set for all users instead
  of personal credentials.

2025-12-28 ver. 2.0.3
- Correct work with DNS PTR records containing an empty string.
- The TLS-xxxxx configuration parameters have been renamed to SSL-xxxxx. The
  old names are still supported.
- SpamCheck module: The Match() and MatchList() functions for the HOSTNAME
  object now check all names assigned to the client's IP address. Previously,
  only the first one received from the DNS server was used.

2025-12-28 ver. 2.0.2
- Mail module: Fixed a bug in the delete messages and move messages between
  mailboxes function that caused corruption of the source mailbox. This caused
  a temporary failure and automatic recovery.
- Minor optimizations in various modules and the server.

2025-12-15 ver. 2.0.1
- IMAP4 module: Fixed a bug where the 'append ... UTF8 (...' command would
  sometimes store a few extra bytes at the end of a message.
- Added several checks to ensure stability when processing messages with
  incomplete headers (libmbox).
- Handling situations where message files were deleted as a result of external
  interference - a clear message in the log.
- The external message file is opened only when a content read operation is
  performed, not when the message is opened in the mailbox. A message may be
  opened to obtain information such as date, size, and flags without reading
  the content. This speeds up the IMAP FETCH and SEARCH handlers.
- mbtool: When listing messages (command line switch '-l'), if the message is
  contained in a separate file, it is checked that the file exists and its
  size matches the registered value.

2025-12-03 ver. 2.0.0
- A new format for storing messages in local mailboxes. The message structure
  and other information, as well as small messages, are now stored in a
  separate mbox file.
- IMAP4 module: Fixed a bug that caused the program to crash when receiving
  GETQUOTAROOT command from a client that supports the UTF8=ACCEPT capability.
- IMAP4 module: Optimization of processing of SEARCH and FETCH commands.
- HTTP module: Ability to specify the full executable @filename instead of the
  URI path in the file/handler node.
- HTTP module: Added some HTTP headers to environment variables for CGI
  programs.
- Configuration examples of the missing "append-limit" parameter of the IMAP4
  module. The default value has been changed from unlimited to 64 MB.
- Documentation updates.

2025-06-19 ver. 1.2.1
- Fixed a bug where it was impossible to bind a host to a specific network
  interface.
- SpamCheck module: Fixed a semaphore deadlock issue if a foreign domain had
  more than one SPF record.
- Mail module: The algorithm for automatically creating the first domain has
  been optimized. Log entries have become more informative.
- HTTP module: Support for a more familiar form of server address and port for
  the <fastcgi>/<server> configuration parameter.

2025-06-16 ver. 1.2.0
- Adaptation of code for porting to 64-bit platforms and IPv6 support.
- Significant updates to the DNS subsystem.
- Several minor bugs have been fixed.

2025-04-07 ver. 1.1.4
- Improved management of dynamic objects (domains, users, message lists).
- SMTP module: The addresses of clients connected to the port specified as
  "no-auth-port" who try to log in are passed to the BanIP module.

2025-03-24 ver. 1.1.3
- BanIP module: Ability to launch external programs when creating and
  deleting bans.
- New file examples\banip.cmd intended to be launched from the BanIP module.
  Allows synchronization of the module's ban lists and the system firewall
  rules for better performance.
- Documentation updates.

2025-03-19 ver. 1.1.2
- Web interface: Fixed a bug that caused fcgimm to crash.
- Web interface: Ability to use existing user records as templates for
  creating new ones.
- SMTP module: configuring ports and using SSL connections for relays.
- Sieve module, SieveManage protocol, in the "SIEVE" capability: extra
  characters at the end of the line have been removed.

2025-03-12 ver. 1.1.1
- Web interface: Non-administrators are not shown the non-working BanIP menu
  item.
- Removed some debugging information output to the console.

2025-03-10 ver. 1.1.0
- New module BanIP.
- RXMMP: New functions mmpCreateDomain and mmpDeleteDomain.
- Updated documentation and examples.

2025-02-20 ver. 1.0.1
- If a host name is specified in the <bind> nodes in the configuration, an
  attempt is made to bind to all addresses of this name.
- HTTP server: Request headers containing empty values are not considered
  invalid.
- Fix commands with extra leading/trailing spaces, CR and LF in
  mmpSendCmd function.
- RXMMP: The mmpStmtNew function has been renamed to mmpStmtCreate.

2025-02-11 ver. 1.0.0
- New management protocol.
- New web management interface.
- REXX interface (RXMMP library).
- Lots of fixes across all components.
- The documentation has been significantly supplemented.

2024-11-25 ver. 0.0.29
- Fixed a bug where in recent versions the connection could close before the
  last response was sent. The SMTP session may have been closed prematurely and
  the server sending us the message was retrying the sending.
- SMTP module: fixed an issue with the server's handling of the BDAT command
  (RFC 3030) that could cause a message to be discarded if its header did not
  fit entirely within the first chunk.
- Sieve module: fixed a small memory leak in the compiler when an error
  occurred on an operator with a string parameter.
- SpamCheck module: fixed a bug in handling SFP test results cache.
- IMAP4 module: fixed incorrect behavior where the part of the message
  requested by the FETCH command was sometimes mistakenly converted to base64.

2024-11-20 ver. 0.0.28
- Optimized poll() implementation for OS/2.
- Added local and remote addresses to the log file entry about the end of the
  session.

2024-11-18 ver. 0.0.27
- Fixed a low-level network subsystem issue that sometimes resulted in high CPU
  load (perhaps only on single-processor systems).

2024-11-13 ver. 0.0.26
- HTTP server: FastCGI interface has been improved.
- New parameter "clients-per-ip-limit" for "host" configuration nodes. Allows
  to limit the number of connections from one IP address.
- Documentation and examples updates.

2024-11-07 ver. 0.0.25
- HTTP server: Fixed a bug that caused the server to crash on requests without
  the Host: field if the default virtual host was not specified in the
  configuration.

2024-10-31 ver. 0.0.24
- Fixed a bug where new connections would stop being accepted if the connection
  was interrupted at the very beginning of an SSL session.

2024-10-16 ver. 0.0.23
- Optimization of work with mutexes in the main network subsystem and IMAP
  module for faster object release and avoidance of potential deathlock.
- Found a way around a libssl bug that seems to be OS/2 specific.

2024-10-10 ver. 0.0.22
- Fixed several issues in the new core networking subsystem.
- Fixed a bug in reading data from the standard output of external programs.
  This bug affected the helpers module.

2024-10-05 ver. 0.0.21
- The core network subsystem has been rewritten. All protocol implementations
  now share a single thread pool. The "threads" and "threads-max"
  configuration parameters are now specified globally rather than per host.
- HTTP: Fixed a small memory leak when running CGI programs.
- New example configuration file 'manjary.xml.HTTP' in the 'examples'
  directory.
- Documentation updates.

2024-09-30 ver. 0.0.20
- Support for internationalized SMTP, POP3 and IMAP4 protocols.
  The module-SMTP/client/ignore-8BITMIME configuration option is now
  deprecated and ignored. The message is downgraded and re-encoded when sent
  to an SMTP server that does not support the appropriate extensions.
- SMTP server: Full implementation of VRFY and EXPN commands.
- SMTP server: Fixed the date in the added Received: fields. The incorrect day
  of the week was indicated.
- IMAP4: APPENDLIMIT extension. New configuration option:
  server/module-IMAP4/append-limit.
- IMAP4: The IDLE command is now available in the Authenticated State, which
  complies with RFC 2177. Previously IDLE was only available in the Selected
  State.
- Major code optimization.
- Making changes and additions to the documentation.

2024-08-21 ver. 0.0.19
- Implemented IMAP4 protocol extensions: BINARY, ESEARCH, UNSELECT.
- IMAP4: Fixed setting the message date/time with the APPEND command.

2024-08-11 ver. 0.0.18
- Optimized implementation of the IMAP4 SEARCH command.
- Fixed the problem with renaming folders ("mailboxes" in IMAP4 terms).

2024-07-27 ver. 0.0.17
- Fixed an issue in the mail module that could sometimes cause the imap4 module
  on a FETCH command to return the requested part of the mail without a leading
  boundary.

2024-07-22 ver. 0.0.16
- Fixed an issue in the previous version that caused message files to remain
  open after reconfiguration. This resulted in the inability to delete or move
  messages.

2024-07-19 ver. 0.0.15
- Progressive analysis of message structure as requests are received via the
  IMAP4 protocol. Storing message structure in memory to reduce the number of
  message file reads for subsequent requests.

2024-04-27 ver. 0.0.14
- Sieve module: Fixed compilation of empty script. Executing the resulting
  binary does not generate any error log entries.
- A significant part of the IMAP4 module has been rewritten. The extended LIST
  command (RFC 5258) has been implemented.
- New example configuration file 'manjary.xml.SIMPLEST' in the 'examples'
  directory. The simplest all-in-one configuration.

2024-03-15 ver. 0.0.13
- Added a new module - poppassd.

2024-03-13 ver. 0.0.12
- Added a new module - Sieve. The module implements support for the Sieve
  programming language and the ManageSieve network protocol.

2024-01-24 ver. 0.0.11
- Fixed a bug that caused a crash when passing an empty base64 string to SASL.

2024-01-18 ver. 0.0.10
- SMTP module: Fixed memory out of bounds error when receiving multi-line SMTP
  responses from the server.

2023-12-05 ver. 0.0.9
- fcgiadm: Passing log entries to the browser in CDATA nodes.
- Run external processes with I/O redirection using native API instead of libc
  calls.
- HTTP module: Added some missing variables for CGI programs.

2023-11-29 ver. 0.0.8
- SpamCheck module: Additional checks for recursive inclusions for SFP.
- The SPAMCHK module name in some log file entries has been corrected (it was
  SMTPCHK).

2023-11-17 ver. 0.0.7
- New feature: displaying the tail of the log in the administrator web
  interface.
- Fixed a bug with encoding long strings in the FastCGI interface.
- Fixed freezing of the entire FastCGI interface if one of the FastCGI
  applications unexpectedly closed the connection.
- Fixed hang on server shutdown when using helpers and reconfiguration was
  performed.

2023-11-06 ver. 0.0.6
- The FastCGI interface has been completely rewritten.
- The API for interaction with external programs has been rewritten. This is
  now used in the Helpers module and for CGI programs in the HTTP module.
- HTTP module: Fixed a bug where the <handler> directive would not work if it
  specified an executable file (not FastCGI).
- Helpers module: EXIT and RECONFIG requests are no longer generated. Now an
  interrupt signal is sent instead. File examples\hlpsmtpsrv.cmd has been
  updated to reflect these changes.

2023-10-22 ver. 0.0.5
- Extended user information (vCard).
- The address book. Implementation of the LDAP protocol.
- Web interface improvements and fixes.

2023-08-08 ver. 0.0.4
- Fixed a bug due to which some temporary files were not deleted.

2023-07-20 ver. 0.0.3
- Fixed a bug due to which when the maximum number of failed attempts to send a
  message was reached, the message files (*.eml, *.out) in <mail-root>\queue
  were not deleted.

2023-07-11 ver. 0.0.2
- IMAP4: In the case where a multipart message did not have a Content-Type
  field in one of the parts, an incorrect response to the FETCH BODYSTRUCTURE
  command was generated. Now the default response to FETCH is text/plain.

2023-07-10 ver. 0.0.1
- First public release.

2021-09-15
- Beginning of the active development phase.
