Skip to content

Exim multi cert#249

Open
runout-at wants to merge 10 commits into
vexim:masterfrom
runout-at:exim-multi-cert
Open

Exim multi cert#249
runout-at wants to merge 10 commits into
vexim:masterfrom
runout-at:exim-multi-cert

Conversation

@runout-at

Copy link
Copy Markdown
Contributor

support for multiple ssl-certificates
#246

This script will query the vexim database.domains table
and try to create/renew certificates for all domains
Certbot will listen on the IP resolved by DNS
and the ACME server will use the same IP for validating
This script will query the vexim database.domains table
and try to create/renew certificates for all domains
Certbot will listen on the IP resolved by DNS
and the ACME server will use the same IP for validating
* some minor bugfixes and cleanup
* write config file for dovecot for all domains if DOVECOT_SSL= is set properly
create certificate with all domains in the SAN field as fallback
@Udera

Udera commented Apr 2, 2018

Copy link
Copy Markdown
Collaborator

Nice work! So, it's mainly for the user that they can use their own domain name for all mail-related services which is great. And if you are concerned about SNI-support in other mail servers (for incoming mail) you still ca use the default hostname in the mx-entry of the DNS. I think it's a very nice feature for vexim.

I didn't go through the code yet. It's probably for debian systems, I will see if I can get this working under FreeBSD.

@runout-at

Copy link
Copy Markdown
Contributor Author

the script 'mon-certificates' makes sure that all certificates in the database are getting generated by certbot. just tin case you are lazy and wouldn't do it manually.

@rimas-kudelis rimas-kudelis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running the script locally and it failed. Maybe that's because I wasn't running it as root.
I got a bunch of lines like this in the output:

dig: '.admin' is not a legal name (empty label) # in other lines .admin was replaced with my TLD's.

Also I had a bunch of other comments, see below.

Also, there's currently no place in our distribution dedicated to scripts like this, so I'm reluctant to merge this in. Maybe a better place for it would be in the Wiki, at least for now?

Comment thread docs/mon-certificates
Comment on lines +64 to +66
# set this if a config file for dovecot should be created
# this will also reload dovecot
# will be used only if the dovecot binary is executable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says "dovecot", but obviously Exim is meant here.

Comment thread docs/mon-certificates
Comment on lines +81 to +83
NGINX_PASS="proxy_pass http://mail1;"
# a file where additional parameters for proxy configurations will be
NGINX_PROXYPARAMS="include /etc/nginx/proxy_params;"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NGINX_PROXY_PASS and NGINX_PROXY_PARAMS would look nicer

Comment thread docs/mon-certificates
SUBDOMAIN_LIST_WWW="vexim"

# if you want to use a dedicated DNS resolver put it here
DNSSERVER="ns1.runout.at"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really want to leave your own DNS server as example?

Comment thread docs/mon-certificates
# If you're behind a nat or you have some kind of port forwarding
# you can set a global IP for certbot here.
# certbot will listen on this IP but the ACME server will use the IP from DNS
DOMAIN_IP_OVERRIDE=""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options that are optional should probably be commented out?

Comment thread docs/mon-certificates
Comment on lines +26 to +27
# type of IP address should be used "AAAA" or "A"
DNSTYPE="AAAA"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lacks an explanation about what record we are talking about here.

Comment thread docs/mon-certificates
fi

if [ ! -z "${EXIM_SSL}" ] && [ -x "${EXIM_BIN}" ]; then
mv -f ${EXIM_SSL} ${DOVECOT_SSL}.1 2>/dev/null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparent copy-paste error here.

Comment thread docs/mon-certificates
@@ -0,0 +1,288 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/bin/sh would be more portable.

@runout-at

Copy link
Copy Markdown
Contributor Author

thx for the feedback. The script is running on my server daily. I'll check if I have made changes and report back.

This would be the interesting part for a merge:

‎docs/debian-conf.d/main/00_vexim_listmacrosdefs

Maybe I should have made separate PRs for the monitoring scripts.

@rimas-kudelis

Copy link
Copy Markdown
Collaborator

The macros change also seems quite specific to your server. First, because it's probably Debian-specific, but also because it uses /DEFAULT/ as fallback, which I suspect is a symlink you might have created yourself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants