You've set up your IRC server and you have Anope running smoothly, but now you want email confirmation?
Here's a small tutorial on how to do it, using Gmail as email relay, which you can reuse to make it work with your own email server.
NOTE: For the purpose of this tutorial I'm assuming you're using Ubuntu/Debian, nano editor and that there's no SMTP server running on your machine.
Follow this tutorial to enable an app password for your account and save the password on a safe location because you're going to see it only once.
How.To.Set.Up.Gmail.SMTP.Server.-.Full.Guide.mp4
NOTE: Save the app password without spaces between each set of characters (it'll be displayed with spaces for easiness of reading)
On your server, as root, type: apt install msmtp-mta msmtp
If it asks if you want to enable apparmor support, chose <Yes>
- Now, go back to your Anope user, type
nano ~/.msmtprcand put the below inside your file, editing it to fit your needs:
### Default values for all following accounts. ###
defaults
auth on
tls on
tls_certcheck on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
logfile_time_format "%d %b %Y - %H:%M:%S"
### Anope account ###
account services
# SMTP server host
host smtp.gmail.com
# SMTP server port
port 587
### Encryption method ###
# For port 587 set to "on"
tls_starttls on
### EDIT ONLY HERE ###
# SMTP user (used to log in)
user "user@gmail.com"
# SMTP From (must match your account for Gmail)
from "user@gmail.com"
# SMTP user password
password "password_from_video_tutorial"
### STOP EDITING HERE ###
### Default account to use when none is specified ###
account default: services
- Hit
CTRL+X, followed byYand thenEnterto save your.msmtprcfile. - Set the correct file permissions with
chmod 600 ~/.msmtprc
To test your MSMTP configuration, type the following command on your terminal:
echo "MSMTP test for Anope." | msmtp -a services your_email@domain.com
If you received the email sent with the above comment, then it means you have it all working.
- For Anope 2.0, edit services.conf and do the following:
- Replace
sendmailpath = "/usr/sbin/sendmail -t"withsendmailpath = "/usr/bin/msmtp -a services -t" - Replace
sendfrom = "services@example.com"withsendfrom = "Network Services <user@gmail.com>"
- For Anope 2.1, edit anope.conf and do the following:
- Replace
sendmailpath = "/usr/sbin/sendmail -t"withsendmailpath = "/usr/bin/msmtp -a services -t" - Replace
sendfrom = "services@example.com"withsendfrom = "Network Services <user@gmail.com>"
Now, just reload or restart Anope and you have successfully enabled email confirmation on Anope.