28 Oct 2024 |
mcnesium | another test event I created has "inLanguage":"mad" 🙈 | 15:48:45 |
mcnesium | so that is one thing, but I have more ☝️😃.
I am trying to run the event-importer myself using docker (thanks to setop for commiting the Dockerfile!). I found that I need to pass those env vars. So I got it to start, but then it only displays this error in the frontend and in the log it says Error: Failed to lookup view "home" in views directory "/dist/src/views . what did I miss?
| 17:55:43 |
| juan11iguel joined the room. | 23:30:17 |
juan11iguel | Hello, I am trying to set a self hosted instance to handle events related to a public research institution, and hopefully offer it to other users/institutions if it works well / we find it useful internally.
As for now, I am just another frustrated victim trying to get emails to work
I went the docker route, and trying by registering an user from the command line, and then for every trial asking for a password reset. The problem is that there are may levers that one can play with, but even with the most permissive logging, all I can see is:
mobilizon-1 | 23:37:41.289 request_id=GALCIrsPCosoCA8AAAbx graphql_operation_name=SendResetPassword [info] Sent 200 in 2ms
This is my current configuration:
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: "correo.psa.es",
port: System.get_env("MOBILIZON_SMTP_PORT", "25"), # 465
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil), # Valid account credentials
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :always,
ssl: false,
allowed_tls_versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
tls_options: [
verify: :verify_none,
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
# cacerts: :public_key.cacerts_get(),
server_name_indication: ~c"correo.psa.es",
depth: 99
],
retries: 3,
no_mx_lookups: false,
auth: :if_available
If anyone can give me a hand I would greatly appreciate it
Thanks! Juanmi
| 23:45:35 |
29 Oct 2024 |
Tobias | In reply to @juasmis:matrix.org
Hello, I am trying to set a self hosted instance to handle events related to a public research institution, and hopefully offer it to other users/institutions if it works well / we find it useful internally.
As for now, I am just another frustrated victim trying to get emails to work
I went the docker route, and trying by registering an user from the command line, and then for every trial asking for a password reset. The problem is that there are may levers that one can play with, but even with the most permissive logging, all I can see is:
mobilizon-1 | 23:37:41.289 request_id=GALCIrsPCosoCA8AAAbx graphql_operation_name=SendResetPassword [info] Sent 200 in 2ms
This is my current configuration:
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: "correo.psa.es",
port: System.get_env("MOBILIZON_SMTP_PORT", "25"), # 465
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil), # Valid account credentials
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :always,
ssl: false,
allowed_tls_versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
tls_options: [
verify: :verify_none,
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
# cacerts: :public_key.cacerts_get(),
server_name_indication: ~c"correo.psa.es",
depth: 99
],
retries: 3,
no_mx_lookups: false,
auth: :if_available
If anyone can give me a hand I would greatly appreciate it
Thanks! Juanmi
We have been through these pains as well and we ended up with a local Exim docker container which is configured to forward the mail to our smarthost MTA. The reason being that the local Exim does not need any special TLS or authentication which we had a lot of trouble getting to work with Mobilizon (depending on the MTA). Also be aware your MTA has to support SPF and DKIM nowadays. DMARC is a plus as well. | 07:11:24 |
cos | Maybe I'll also try local exim with everything disabled. Never got e-mails to work. Other services on same machine such as mastodon can send mail fine. | 07:16:56 |
juan11iguel | In reply to @0xc0deba5e:matrix.org We have been through these pains as well and we ended up with a local Exim docker container which is configured to forward the mail to our smarthost MTA. The reason being that the local Exim does not need any special TLS or authentication which we had a lot of trouble getting to work with Mobilizon (depending on the MTA). Also be aware your MTA has to support SPF and DKIM nowadays. DMARC is a plus as well. I will give it a try, | 07:40:18 |
juan11iguel | In reply to @0xc0deba5e:matrix.org We have been through these pains as well and we ended up with a local Exim docker container which is configured to forward the mail to our smarthost MTA. The reason being that the local Exim does not need any special TLS or authentication which we had a lot of trouble getting to work with Mobilizon (depending on the MTA). Also be aware your MTA has to support SPF and DKIM nowadays. DMARC is a plus as well. * I will give it a try, thanks! | 07:40:31 |
juan11iguel | * Hello, I am trying to set a self hosted instance to handle events related to a public research institution, and hopefully offer it to other users/institutions if it works well / we find it useful internally.
As for now, I am just another frustrated victim trying to get emails to work
I went the docker route, and trying by registering an user from the command line, and then for every trial asking for a password reset. The problem is that there are many levers that one can play with, but even with the most permissive logging, all I can see is:
mobilizon-1 | 23:37:41.289 request_id=GALCIrsPCosoCA8AAAbx graphql_operation_name=SendResetPassword [info] Sent 200 in 2ms
This is my current configuration:
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: "correo.psa.es",
port: System.get_env("MOBILIZON_SMTP_PORT", "25"), # 465
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil), # Valid account credentials
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :always,
ssl: false,
allowed_tls_versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
tls_options: [
verify: :verify_none,
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2", :"tlsv1.3"],
# cacerts: :public_key.cacerts_get(),
server_name_indication: ~c"correo.psa.es",
depth: 99
],
retries: 3,
no_mx_lookups: false,
auth: :if_available
If anyone can give me a hand I would greatly appreciate it
Thanks! Juanmi
| 07:40:57 |
juan11iguel | Download exim.conf | 19:36:26 |
juan11iguel | Download image.png | 19:39:01 |
juan11iguel | Redacted or Malformed Event | 19:39:22 |
juan11iguel | Hello again, first a summary of how far I've got so far:
- Setup exim in a docker container
- I can send mails from this container
1. Setup exim in a docker container
I've based myself in devture/exim-relay, but modified the conf file (find attached its configuration)
Dockerfile:
FROM docker.io/alpine:3.20.2
RUN apk --no-cache add exim tini && \
mkdir /var/spool/exim && \
chmod 777 /var/spool/exim && \
ln -sf /dev/stdout /var/log/exim/mainlog && \
ln -sf /dev/stderr /var/log/exim/panic && \
ln -sf /dev/stderr /var/log/exim/reject && \
chmod 0755 /usr/sbin/exim
RUN apk --no-cache add openssl
COPY exim.conf /etc/exim/exim.conf
# Regardless of the permissions of the original `exim.conf` file in the build context,
# ensure that the `/etc/exim/exim.conf` configuration file is not writable by the Exim user.
# Otherwise, we'll get an Exim panic:
# > Exim configuration file /etc/exim/exim.conf has the wrong owner, group, or mode
RUN chmod 664 /etc/exim/exim.conf
# Generate certificates for TLS
RUN openssl req -x509 -sha256 -days 9000 -nodes -newkey rsa:4096 -keyout exim.key -out exim.crt -subj "/CN=exim-relay" && \
mv exim.crt /etc/ssl/exim.crt && \
mv exim.key /etc/ssl/exim.key
USER exim
EXPOSE 8025
ENV LOCAL_DOMAINS=@ \
RELAY_FROM_HOSTS=10.0.0.0/8:172.16.0.0/12:192.168.0.0/16 \
RELAY_TO_DOMAINS=* \
RELAY_TO_USERS= \
DISABLE_SENDER_VERIFICATION= \
HOSTNAME= \
SMARTHOST= \
SMTP_PASSWORD= \
SMTP_USERDOMAIN= \
SMTP_USERNAME=
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["exim", "-bdf", "-q15m"]
docker-compose:
...
services:
exim-relay:
container_name: mobilizon-exim-relay
# image: docker.io/devture/exim-relay:4.98-r0-1
build:
context: ./exim-relay
dockerfile: Dockerfile
env_file:
- ./exim-relay/.env
user: 100:101
restart: always
networks:
- default
ports:
- "25:8025"
environment:
HOSTNAME: external.psa.es
SMARTHOST: correo.psa.es::587
SMTP_USERNAME: username@psa.es
SMTP_PASSWORD: password
SMTP_USERDOMAIN: psa.es
2. Veryfied that I can send mails from this container
echo -e "From: username@psa.es\nSubject: test" | docker exec -i exim-relay-mobilizon exim -v jmserrano@psa.es
I think so far I managed to get the forwarding part correctly, now it only remains the mobilizon side of things, so far no lack. This is my compose, .env and config.exs:
compose
Same unhelpful log message, also can't see anything in exim container logs:
mobilizon | 19:32:03.407 request_id=GAMDT93_Txa8Et4AAAZh graphql_operation_name=SendResetPassword [info] Sent 200 in 4ms
I feel like I am getting there, if you guys can help me I would really appreciate it!
| 19:42:47 |
juan11iguel | * Hello again, first a summary of how far I've got so far:
- Setup exim in a docker container
- I can send mails from this container
1. Setup exim in a docker container
I've based myself in devture/exim-relay, but modified the conf file (find attached its configuration)
Dockerfile:
FROM docker.io/alpine:3.20.2
RUN apk --no-cache add exim tini && \
mkdir /var/spool/exim && \
chmod 777 /var/spool/exim && \
ln -sf /dev/stdout /var/log/exim/mainlog && \
ln -sf /dev/stderr /var/log/exim/panic && \
ln -sf /dev/stderr /var/log/exim/reject && \
chmod 0755 /usr/sbin/exim
RUN apk --no-cache add openssl
COPY exim.conf /etc/exim/exim.conf
# Regardless of the permissions of the original `exim.conf` file in the build context,
# ensure that the `/etc/exim/exim.conf` configuration file is not writable by the Exim user.
# Otherwise, we'll get an Exim panic:
# > Exim configuration file /etc/exim/exim.conf has the wrong owner, group, or mode
RUN chmod 664 /etc/exim/exim.conf
# Generate certificates for TLS
RUN openssl req -x509 -sha256 -days 9000 -nodes -newkey rsa:4096 -keyout exim.key -out exim.crt -subj "/CN=exim-relay" && \
mv exim.crt /etc/ssl/exim.crt && \
mv exim.key /etc/ssl/exim.key
USER exim
EXPOSE 8025
ENV LOCAL_DOMAINS=@ \
RELAY_FROM_HOSTS=10.0.0.0/8:172.16.0.0/12:192.168.0.0/16 \
RELAY_TO_DOMAINS=* \
RELAY_TO_USERS= \
DISABLE_SENDER_VERIFICATION= \
HOSTNAME= \
SMARTHOST= \
SMTP_PASSWORD= \
SMTP_USERDOMAIN= \
SMTP_USERNAME=
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["exim", "-bdf", "-q15m"]
docker-compose:
...
services:
exim-relay:
container_name: mobilizon-exim-relay
# image: docker.io/devture/exim-relay:4.98-r0-1
build:
context: ./exim-relay
dockerfile: Dockerfile
env_file:
- ./exim-relay/.env
user: 100:101
restart: always
networks:
- default
ports:
- "25:8025"
environment:
HOSTNAME: external.psa.es
SMARTHOST: correo.psa.es::587
SMTP_USERNAME: username@psa.es
SMTP_PASSWORD: password
SMTP_USERDOMAIN: psa.es
2. Veryfied that I can send mails from this container
echo -e "From: username@psa.es\nSubject: test" | docker exec -i exim-relay-mobilizon exim -v jmserrano@psa.es
I think so far I managed to get the forwarding part correctly, now it only remains the mobilizon side of things, so far no lack. This is my compose, .env and config.exs:
compose
networks:
base_proxy_network:
external: true
default:
ipam:
driver: default
services:
mobilizon:
container_name: mobilizon
image: docker.io/framasoft/mobilizon:latest
restart: unless-stopped
environment:
- MOBILIZON_INSTANCE_NAME
- MOBILIZON_INSTANCE_HOST
- MOBILIZON_INSTANCE_LISTEN_IP
- MOBILIZON_INSTANCE_PORT
- MOBILIZON_INSTANCE_EMAIL
- MOBILIZON_REPLY_EMAIL
- MOBILIZON_INSTANCE_REGISTRATIONS_OPEN
- MOBILIZON_DATABASE_USERNAME=${POSTGRES_USER}
- MOBILIZON_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
- MOBILIZON_DATABASE_DBNAME=${POSTGRES_DB}
- MOBILIZON_DATABASE_HOST=db
- MOBILIZON_DATABASE_PORT
- MOBILIZON_DATABASE_SSL
- MOBILIZON_INSTANCE_SECRET_KEY_BASE
- MOBILIZON_INSTANCE_SECRET_KEY
- MOBILIZON_LOGLEVEL
- MOBILIZON_SMTP_SERVER
- MOBILIZON_SMTP_PORT
- MOBILIZON_SMTP_SSL
- MOBILIZON_SMTP_TLS
- MOBILIZON_SMTP_USERNAME
- MOBILIZON_SMTP_PASSWORD
- MOBILIZON_UPLOADS
- MOBILIZON_UPLOADS_EXPORTS
- MOBILIZON_TIMEZONES_DIR
- MOBILIZON_TZDATA_DIR
volumes:
- ./uploads:/var/lib/mobilizon/uploads
- ./config.exs:/etc/mobilizon/config.exs:ro
ports:
- "4000:4000"
networks:
- base_proxy_network
- default
env_file: .env
labels:
- "traefik.enable=true"
- "traefik.http.routers.mobilizon.rule=Host(`events.psa.es`)"
- "traefik.http.routers.mobilizon.entrypoints=websecure"
- "traefik.http.routers.mobilizon.tls.certresolver=letsencryptresolver"
- "traefik.http.services.mobilizon.loadbalancer.server.port=4000"
- "traefik.http.middlewares.mobilizon-ipallowlist.ipallowlist.sourcerange=10.10.104.0/24, 10.10.105.0/24, 192.168.0.0/16, 193.146.147.128/25"
- "traefik.http.routers.mobilizon.middlewares=error-pages-middleware,mobilizon-ipallowlist"
db:
container_name: mobilizon-db
image: docker.io/postgis/postgis:15-3.4
restart: unless-stopped
volumes:
- ./db:/var/lib/postgresql/data:z
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
networks:
- default
env_file: .env
.env
######################################################
# Email settings #
######################################################
# The SMTP server
# Defaults to localhost
MOBILIZON_SMTP_SERVER=mobilizon-exim-relay
# The SMTP port
# Usual values: 25, 465, 587
# If using a local mail server, make sure the appropriate port is exposed in the docker-compose configuration as well
# Defaults to 25
MOBILIZON_SMTP_PORT=25
#
MOBILIZON_SMTP_AUTH=false
# The SMTP username
# Defaults to nil
# MOBILIZON_SMTP_USERNAME=
# The SMTP password
# Defaults to nil
# MOBILIZON_SMTP_PASSWORD=
# Whether to use SSL for SMTP.
# Boolean
# Defaults to false
MOBILIZON_SMTP_SSL=false
# Whether to use TLS for SMTP.
# Allowed values: always (TLS), never (Clear) and if_available (STARTTLS)
# Make sure to match the port value as well
# Defaults to "if_available"
MOBILIZON_SMTP_TLS=never
config.exs
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("MOBILIZON_SMTP_SERVER", "localhost"),
port: System.get_env("MOBILIZON_SMTP_PORT", "25"),
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil),
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :never,
ssl: false,
retries: 3,
no_mx_lookups: false,
auth: :never
Same unhelpful log message, also can't see anything in exim container logs:
mobilizon | 19:32:03.407 request\_id=GAMDT93\_Txa8Et4AAAZh graphql\_operation\_name=SendResetPassword \[info\] Sent 200 in 4ms
I feel like I am getting there, if you guys can help me I would really appreciate it!
| 19:45:07 |
juan11iguel | * Hello again, first a summary of how far I've got so far:
- Setup exim in a docker container
- I can send mails from this container
1. Setup exim in a docker container
I've based myself in devture/exim-relay, but modified the conf file (find attached its configuration)
Dockerfile
FROM docker.io/alpine:3.20.2
RUN apk --no-cache add exim tini && \
mkdir /var/spool/exim && \
chmod 777 /var/spool/exim && \
ln -sf /dev/stdout /var/log/exim/mainlog && \
ln -sf /dev/stderr /var/log/exim/panic && \
ln -sf /dev/stderr /var/log/exim/reject && \
chmod 0755 /usr/sbin/exim
RUN apk --no-cache add openssl
COPY exim.conf /etc/exim/exim.conf
# Regardless of the permissions of the original `exim.conf` file in the build context,
# ensure that the `/etc/exim/exim.conf` configuration file is not writable by the Exim user.
# Otherwise, we'll get an Exim panic:
# > Exim configuration file /etc/exim/exim.conf has the wrong owner, group, or mode
RUN chmod 664 /etc/exim/exim.conf
# Generate certificates for TLS
RUN openssl req -x509 -sha256 -days 9000 -nodes -newkey rsa:4096 -keyout exim.key -out exim.crt -subj "/CN=exim-relay" && \
mv exim.crt /etc/ssl/exim.crt && \
mv exim.key /etc/ssl/exim.key
USER exim
EXPOSE 8025
ENV LOCAL_DOMAINS=@ \
RELAY_FROM_HOSTS=10.0.0.0/8:172.16.0.0/12:192.168.0.0/16 \
RELAY_TO_DOMAINS=* \
RELAY_TO_USERS= \
DISABLE_SENDER_VERIFICATION= \
HOSTNAME= \
SMARTHOST= \
SMTP_PASSWORD= \
SMTP_USERDOMAIN= \
SMTP_USERNAME=
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["exim", "-bdf", "-q15m"]
docker-compose
...
services:
exim-relay:
container_name: mobilizon-exim-relay
# image: docker.io/devture/exim-relay:4.98-r0-1
build:
context: ./exim-relay
dockerfile: Dockerfile
env_file:
- ./exim-relay/.env
user: 100:101
restart: always
networks:
- default
ports:
- "25:8025"
environment:
HOSTNAME: external.psa.es
SMARTHOST: correo.psa.es::587
SMTP_USERNAME: username@psa.es
SMTP_PASSWORD: password
SMTP_USERDOMAIN: psa.es
2. Veryfied that I can send mails from this container
echo -e "From: username@psa.es\\nSubject: test" | docker exec -i exim-relay-mobilizon exim -v jmserrano@psa.es
Does send the test emails as can be seen in the attached picture.
I think so far I managed to get the forwarding part correctly, now it only remains the mobilizon side of things, so far no lack. This is my compose, .env and config.exs:
compose
networks:
base_proxy_network:
external: true
default:
ipam:
driver: default
services:
mobilizon:
container_name: mobilizon
image: docker.io/framasoft/mobilizon:latest
restart: unless-stopped
environment:
- MOBILIZON_INSTANCE_NAME
- MOBILIZON_INSTANCE_HOST
- MOBILIZON_INSTANCE_LISTEN_IP
- MOBILIZON_INSTANCE_PORT
- MOBILIZON_INSTANCE_EMAIL
- MOBILIZON_REPLY_EMAIL
- MOBILIZON_INSTANCE_REGISTRATIONS_OPEN
- MOBILIZON_DATABASE_USERNAME=${POSTGRES_USER}
- MOBILIZON_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
- MOBILIZON_DATABASE_DBNAME=${POSTGRES_DB}
- MOBILIZON_DATABASE_HOST=db
- MOBILIZON_DATABASE_PORT
- MOBILIZON_DATABASE_SSL
- MOBILIZON_INSTANCE_SECRET_KEY_BASE
- MOBILIZON_INSTANCE_SECRET_KEY
- MOBILIZON_LOGLEVEL
- MOBILIZON_SMTP_SERVER
- MOBILIZON_SMTP_PORT
- MOBILIZON_SMTP_SSL
- MOBILIZON_SMTP_TLS
- MOBILIZON_SMTP_USERNAME
- MOBILIZON_SMTP_PASSWORD
- MOBILIZON_UPLOADS
- MOBILIZON_UPLOADS_EXPORTS
- MOBILIZON_TIMEZONES_DIR
- MOBILIZON_TZDATA_DIR
volumes:
- ./uploads:/var/lib/mobilizon/uploads
- ./config.exs:/etc/mobilizon/config.exs:ro
ports:
- "4000:4000"
networks:
- base_proxy_network
- default
env_file: .env
labels:
- "traefik.enable=true"
- "traefik.http.routers.mobilizon.rule=Host(`events.psa.es`)"
- "traefik.http.routers.mobilizon.entrypoints=websecure"
- "traefik.http.routers.mobilizon.tls.certresolver=letsencryptresolver"
- "traefik.http.services.mobilizon.loadbalancer.server.port=4000"
- "traefik.http.middlewares.mobilizon-ipallowlist.ipallowlist.sourcerange=10.10.104.0/24, 10.10.105.0/24, 192.168.0.0/16, 193.146.147.128/25"
- "traefik.http.routers.mobilizon.middlewares=error-pages-middleware,mobilizon-ipallowlist"
db:
container_name: mobilizon-db
image: docker.io/postgis/postgis:15-3.4
restart: unless-stopped
volumes:
- ./db:/var/lib/postgresql/data:z
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
networks:
- default
env_file: .env
.env
######################################################
# Email settings #
######################################################
# The SMTP server
# Defaults to localhost
MOBILIZON_SMTP_SERVER=mobilizon-exim-relay
# The SMTP port
# Usual values: 25, 465, 587
# If using a local mail server, make sure the appropriate port is exposed in the docker-compose configuration as well
# Defaults to 25
MOBILIZON_SMTP_PORT=25
#
MOBILIZON_SMTP_AUTH=false
# The SMTP username
# Defaults to nil
# MOBILIZON_SMTP_USERNAME=
# The SMTP password
# Defaults to nil
# MOBILIZON_SMTP_PASSWORD=
# Whether to use SSL for SMTP.
# Boolean
# Defaults to false
MOBILIZON_SMTP_SSL=false
# Whether to use TLS for SMTP.
# Allowed values: always (TLS), never (Clear) and if_available (STARTTLS)
# Make sure to match the port value as well
# Defaults to "if_available"
MOBILIZON_SMTP_TLS=never
config.exs
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("MOBILIZON_SMTP_SERVER", "localhost"),
port: System.get_env("MOBILIZON_SMTP_PORT", "25"),
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil),
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :never,
ssl: false,
retries: 3,
no_mx_lookups: false,
auth: :never
Same unhelpful log message, also can't see anything in exim container logs:
mobilizon | 19:32:03.407 request\_id=GAMDT93\_Txa8Et4AAAZh graphql\_operation\_name=SendResetPassword \[info\] Sent 200 in 4ms
I feel like I am getting there, if you guys can help me I would really appreciate it!
| 19:48:07 |
| juan11iguel set a profile picture. | 19:49:29 |
| juan11iguel changed their display name from Juan Miguel Serrano Rodríguez to juan11iguel. | 19:49:35 |
sebseb01 | Hello On my mobilizon, i have finally found how configure it on the github of mailer module ... I can send to you the configuration but we don't use docker. | 20:08:32 |
juan11iguel | In reply to @sebseb01:digitale-gesellschaft.ch Hello On my mobilizon, i have finally found how configure it on the github of mailer module ... I can send to you the configuration but we don't use docker. Sure! Any references are helpful to compare with how I configured it | 20:15:20 |
juan11iguel | In reply to @juasmis:matrix.org
Hello again, first a summary of how far I've got so far:
- Setup exim in a docker container
- I can send mails from this container
1. Setup exim in a docker container
I've based myself in devture/exim-relay, but modified the conf file (find attached its configuration)
Dockerfile
FROM docker.io/alpine:3.20.2
RUN apk --no-cache add exim tini && \
mkdir /var/spool/exim && \
chmod 777 /var/spool/exim && \
ln -sf /dev/stdout /var/log/exim/mainlog && \
ln -sf /dev/stderr /var/log/exim/panic && \
ln -sf /dev/stderr /var/log/exim/reject && \
chmod 0755 /usr/sbin/exim
RUN apk --no-cache add openssl
COPY exim.conf /etc/exim/exim.conf
# Regardless of the permissions of the original `exim.conf` file in the build context,
# ensure that the `/etc/exim/exim.conf` configuration file is not writable by the Exim user.
# Otherwise, we'll get an Exim panic:
# > Exim configuration file /etc/exim/exim.conf has the wrong owner, group, or mode
RUN chmod 664 /etc/exim/exim.conf
# Generate certificates for TLS
RUN openssl req -x509 -sha256 -days 9000 -nodes -newkey rsa:4096 -keyout exim.key -out exim.crt -subj "/CN=exim-relay" && \
mv exim.crt /etc/ssl/exim.crt && \
mv exim.key /etc/ssl/exim.key
USER exim
EXPOSE 8025
ENV LOCAL_DOMAINS=@ \
RELAY_FROM_HOSTS=10.0.0.0/8:172.16.0.0/12:192.168.0.0/16 \
RELAY_TO_DOMAINS=* \
RELAY_TO_USERS= \
DISABLE_SENDER_VERIFICATION= \
HOSTNAME= \
SMARTHOST= \
SMTP_PASSWORD= \
SMTP_USERDOMAIN= \
SMTP_USERNAME=
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["exim", "-bdf", "-q15m"]
docker-compose
...
services:
exim-relay:
container_name: mobilizon-exim-relay
# image: docker.io/devture/exim-relay:4.98-r0-1
build:
context: ./exim-relay
dockerfile: Dockerfile
env_file:
- ./exim-relay/.env
user: 100:101
restart: always
networks:
- default
ports:
- "25:8025"
environment:
HOSTNAME: external.psa.es
SMARTHOST: correo.psa.es::587
SMTP_USERNAME: username@psa.es
SMTP_PASSWORD: password
SMTP_USERDOMAIN: psa.es
2. Veryfied that I can send mails from this container
echo -e "From: username@psa.es\\nSubject: test" | docker exec -i exim-relay-mobilizon exim -v jmserrano@psa.es
Does send the test emails as can be seen in the attached picture.
I think so far I managed to get the forwarding part correctly, now it only remains the mobilizon side of things, so far no lack. This is my compose, .env and config.exs:
compose
networks:
base_proxy_network:
external: true
default:
ipam:
driver: default
services:
mobilizon:
container_name: mobilizon
image: docker.io/framasoft/mobilizon:latest
restart: unless-stopped
environment:
- MOBILIZON_INSTANCE_NAME
- MOBILIZON_INSTANCE_HOST
- MOBILIZON_INSTANCE_LISTEN_IP
- MOBILIZON_INSTANCE_PORT
- MOBILIZON_INSTANCE_EMAIL
- MOBILIZON_REPLY_EMAIL
- MOBILIZON_INSTANCE_REGISTRATIONS_OPEN
- MOBILIZON_DATABASE_USERNAME=${POSTGRES_USER}
- MOBILIZON_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
- MOBILIZON_DATABASE_DBNAME=${POSTGRES_DB}
- MOBILIZON_DATABASE_HOST=db
- MOBILIZON_DATABASE_PORT
- MOBILIZON_DATABASE_SSL
- MOBILIZON_INSTANCE_SECRET_KEY_BASE
- MOBILIZON_INSTANCE_SECRET_KEY
- MOBILIZON_LOGLEVEL
- MOBILIZON_SMTP_SERVER
- MOBILIZON_SMTP_PORT
- MOBILIZON_SMTP_SSL
- MOBILIZON_SMTP_TLS
- MOBILIZON_SMTP_USERNAME
- MOBILIZON_SMTP_PASSWORD
- MOBILIZON_UPLOADS
- MOBILIZON_UPLOADS_EXPORTS
- MOBILIZON_TIMEZONES_DIR
- MOBILIZON_TZDATA_DIR
volumes:
- ./uploads:/var/lib/mobilizon/uploads
- ./config.exs:/etc/mobilizon/config.exs:ro
ports:
- "4000:4000"
networks:
- base_proxy_network
- default
env_file: .env
labels:
- "traefik.enable=true"
- "traefik.http.routers.mobilizon.rule=Host(`events.psa.es`)"
- "traefik.http.routers.mobilizon.entrypoints=websecure"
- "traefik.http.routers.mobilizon.tls.certresolver=letsencryptresolver"
- "traefik.http.services.mobilizon.loadbalancer.server.port=4000"
- "traefik.http.middlewares.mobilizon-ipallowlist.ipallowlist.sourcerange=10.10.104.0/24, 10.10.105.0/24, 192.168.0.0/16, 193.146.147.128/25"
- "traefik.http.routers.mobilizon.middlewares=error-pages-middleware,mobilizon-ipallowlist"
db:
container_name: mobilizon-db
image: docker.io/postgis/postgis:15-3.4
restart: unless-stopped
volumes:
- ./db:/var/lib/postgresql/data:z
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
networks:
- default
env_file: .env
.env
######################################################
# Email settings #
######################################################
# The SMTP server
# Defaults to localhost
MOBILIZON_SMTP_SERVER=mobilizon-exim-relay
# The SMTP port
# Usual values: 25, 465, 587
# If using a local mail server, make sure the appropriate port is exposed in the docker-compose configuration as well
# Defaults to 25
MOBILIZON_SMTP_PORT=25
#
MOBILIZON_SMTP_AUTH=false
# The SMTP username
# Defaults to nil
# MOBILIZON_SMTP_USERNAME=
# The SMTP password
# Defaults to nil
# MOBILIZON_SMTP_PASSWORD=
# Whether to use SSL for SMTP.
# Boolean
# Defaults to false
MOBILIZON_SMTP_SSL=false
# Whether to use TLS for SMTP.
# Allowed values: always (TLS), never (Clear) and if_available (STARTTLS)
# Make sure to match the port value as well
# Defaults to "if_available"
MOBILIZON_SMTP_TLS=never
config.exs
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("MOBILIZON_SMTP_SERVER", "localhost"),
port: System.get_env("MOBILIZON_SMTP_PORT", "25"),
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil),
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :never,
ssl: false,
retries: 3,
no_mx_lookups: false,
auth: :never
Same unhelpful log message, also can't see anything in exim container logs:
mobilizon | 19:32:03.407 request\_id=GAMDT93\_Txa8Et4AAAZh graphql\_operation\_name=SendResetPassword \[info\] Sent 200 in 4ms
I feel like I am getting there, if you guys can help me I would really appreciate it!
BTW, in the exim.conf I disabled the client TLS and confirmed I can still send mails from the exim container | 20:16:53 |
MickGe | In reply to @juasmis:matrix.org
Hello again, first a summary of how far I've got so far:
- Setup exim in a docker container
- I can send mails from this container
1. Setup exim in a docker container
I've based myself in devture/exim-relay, but modified the conf file (find attached its configuration)
Dockerfile
FROM docker.io/alpine:3.20.2
RUN apk --no-cache add exim tini && \
mkdir /var/spool/exim && \
chmod 777 /var/spool/exim && \
ln -sf /dev/stdout /var/log/exim/mainlog && \
ln -sf /dev/stderr /var/log/exim/panic && \
ln -sf /dev/stderr /var/log/exim/reject && \
chmod 0755 /usr/sbin/exim
RUN apk --no-cache add openssl
COPY exim.conf /etc/exim/exim.conf
# Regardless of the permissions of the original `exim.conf` file in the build context,
# ensure that the `/etc/exim/exim.conf` configuration file is not writable by the Exim user.
# Otherwise, we'll get an Exim panic:
# > Exim configuration file /etc/exim/exim.conf has the wrong owner, group, or mode
RUN chmod 664 /etc/exim/exim.conf
# Generate certificates for TLS
RUN openssl req -x509 -sha256 -days 9000 -nodes -newkey rsa:4096 -keyout exim.key -out exim.crt -subj "/CN=exim-relay" && \
mv exim.crt /etc/ssl/exim.crt && \
mv exim.key /etc/ssl/exim.key
USER exim
EXPOSE 8025
ENV LOCAL_DOMAINS=@ \
RELAY_FROM_HOSTS=10.0.0.0/8:172.16.0.0/12:192.168.0.0/16 \
RELAY_TO_DOMAINS=* \
RELAY_TO_USERS= \
DISABLE_SENDER_VERIFICATION= \
HOSTNAME= \
SMARTHOST= \
SMTP_PASSWORD= \
SMTP_USERDOMAIN= \
SMTP_USERNAME=
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["exim", "-bdf", "-q15m"]
docker-compose
...
services:
exim-relay:
container_name: mobilizon-exim-relay
# image: docker.io/devture/exim-relay:4.98-r0-1
build:
context: ./exim-relay
dockerfile: Dockerfile
env_file:
- ./exim-relay/.env
user: 100:101
restart: always
networks:
- default
ports:
- "25:8025"
environment:
HOSTNAME: external.psa.es
SMARTHOST: correo.psa.es::587
SMTP_USERNAME: username@psa.es
SMTP_PASSWORD: password
SMTP_USERDOMAIN: psa.es
2. Veryfied that I can send mails from this container
echo -e "From: username@psa.es\\nSubject: test" | docker exec -i exim-relay-mobilizon exim -v jmserrano@psa.es
Does send the test emails as can be seen in the attached picture.
I think so far I managed to get the forwarding part correctly, now it only remains the mobilizon side of things, so far no lack. This is my compose, .env and config.exs:
compose
networks:
base_proxy_network:
external: true
default:
ipam:
driver: default
services:
mobilizon:
container_name: mobilizon
image: docker.io/framasoft/mobilizon:latest
restart: unless-stopped
environment:
- MOBILIZON_INSTANCE_NAME
- MOBILIZON_INSTANCE_HOST
- MOBILIZON_INSTANCE_LISTEN_IP
- MOBILIZON_INSTANCE_PORT
- MOBILIZON_INSTANCE_EMAIL
- MOBILIZON_REPLY_EMAIL
- MOBILIZON_INSTANCE_REGISTRATIONS_OPEN
- MOBILIZON_DATABASE_USERNAME=${POSTGRES_USER}
- MOBILIZON_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
- MOBILIZON_DATABASE_DBNAME=${POSTGRES_DB}
- MOBILIZON_DATABASE_HOST=db
- MOBILIZON_DATABASE_PORT
- MOBILIZON_DATABASE_SSL
- MOBILIZON_INSTANCE_SECRET_KEY_BASE
- MOBILIZON_INSTANCE_SECRET_KEY
- MOBILIZON_LOGLEVEL
- MOBILIZON_SMTP_SERVER
- MOBILIZON_SMTP_PORT
- MOBILIZON_SMTP_SSL
- MOBILIZON_SMTP_TLS
- MOBILIZON_SMTP_USERNAME
- MOBILIZON_SMTP_PASSWORD
- MOBILIZON_UPLOADS
- MOBILIZON_UPLOADS_EXPORTS
- MOBILIZON_TIMEZONES_DIR
- MOBILIZON_TZDATA_DIR
volumes:
- ./uploads:/var/lib/mobilizon/uploads
- ./config.exs:/etc/mobilizon/config.exs:ro
ports:
- "4000:4000"
networks:
- base_proxy_network
- default
env_file: .env
labels:
- "traefik.enable=true"
- "traefik.http.routers.mobilizon.rule=Host(`events.psa.es`)"
- "traefik.http.routers.mobilizon.entrypoints=websecure"
- "traefik.http.routers.mobilizon.tls.certresolver=letsencryptresolver"
- "traefik.http.services.mobilizon.loadbalancer.server.port=4000"
- "traefik.http.middlewares.mobilizon-ipallowlist.ipallowlist.sourcerange=10.10.104.0/24, 10.10.105.0/24, 192.168.0.0/16, 193.146.147.128/25"
- "traefik.http.routers.mobilizon.middlewares=error-pages-middleware,mobilizon-ipallowlist"
db:
container_name: mobilizon-db
image: docker.io/postgis/postgis:15-3.4
restart: unless-stopped
volumes:
- ./db:/var/lib/postgresql/data:z
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
networks:
- default
env_file: .env
.env
######################################################
# Email settings #
######################################################
# The SMTP server
# Defaults to localhost
MOBILIZON_SMTP_SERVER=mobilizon-exim-relay
# The SMTP port
# Usual values: 25, 465, 587
# If using a local mail server, make sure the appropriate port is exposed in the docker-compose configuration as well
# Defaults to 25
MOBILIZON_SMTP_PORT=25
#
MOBILIZON_SMTP_AUTH=false
# The SMTP username
# Defaults to nil
# MOBILIZON_SMTP_USERNAME=
# The SMTP password
# Defaults to nil
# MOBILIZON_SMTP_PASSWORD=
# Whether to use SSL for SMTP.
# Boolean
# Defaults to false
MOBILIZON_SMTP_SSL=false
# Whether to use TLS for SMTP.
# Allowed values: always (TLS), never (Clear) and if_available (STARTTLS)
# Make sure to match the port value as well
# Defaults to "if_available"
MOBILIZON_SMTP_TLS=never
config.exs
config :mobilizon, Mobilizon.Web.Email.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("MOBILIZON_SMTP_SERVER", "localhost"),
port: System.get_env("MOBILIZON_SMTP_PORT", "25"),
username: System.get_env("MOBILIZON_SMTP_USERNAME", nil),
password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
tls: :never,
ssl: false,
retries: 3,
no_mx_lookups: false,
auth: :never
Same unhelpful log message, also can't see anything in exim container logs:
mobilizon | 19:32:03.407 request\_id=GAMDT93\_Txa8Et4AAAZh graphql\_operation\_name=SendResetPassword \[info\] Sent 200 in 4ms
I feel like I am getting there, if you guys can help me I would really appreciate it!
https://forge.tedomum.net/tedomum/mobilizon/-/commit/c5bd83081e0fb97404b37fd9b7c73e8d1d0a18e9 | 23:34:25 |
30 Oct 2024 |
| Clon joined the room. | 08:53:09 |
| @jaller94:matrix.org joined the room. | 12:12:13 |
| @jaller94:matrix.org left the room. | 13:24:41 |
| @daline:matrix.org left the room. | 16:15:45 |
avocado_moon | In reply to @cos:hacklab.fi Standard ical import would be really useful, and it would also work for google calendars. Our hacklab uses nextcloud's calendar and that provides ical also. It's extremely similar in concept! It'll go ahead and add "ICAL" to the list of supported scraper formats. In addition what publication endpoints do you think would be beneficial. My next thought would be discord, but I'm not sure. | 17:47:59 |
31 Oct 2024 |
| rodinux set a profile picture. | 11:58:58 |
| rodinux removed their profile picture. | 12:01:09 |
| rodinux set a profile picture. | 12:02:52 |
2 Nov 2024 |
Vijay Pillai | sorry for late response, i use the latest image, in mobile chrome/edge browser the page is blank, it works well in desktop chrome and edge | 23:40:57 |