Skip to content

Instantly share code, notes, and snippets.

server {
server_name autoconfig.example.de autodiscover.example.de;
listen 443 ssl;
listen [::]:443 ssl;
location /initdb {
allow 127.0.0.1;
deny all;
}
mv automx2.service /etc/systemd/system/automx2.service
systemctl enable /etc/systemd/system/automx2.service
systemctl start automx2.service
systemctl status automx2.service
@FAUSheppy
FAUSheppy / automx2.service
Last active January 31, 2022 11:37
Automx2 Systemd Service
[Unit]
After=network.target
Description=MUA configuration service
Documentation=https://rseichter.github.io/automx2/
[Service]
WorkingDirectory=/home/automx2
Environment=FLASK_APP=automx2.server:app
Environment=FLASK_CONFIG=production
ExecStart=/usr/bin/python3 -m flask run --host=127.0.0.1 --port=4243
@FAUSheppy
FAUSheppy / configure_database.sqlite
Last active January 31, 2022 10:55
sqlite configuration
# clear database #
DELETE FROM provider;
DELETE FROM server;
DELETE FROM domain;
DELETE FROM server_domain;
# define a provider #
INSERT INTO provider VALUES(100, "long_name_example.com", "short_name");
# define servers (imap + stmp) #
@FAUSheppy
FAUSheppy / example_output.xml
Last active January 31, 2022 13:18
Example autoconfig
curl 'http://127.0.0.1:4243/mail/config-v1.1.xml?emailaddress=user@example.com' \
2>/dev/null | xmllint --format -
---
<?xml version="1.0"?>
<clientConfig version="1.1">
<emailProvider id="automx2-1000">
<identity/>
<domain>example.com</domain>
@FAUSheppy
FAUSheppy / run_automx_init_db.sh
Created January 31, 2022 10:07
Run automx with Flask and init db
FLASK_APP=automx2.server:app python -m flask run --host=127.0.0.1 --port 4243
# --- different console --- #
curl http://localhost:4243/initdb
@FAUSheppy
FAUSheppy / .automx2.conf
Last active January 31, 2022 11:43
Automx Configuration File
[automx2]
loglevel = DEBUG # or WARNING
db_echo = no
db_uri = sqlite:////home/automx2/automxdb.sqlite
@FAUSheppy
FAUSheppy / automx_setup.sh
Last active January 31, 2022 10:01
Automx Setupscript
su automx2
cd /home/automx2/
wget https://github.com/rseichter/automx2/raw/master/contrib/setupvenv.sh
chmod u+x setupvenv.sh
./setupvenv.sh
@FAUSheppy
FAUSheppy / requirements.py
Last active January 31, 2022 13:15
Automx Requirements
pip install flask automx2
sudo apt install python3-venv
sudo adduser --create-home automx2
@FAUSheppy
FAUSheppy / create_automx_user.sh
Created January 31, 2022 09:57
Create a new user for automx2
sudo useradd --create-home automx2