Mateusz Radomski 67b9882226 | 4 年之前 | |
---|---|---|
FUNDING.yml | 4 年之前 | |
LICENCE | 4 年之前 | |
README.md | 4 年之前 | |
emailwiz.sh | 4 年之前 | |
mailrm.sh | 5 年之前 |
I wrote this script during the gruelling process of installing and setting up an email server. It perfectly reproduces my successful steps to ensure the same setup time and time again.
I’ve linked this file on Github to a shorter, more memorable address on my website so you can get it on your machine with this short command:
curl -LO lukesmith.xyz/emailwiz.sh
When prompted by a dialog menu at the beginning, select “Internet Site”, then
give your full domain without any subdomain, i.e. lukesmith.xyz
.
Read this readme and peruse the script’s comments before running it. Expect it to fail and you have to do bug testing and you will be very happy when it actually works perfectly.
mail.
subdomain.
Create a nginx/apache site at mail.<yourdomain.com>
and get a certificate
for it with Let’s Encrypt’s Certbot.mail.
subdomain.apt purge
all your previous (failed) attempts to install and configure a
mailserver. Get rid of all your system settings for Postfix, Dovecot,
OpenDKIM and everything else. This script builds off of a fresh install.Let’s say we want to add a user Billy and let him receive mail, run this:
useradd -m -G mail billy
passwd billy
Any user added to the mail
group will be able to receive mail. Suppose a user
Cassie already exists and we want to let her receive mail to. Just run:
usermod -a -G mail cassie
A user’s mail will appear in ~/.Mail/
. I you want to see your mail while
ssh’d in the server, you could just install mutt, add set spoolfile="+Inbox"
to your ~/.muttrc
and use mutt to view and reply to mail. You’ll probably
want to log in remotely though:
Let’s say you want to access your mail with Thunderbird or mutt or another email program. For my domain, the server information will be as follows:
mail.lukesmith.xyz
mail.lukesmith.xyz
luke
(I.e. not luke@lukesmith.xyz
)The last point is important. Many email systems use a full email address on login. Since we just simply use local PAM logins, only the user’s name is used (this makes a difference if you’re using my mutt-wizard, etc.).
You’re a big boy now if you have your own mail server!
You can tweak Postfix (sending mail
If this script or documentation has saved you some frustration, you can donate to support me at lukesmith.xyz/donate.