Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbsd-mailserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
barnslig
openbsd-mailserver
Commits
7aadde2d
Commit
7aadde2d
authored
5 years ago
by
barnslig
Browse files
Options
Downloads
Patches
Plain Diff
initial config commit
parent
9e80cf47
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+39
-1
39 additions, 1 deletion
README.md
etc/acme-client.conf
+11
-0
11 additions, 0 deletions
etc/acme-client.conf
etc/httpd.conf
+36
-0
36 additions, 0 deletions
etc/httpd.conf
etc/mail/smtpd.conf
+0
-0
0 additions, 0 deletions
etc/mail/smtpd.conf
with
86 additions
and
1 deletion
README.md
+
39
−
1
View file @
7aadde2d
# openbsd-mailserver
Plan and document how an OpenBSD mailserver works.
## install software
```
pkg_add opensmtpd-extras-pgsql postgresql-server
```
## enable postgres
We first have to create a new database:
```
doas -u _postgresql mkdir /var/postgresql/data
doas -u _postgresql initdb -D /var/postgresql/data -U postgres -A scram-sha-256 -E UTF8 -W
```
Now we can enable and start the database server:
```
rcctl enable postgresql
rcctl start postgresql
```
## enable httpd
```
rcctl enable httpd
rcctl start httpd
```
## crontab
Run
`crontab -e`
and add the following lines:
```
# renew acme certificates every day at some time between 00:00 and 01:00
~ 0 * * * acme-client barnslig.xyz && rcctl reload httpd
```
This diff is collapsed.
Click to expand it.
etc/acme-client.conf
0 → 100644
+
11
−
0
View file @
7aadde2d
authority
letsencrypt
{
api
url
"https://acme-v02.api.letsencrypt.org/directory"
account
key
"/etc/acme/letsencrypt-privkey.pem"
}
domain
barnslig
.
xyz
{
alternative
names
{
mail
.
barnslig
.
xyz
frieder
.
barnslig
.
eu
}
domain
key
"/etc/ssl/private/barnslig.xyz.key"
domain
full
chain
certificate
"/etc/ssl/barnslig.xyz.fullchain.pem"
sign
with
letsencrypt
}
This diff is collapsed.
Click to expand it.
etc/httpd.conf
0 → 100644
+
36
−
0
View file @
7aadde2d
server
"barnslig.xyz" {
alias
mail.barnslig.xyz
alias
frieder.barnslig.eu
listen
on
* port 80
location
"/.well-known/acme-challenge/*" {
root "/acme"
request
strip 2
}
location
* {
block
return 302 "https://$HTTP_HOST$REQUEST_URI"
}
}
server
"barnslig.xyz" {
alias
mail.barnslig.xyz
alias
frieder.barnslig.eu
listen
on
*
tls
port 443
tls
{
certificate "/etc/ssl/barnslig.xyz.fullchain.pem"
key "/etc/ssl/private/barnslig.xyz.key"
}
location
"/pub/*" {
directory
auto
index
}
location
"/.well-known/acme-challenge/*" {
root "/acme"
request
strip 2
}
}
This diff is collapsed.
Click to expand it.
etc/mail/smtpd.conf
0 → 100644
+
0
−
0
View file @
7aadde2d
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment