Sends an email notification whenever the root account logs in to Jahia. Uses the mail service already configured in Jahia, with fully customisable subject and body templates.
- Jahia 8.2.1.0 or later
graphql-dxm-providermodulerichtext-ckeditor5module- A mail server configured in Jahia (Administration → Server settings → Configuration → Mail server)
- In Jahia, go to Administration → Server settings → System components → Modules
- Upload the JAR
root-login-notification-X.X.X.jar - Check that the module is started
Go to Administration → Server settings → Configuration → Root login notification.
| Field | Description | Default |
|---|---|---|
| Recipient | Email address that receives the notification. Leave empty to use the Jahia mail service default. | (Jahia default) |
| Sender | From address used for the notification. Leave empty to use the Jahia mail service default. | (Jahia default) |
| Subject | Subject template. Supports {server} (hostname) and {site} (site key) tokens. |
[{server} - {site}] Connection notification to the root account |
| Body | HTML body template. Supports {ip} (client IP) and {time} (login timestamp) tokens. Editable with a rich-text editor. |
(HTML template) |
Settings can also be managed via file or GraphQL — see the sections below.
Create or edit org.jahia.community.rootloginnotification.cfg in the Jahia configuration directory:
# Optional — leave commented to use the Jahia mail service default
#recipient=security@example.com
#sender=noreply@example.com
subject=[{server} - {site}] Connection notification to the root account
body=<p>Hi,</p><p>We're sending this email following a successful connection to the root user.</p><p>Connection IP: {ip}<br>Connection time: {time}</p><p>Regards,</p>All operations are grouped under the rootLoginNotification namespace field and require the custom rootLoginNotificationAdmin permission (the module ships a root-login-notification-administrator role that grants it) — not the generic admin permission.
query {
rootLoginNotification {
settings {
recipient # String (null = Jahia default)
sender # String (null = Jahia default)
subject
body
}
}
}mutation {
rootLoginNotification {
saveSettings(
recipient: "security@example.com" # optional
sender: "noreply@example.com" # optional
subject: "[{server}] Root login"
body: "<p>IP: {ip} — {time}</p>"
)
}
}Returns true on success, false on error. Passing null for recipient or sender resets them to the Jahia mail service default. Invalid email addresses are rejected.
{ip}— the connection address as Jahia resolves it (getRemoteAddr()). Behind a reverse proxy, this is the proxy's address unless Tomcat'sRemoteIpValveis configured with that proxy as trusted, in which case it is the client address the proxy reports.{site}— the key of the site that serves the host name of the login request, orsystemsitewhen no site serves it.{server}— the client-supplied Host header (advisory). CR/LF header-injection is stripped, but forgery of an otherwise-valid hostname is out of scope for this notification.