Philip Prindeville: > Hi. > > We need to implement various controls via mimedefang in our scenario, > and need to use ${daemon_port} for some of those controls. > > I'd like to add various milter variables like ${daemon_port}, > ${if_addr}, ${if_name}, etc. but it's been a while since I stared > at Postfix sources (8.3 was still out at the time). > > Can someone walk me through the steps at a high-level, and I'll > do the implementation and testing myself?
With each new attribute: - An XCLIENT feature is needed if the attribute will be used for access decisions. Otherwise, XCLIENT can no longer be used for testing. - A queue file attribute record is needed if the attribute will be used for access decisions. Otherwise, unexpected things will happen when someone does "postsuper -r" and the Milter is called by the cleanup daemon. This requires changes to the cleanup daemon to store the attribute, to rec_attr_map() to "bless" the queue file attribute name, and to rec_type.h to define the pseudo record type that rec_attr_map() needs. - An XFORWARD feature is needed if the attribute will be used for logging. Otherwise, logging will be inconsistent. This requires changes in the Postfix SMTP server to receive the attribute, the smtpd_proxy_filter client to forward the attribute, the queue manager code to read the attribute from queue file, the queue manager to delivery agent protocol to forward the attribute, and the Postfix SMTP client to forward the attribute. That's just off the top of my head. Wietse