Wietse Venema via Postfix-users: > postfix--- via Postfix-users: > > Postfix is setup using virtual domains and addresses, using SQL queries to > > get user addresses and aliases. > > I am using a milter that runs during the RCPT and DATA stages. > > An email is received to an [email protected] address that maps to a real > > [email protected] address. > > > > During the RCPT stage the milter is given [email protected] for the > > rcpt_addr. > > But during the DATA stage the milter is given [email protected] instead of > > [email protected]. > > > > My milter logic is processing for [email protected] during RCPT but then > > during DATA the email address has changed to [email protected] messing up > > the logic. > > I have enable_original_recipient=yes, but I obviously misunderstood that > > setting as that isn't sending the original RCPT address to the milter. > > > > Is there anyway for the (alias) envelope RCPT address to be sent > > to the milter during DATA? Or any creative work arounds so the > > milter logic is working with the alias during DATA? > > This can be imlemented with two Postfix instances > > - The first instance rejects non-existent recipients, > does the virtual alias expansion, and is configured to send all > mail into the second instance. > > - The second instance uses the Milter to reject recipients. > The first instance then sends bounce messages to the sender.
This idea would also work with "content_filter" where the before-filter Postfix SMTP client connects direetly to the after-filter Postfix SMTP server with nothing in-between, > Wietse > > There is no simple solution. > > 1 - Alias expansion happens some time after Postfix has accepted > the recipient. This timing depends on the kind of aliasing. > > 1a - Virtual aliases are expanded before the message is queued. > > 1b - Other aliasing happens in delivery agents: is the case with > the local delivery agent's alias_maps, and with the SMTP/LMTP > delivery agent's generic_maps. > > 2 - Local and virtual alias expansion can produce more than one > email address, and it is recursive (one address expands into > more addresses that expand into more addresses). But the Milter > can only answer for one RCPT TO address. > _______________________________________________ > Postfix-users mailing list -- [email protected] > To unsubscribe send an email to [email protected] > _______________________________________________ Postfix-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
