JUMBO BLOCK Mail – server bridge (jb-mail.php) 1.0.0
====================================================

© 2026 JUMBO BLOCK — Trademark and Technology of ZANNI GROUP
ZANNI GROUP · Andreas Zanni e.K. · Brauhof 12 · 44866 Bochum · Germany
https://jumboblock.org


1. What is the server bridge for?
---------------------------------
JUMBO BLOCK Mail is an e-mail client that runs in the browser. To send and
receive it needs a bridge to the mail server (IMAP and SMTP).

- jb-mail.py is the bridge for a single workstation (Python 3).
- jb-mail.php (this package) is the bridge for organisations that run it on
  their own web server. Workstations then only need a browser – including
  locked-down workstations, replacement computers or tablets.


2. Responsibility of the operator
---------------------------------
JUMBO BLOCK only provides the software. JUMBO BLOCK does not run a bridge for
others and has no access to your installation, your accesses or your mails.

The operator – the organisation that installs the bridge – is solely
responsible for the web server, PHP updates, HTTPS, the accesses, data
protection and backups. Please observe the rules that apply to you (e.g. data
protection, information security, internal regulations).


3. How it works
---------------
- Mails stay on the IMAP server. The bridge stores no copies.
- The bridge never stores mailbox passwords or S/MIME passphrases. They stay
  in the browser window and are sent only with the respective request via
  HTTPS.
- Per access, only account settings, signatures, contacts and certificates
  are stored – encrypted with AES-256-GCM. The key is derived from the
  password of the respective person. The administration cannot read this data.
- Sign-in with password and second factor (authenticator app, TOTP).
  After several failed attempts sign-in is blocked temporarily.
- The session ends after 30 minutes without activity, at the latest after
  12 hours.
- Connections to IMAP and SMTP always use TLS with certificate verification.
- The bridge does not contact jumboblock.org (no statistics, no update check,
  no embedded content).


4. Requirements
---------------
- Web server with PHP 8.1 or newer (Apache, LiteSpeed, nginx, Microsoft IIS
  or others), extensions openssl, json and mbstring
- HTTPS with a valid certificate
- PHP may open outgoing connections to the mail server
  (IMAP usually port 993, SMTP usually port 465 or 587)
- Write permission for PHP in the program folder (for jb-mail-config.php) and
  for the data folder
- Recommended: post_max_size and upload_max_filesize at least 20M (limits the
  size of attachments), time limit at least 30 seconds

The mailbox must allow sign-in via IMAP and SMTP with user name and password.
Microsoft 365 / Exchange Online only allows modern sign-in (OAuth), which
Mail 1.0.0 does not support.


5. Installation
---------------
1. Copy the folder jb-mail-php to the web server (e.g. via SFTP or FTP),
   for example as https://your-domain.example/mail/
2. Open this address in the browser. The bridge checks the environment and
   shows the result. Clarify missing requirements with the web server operator.
3. The bridge creates the file jb-mail-setup-code.php in the program folder.
   Open this file via SFTP/FTP and copy the setup code. This way only someone
   with access to the server can set it up.
4. Enter the setup code, the data folder and the first access
   (administration). Ideally create the data folder outside the web root.
5. Sign in. At the first sign-in the second factor is set up: scan the QR code
   with an authenticator app (e.g. Microsoft Authenticator, Google
   Authenticator, FreeOTP, Aegis).
6. Create further accesses under Settings → Administration. Hand over the
   initial password through a separate channel; at the first sign-in every
   person chooses an own password and sets up the second factor.

The start page is index.php; jb-mail.php can also be opened directly.


6. Additional protection per web server
---------------------------------------
The bridge protects its files itself: every file of the bridge starts with a
PHP abort line, so nothing comes out via the web. In addition the package
contains:

- .htaccess            for Apache 2.4 and LiteSpeed
- web.config           for Microsoft IIS
- nginx-beispiel.conf  example for nginx (copy into the server configuration)

During setup the bridge checks whether the data folder is reachable via the
web and warns in that case.

If HTTPS terminates at an upstream proxy or load balancer, set the option for
X-Forwarded-Proto under “Advanced” during setup.


7. What is stored where
-----------------------
- jb-mail-config.php   configuration (path of the data folder, server key).
                       Do not pass on.
- data folder          users.php (accesses; passwords only as an encrypted
                       key), u/ (encrypted settings per access), sessions/
                       (sessions), tmp/ (short-lived working files)


8. Backup, update, removal
--------------------------
- Backup: back up jb-mail-config.php and the data folder. The mails
  themselves are backed up by the mail server.
- Update: replace jb-mail.php, index.php and mail.html. jb-mail-config.php
  and the data folder are kept.
- Removal: delete the program folder and the data folder.


9. Security notes
-----------------
- The bridge sees mailbox passwords during a request. Only run it on a server
  your organisation trusts, and keep PHP and the web server up to date.
- If a person forgets the password, the administration sets a new initial
  password. The stored settings of that access are reset, because they are
  encrypted with the old password. The mails on the mail server are untouched.
- If the smartphone with the authenticator app is lost, the administration
  resets the second factor.
- Own certificate authorities (e.g. from JUMBO BLOCK Cert) can be stored per
  access under Settings → S/MIME as trust anchors; they also apply to the TLS
  connection to internal mail servers.


10. Differences to the bridge jb-mail.py
----------------------------------------
- No local archive and no outbox for offline operation: the server bridge
  always works directly with the mail server.
- Drafts are kept in the drafts folder of the mail server.
- Imported files (.eml, .mbox, Thunderbird, Outlook .msg, .pst, .ost) go to
  the folder “Import” of the mailbox.
- Without signing in, files can still be opened offline when mail.html is
  opened directly.

Third-party software included: none.
