I'm mid-way through the integration. Attached is current state. This should apply to Postfix 3.11 (stable) and 3.12 (head).
My progress is below, followed by a few open questions.
Looking over the code, I notice that the post_mail_*() functions do
not need an extra argument to indicate that a message is generated by
"this MTA".
They already know, because the bounce daemon always calls post_mail_*()
with a source_class argument that contains MAIL_SRC_MASK_BOUNCE.
So, we can revert all the changes to the bounce/*.c and postmail.c files,
and instead add one line to post_mail_init.c.
int cleanup_flags =
int_filt_flags(source_class) | CLEANUP_FLAG_MASK_INTERNAL
| smtputf8_autodetect(source_class)
+ | ((source_class & MAIL_SRC_MASK_BOUNCE) ? CLEANUP_FLAG_DSN_ORIGIN : 0)
| ((sendopts & SOPT_REQUIRETLS_ESMTP) ? CLEANUP_FLAG_REQTLS : 0)
| ((sendopts & SMTPUTF8_FLAG_REQUESTED) ? CLEANUP_FLAG_SMTPUTF8 : 0);
This means that CLEANUP_FLAG_DSN_ORIGIN is also set for double
bounces, and for postmaster copies of ordinary bounce messages. I
consider that a feature, not a bug: signing double bounces and
postmaster copies prevents forgeries in the same way as signing
ordinary bounce messages.
Open question 1: other notifications
What about other internally-generated notifications, such as
transcripts of SMTP sessions (source_class contains MAIL_SRC_MASK_NOTIFY)?
Should not those be signed, to authenticate them just like DSNs?
If the answer is 'yes' then the feature should be renamed, because
it is no longer specific to DSNs. Maybe CLEANUP_FLAG_INTERNAL_ORIGIN
and {internal_origin}.
Open question 2: feature value
We have: {postfix_dsn_origin}=internal
How would this would work for messages that are not a delivery
status notification, or for messages not created by this MTA? A
macto value of "external" does not seem right.
I think that we should go back to your original plan, and make this
a boolean flag after all.
- yes: This is a notification and it was generated by this MTA.
- no: Everything else (not a notification, not generated here).
Wietse
20260911-roessner-edited.gz
Description: GNU Zip compressed data
_______________________________________________ Postfix-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
