Herald is a Minecraft server plugin that sends notifications when players join the server. It supports both email and Discord notifications.
- Email notification system for player logins
- Discord webhook notifications for player logins
- Configurable notification methods (email, Discord, or both)
- Easy to configure and use
- Built-in mail server setup with Docker
- Minecraft server with version 1.16 or higher
- Java runtime environment
- Docker and Docker Compose (for mail server setup)
- Download the Herald plugin JAR file
- Place the JAR file in your server's
pluginsfolder - Restart your server or use a plugin manager to load the plugin
- Configure the plugin settings as needed
Herald requires an email server to send notifications. We've provided a Docker Compose setup that makes this easy.
-
Make sure Docker and Docker Compose are installed on your system
-
Use the included
compose.ymlfile to start the mail services:docker compose up -d
-
Configure your Herald plugin to use the mail server (see configuration section below)
-
Access the MailHog web interface at http://localhost:8025 to view all sent emails
This setup creates two mail-related services:
- mailserver: A Postfix mail server that accepts emails from your Herald plugin
- mailhog: A mail catcher that captures all outgoing emails for easy viewing
All emails sent to the mail server are relayed to MailHog, where you can view them in a convenient web interface.
After first run, a configuration file will be created that you can modify to set up your notification preferences.
Update your Herald config.yml to configure email and/or Discord notifications:
# Herald Configuration
# Email Recipients
# List of email addresses to notify when a player joins
email-recipients:
- "admin@example.com"
- "moderator@example.com"
# SMTP Configuration
smtp:
server: "mailserver" # Use "localhost" if Herald is on the same machine
port: 25 # Standard SMTP port
username: "" # No authentication needed
password: ""
use-tls: false
email:
sender: "minecraft@minecraft-mail.local"
# Discord Configuration
discord:
enabled: false # Set to true to enable Discord notifications
webhook-url: "" # Your Discord webhook URLMake sure to replace "mailserver" with your server's IP address if your Minecraft server is not running in the same Docker network.
To enable Discord notifications:
- In your Discord server, go to Server Settings → Integrations → Webhooks
- Click "New Webhook"
- Configure the webhook:
- Set a name (e.g., "Herald Bot")
- Choose the channel where notifications should be sent
- Copy the webhook URL
- In your Herald
config.yml, set:discord.enabled: truediscord.webhook-url: "<your-webhook-url>"
- Restart your Minecraft server or reload the plugin
You can use Discord notifications alone or in combination with email notifications.
The Docker Compose setup includes a test Minecraft server that can be used to test the Herald plugin:
services:
testmcserver:
build: .
image: herald-test-mc-server
container_name: herald-test-mc-server
ports:
- "25565:25565"
volumes:
- type: bind
source: ./testmcserver
target: /testmcserver
environment:
- MINECRAFT_VERSION=${MINECRAFT_VERSION}
- OPERATOR_UUID=${OPERATOR_UUID}
- OPERATOR_NAME=${OPERATOR_NAME}
- OPERATOR_LEVEL=${OPERATOR_LEVEL}
- OVERWRITE_EXISTING_SERVER=${OVERWRITE_EXISTING_SERVER}
networks:
- mail-networkEnvironment variables can be configured in a .env file (sample provided).
All emails sent by the Herald plugin will be captured by MailHog. To view them:
- Open your web browser
- Go to http://localhost:8025
- View and inspect all sent emails in the MailHog interface
- Emails not showing up in MailHog: Make sure your Herald plugin is configured with the correct server address and port.
- Connection refused errors: Verify that the Docker containers are running with
docker psand that you're using the correct address. - Authentication failures: This setup doesn't require authentication by default; make sure username and password fields are empty in your Herald config.
This setup is primarily intended for development and testing. For production use:
- Remove the
RELAYHOSTenvironment variable from the mailserver service - Configure proper DNS records for your mail server
- Set up TLS certificates for secure email transmission
- Consider adding spam protection measures
The project uses Gradle for building:
```shell script
./gradlew build
```
This will create a fat JAR with all dependencies included.
- Daniel McCoy Stephenson