foxcpp / foxcpp/maddy

Relative aliases dont work

Abierto
#734 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Go
Estrellas
6.1k
Forks
327
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# Describe the bug

I wanted to create an alternative name for my account using aliases file, but relative names like `cat: dog` (as specified in [docs](https://maddy.email/reference/modifiers/envelope/)) didn't work for me. Maddy didn't do any modifications to the address and returned smtp error "User does not exist". I only managed to make it work with full emails in aliases file: `cat@example.com: dog@example.com`.

Is it error in documentations? For now it says:

```
# Replace 'cat' with any domain to 'dog'.
# E.g. cat@example.net -> dog@example.net
cat: dog
```

but this rule seems to do nothing for me.

# Steps to reproduce

# Configuration file

Spoiler warning

```
## Maddy Mail Server - default configuration file (2022-06-18)
# Suitable for small-scale deployments. Uses its own format for local users DB,
# should be managed via maddy subcommands.
#
# See tutorials at https://maddy.email for guidance on typical
# configuration changes.

# ----------------------------------------------------------------------------
# Base variables

$(hostname) = mx.example.com
$(primary_domain) = exmaple.com
$(local_domains) = $(primary_domain)

debug on

tls file /etc/maddy/certs/fullchain.pem /etc/maddy/certs/privkey.pem

# ----------------------------------------------------------------------------
# Local storage & authentication

# pass_table provides local hashed passwords storage for authentication of
# users. It can be configured to use any "table" module, in default
# configuration a table in SQLite DB is used.
# Table can be replaced to use e.g. a file for passwords. Or pass_table module
# can be replaced altogether to use some external source of credentials (e.g.
# PAM, /etc/shadow file).
#
# If table module supports it (sql_table does) - credentials can be managed
# using 'maddy creds' command.

auth.pass_table local_authdb {
table sql_table {
driver sqlite3
dsn credentials.db
table_name passwords
}
}

# imapsql module stores all indexes and metadata necessary for IMAP using a
# relational database. It is used by IMAP endpoint for mailbox access and
# also by SMTP & Submission endpoints for delivery of local messages.
#
# IMAP accounts, mailboxes and all message metadata can be inspected using
# imap-* subcommands of maddy.

storage.imapsql local_mailboxes {
driver sqlite3
dsn imapsql.db
}

# ----------------------------------------------------------------------------
# SMTP endpoints + message routing

hostname $(hostname)

table.chain local_rewrites {
optional_step regexp "(.+)\+(.+)@(.+)" "$1@$3"
optional_step static {
entry postmaster postmaster@$(primary_domain)
}
optional_step file /etc/maddy/aliases
}

msgpipeline local_routing {
destination postmaster $(local_domains) {
modify {
replace_rcpt &local_rewrites
}
deliver_to &local_mailboxes
}

default_destination {
reject 550 5.1.1 "User doesn't exist"
}
}

smtp tcp://0.0.0.0:25 {
limits {
# Up to 20 msgs/sec across max. 10 SMTP connections.
all rate 20 1s
all concurrency 10
}

dmarc yes
check {
require_mx_record
dkim
spf
}

source $(local_domains) {
reject 501 5.1.8 "Use Submission for outgoing SMTP"
}
default_source {
destination postmaster $(local_domains) {
deliver_to &local_routing
}
default_destination {
reject 550 5.1.1 "User doesn't exist"
}
}
}

submission tls://0.0.0.0:465 {
limits {
# Up to 50 msgs/sec across any amount of SMTP connections.
all rate 50 1s
}

auth &local_authdb

source $(local_domains) {
check {
authorize_sender {
prepare_email &local_rewrites
user_to_email identity
}
}

destination postmaster $(local_domains) {
deliver_to &local_routing
}
default_destination {
modify {
dkim $(primary_domain) $(local_domains) default
}
deliver_to &remote_queue
}
}
default_source {
reject 501 5.1.8 "Non-local sender domain"
}
}

target.remote outbound_delivery {
limits {
# Up to 20 msgs/sec across max. 10 SMTP connections
# for each recipient domain.
destination rate 20 1s
destination concurrency 10
}
mx_auth {
dane
mtasts {
cache fs
fs_dir mtasts_cache/
}
local_policy {
min_tls_level encrypted
min_mx_level none
}
}
}

target.queue remote_queue {
target &outbound_delivery

autogenerated_msg_domain $(primary_domain)
bounce {
destination postmaster $(local_domains) {
deliver_to &local_routing
}
default_destination {
reject 550 5.0.0 "Refusing to send DSNs to non-local addresses"
}
}
}

# ----------------------------------------------------------------------------
# IMAP endpoints

imap tls://0.0.0.0:993 {
auth &local_authdb
storage &local_mailboxes
}
```

# Environment information

* maddy version: 0.7.1 linux/amd64 go1.23.3

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la documentación del modificador de envelope enlazada en el issue y la configuración `table.chain local_rewrites`, especialmente el paso `file /etc/maddy/aliases`. Reproduce los casos de alias `cat: dog` y de dirección de correo electrónico completa en maddy 0.7.1 usando la configuración proporcionada y, después, inspecciona la ruta de reescritura de alias. La tarea estará terminada cuando los alias relativos funcionen como se documenta o la documentación describa claramente la sintaxis compatible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
go
Área
backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.