Skip to content

server: add SymList property to be able to set the macro list#35

Merged
emersion merged 2 commits intoemersion:masterfrom
n-peugnet:add-symlist-feature
Apr 4, 2026
Merged

server: add SymList property to be able to set the macro list#35
emersion merged 2 commits intoemersion:masterfrom
n-peugnet:add-symlist-feature

Conversation

@n-peugnet
Copy link
Copy Markdown
Contributor

This has only be tested with Postfix, but the implementation is directly based on sendmail's libmilter:
https://sources.debian.org/src/sendmail/8.18.2-1/libmilter/engine.c#L477-L542

This has only be tested with Postfix, but the implementation is directly
based on sendmail's libmilter:
https://sources.debian.org/src/sendmail/8.18.2-1/libmilter/engine.c#L477-L542
n-peugnet added a commit to club-1/homard that referenced this pull request Apr 3, 2026
As explained in Postfix's documentation [1]:

> When new mail arrives via the sendmail(1) command line, the Postfix
> cleanup(8) server pretends that the mail arrives with ESMTP from
> "localhost" with IP address "127.0.0.1".

[1]: https://www.postfix.org/MILTER_README.html#non-smtp-milters

Checking that the value of the {client_addr} macro equals to 127.0.0.1
allows to detect mails sent from trsuted networks, as well as the ones
sent via pickup (sendmail, mailx, mutt, etc.).
These mails are also considered as authenticated.
This could become an option if needed.

As the {client_addr} macro is not sent by default:

 $ /usr/sbin/postconf -d | grep milter_.*_macros
 milter_connect_macros = j {daemon_name} {daemon_addr} v _
 milter_data_macros = i
 milter_end_of_data_macros = i
 milter_end_of_header_macros = i
 milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer}
 milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer}
 milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer}
 milter_unknown_command_macros =

...the best solution is to use the set_symlist feature of milter v6.

Fixes: #2
Depends-On: emersion/go-milter#35
Comment thread server.go Outdated
Comment thread milter.go
This make the API more explicit and independant on the protocol details.
Copy link
Copy Markdown
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Thanks!

@emersion emersion merged commit 0277691 into emersion:master Apr 4, 2026
1 check passed
@n-peugnet n-peugnet deleted the add-symlist-feature branch April 4, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants