Automx2: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 35: Line 35:


curl '<nowiki>http://127.0.0.1:4243/mail/config-v1.1.xml?emailaddress=user@example.com'</nowiki> 2>/dev/null | xmllint --format -
curl '<nowiki>http://127.0.0.1:4243/mail/config-v1.1.xml?emailaddress=user@example.com'</nowiki> 2>/dev/null | xmllint --format -
<pre>
<?xml version="1.0"?>
<clientConfig version="1.1">
  <emailProvider id="automx2-1000">
    <identity/>
    <domain>example.com</domain>
    <domain>example.net</domain>
    <domain>example.org</domain>
    <displayName>Big Corporation, Inc.</displayName>
    <displayShortName>BigCorp</displayShortName>
    <outgoingServer type="smtp">
      <hostname>primary-smtp.ca10d6201c36438dae4038d3c30b9731.com</hostname>
      <port>587</port>
      <socketType>STARTTLS</socketType>
      <username>%EMAILADDRESS%</username>
      <authentication>plain</authentication>
    </outgoingServer>
    <incomingServer type="imap">
      <hostname>imap1.6e457bf8fd81421c92df72ecff3ebf19.com</hostname>
      <port>143</port>
      <socketType>STARTTLS</socketType>
      <username>%EMAILADDRESS%</username>
      <authentication>plain</authentication>
    </incomingServer>
  </emailProvider>
</clientConfig>
</pre>


NB you can delete everything in the database by using
NB you can delete everything in the database by using

Revision as of 06:52, 2 April 2025

Automx2 sets up a service that allows various email clients to automatically configure themselves on the basis of information delivered through a webpage.

https://rseichter.github.io/automx2/ setup guide

https://github.com/rseichter/automx2 actual github page

https://erlangen-sheppy.medium.com/client-auto-config-for-self-hosted-mail-8947c16f77d5 - useful guide


=Gotchas during setup=

When setting up sudo to the automx2 user. Not for setting up the service in systemd

After the first run (as automx2 user)

~/.venv/bin/flask.sh h run --host=127.0.0.1 --port=4243

use a different terminal to run the tests.

Then in ~/.automx2.conf comment out db_uri = sqlite:///:memory:

and set the db line to

db_uri = sqlite:////var/www/automx2/db.sqlite

Then when you populate the database it will create the file.

It is possible to populate the database with the json file, but then do not delete any of the lines of the example! It's just as good (if not better) to populate using the

curl -X GET http://127.0.0.1:4243/initdb/

command as it gets you more sane input.

You can see what it gives you if you then run (if you have libxml2-utils installed)

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>
    <domain>example.net</domain>
    <domain>example.org</domain>
    <displayName>Big Corporation, Inc.</displayName>
    <displayShortName>BigCorp</displayShortName>
    <outgoingServer type="smtp">
      <hostname>primary-smtp.ca10d6201c36438dae4038d3c30b9731.com</hostname>
      <port>587</port>
      <socketType>STARTTLS</socketType>
      <username>%EMAILADDRESS%</username>
      <authentication>plain</authentication>
    </outgoingServer>
    <incomingServer type="imap">
      <hostname>imap1.6e457bf8fd81421c92df72ecff3ebf19.com</hostname>
      <port>143</port>
      <socketType>STARTTLS</socketType>
      <username>%EMAILADDRESS%</username>
      <authentication>plain</authentication>
    </incomingServer>
  </emailProvider>
</clientConfig>

NB you can delete everything in the database by using

curl -X DELETE http://127.0.0.1:4243/initdb/


=Updating=

make sure you are su automx2

cd /srv/www/automx2 .venv/bin/pip install --upgrade automx2