Mailing Configuration
The mailing configuration in mineLogin is essential for features like account recovery and email verification. It allows the plugin to send emails to players for various authentication and security purposes.
Here's the relevant section from the configuration file:
mailing:
enabled: false
email-warning: true
server-name: YourAddress.net
sender-email: [email protected]
from: mineLogin
server: smtp.sendgrid.net
port: 587
username: apikey
password: securePassword
email-title: Account recovery on YourAddress.net
transport-strategy: SMTP
Options Explained
enabled
:- Purpose: Toggles the mailing system on or off.
- Values:
true
orfalse
- Set to
true
to enable email functionality.
email-warning
:- Purpose: Determines whether to display a warning when no email address is associated with an account.
- Values:
true
orfalse
- When
true
, players without an email will be prompted to add one.
server-name
:- Purpose: Sets the name of your server as it appears in emails.
- Example:
YourAddress.net
sender-email
:- Purpose: The email address from which recovery and verification emails will be sent.
- Example:
[email protected]
from
:- Purpose: The name that appears as the sender of the email.
- Example:
mineLogin
server
:- Purpose: The SMTP server address for sending emails.
- Example:
smtp.sendgrid.net
port
:- Purpose: The port number for the SMTP server.
- Common values:
587
(TLS),465
(SSL),25
(unencrypted)
username
:- Purpose: The username for authenticating with the SMTP server.
- Note: For services like SendGrid, this might be
apikey
password
:- Purpose: The password or API key for authenticating with the SMTP server.
email-title
:- Purpose: The subject line for account recovery emails.
- Example:
Account recovery on YourAddress.net
transport-strategy
:- Purpose: The encryption and connection method for the SMTP server.
- Options:
SMTP
,SMTPS
,SMTP_TLS
,SMTP_OAUTH2
- Most common:
SMTP_TLS
for port 587
Best Practices
Use a Dedicated Email: Create a dedicated email address for server communications to maintain professionalism and manage responses.
Secure SMTP Settings: Always use encrypted connections (TLS or SSL) when configuring your SMTP settings.
API Keys: For services like SendGrid, use API keys instead of account passwords for added security.
Test Thoroughly: After configuration, send test emails to ensure everything is working correctly.
Monitor Delivery: Regularly check that emails are being delivered and not marked as spam.
Clear Instructions: Ensure that the content of your emails (configured elsewhere) provides clear instructions for account recovery or verification.
Compliance: Ensure your email practices comply with relevant laws and regulations (e.g., GDPR, CAN-SPAM).
Example Configuration
Here's an example of a typical mailing configuration using SendGrid:
mailing:
enabled: true
email-warning: true
server-name: EpicMC.net
sender-email: [email protected]
from: EpicMC Support
server: smtp.sendgrid.net
port: 587
username: apikey
password: SG.your_sendgrid_api_key_here
email-title: Account Recovery for EpicMC.net
transport-strategy: SMTP_TLS
Troubleshooting
Emails Not Sending:
- Verify SMTP server details and credentials.
- Check if your hosting provider blocks outgoing SMTP traffic.
Emails Marked as Spam:
- Ensure your domain has proper SPF and DKIM records.
- Use a reputable email service provider.
Connection Errors:
- Confirm that the specified port is open and not blocked by firewalls.
- Verify that the
transport-strategy
matches the port and encryption method of your SMTP server.
Remember to handle email addresses securely and provide options for players to update or remove their email addresses from your system. Also, ensure that your privacy policy covers how you handle and use email addresses collected through the plugin.