On Sunday 13 January 2019 11:32:33 Wietse Venema wrote: > Pali Roh?r: > > > Example: install this as /usr/sbin/sendmail. > > > > > > #!/bin/sh > > > exec /usr/sbin/sendmail.real "$@" ex...@example.com > > > > > > Why tinker with internal protocols, when you can use > > > documented features? > > > > Hm... that you for a hint. This wrapper is easier to implement as > > wrapper for postdrop. > > > > I chose postdrop as I understood that this is the last application in > > "pipeline" which has information about unix before email is put into > > queue. > > It's almost the last program :-) The pickup daemon determines UNIX > info from the maildrop queue file owner, as it prepares the information > for the Received: message header. > > Preparing the header in the pickup daemon is safer than doing it > in the set-gid postdrop program, because the time conversion library > relies on environment variables.
Thanks for info. > > Are there any other binaries which calls postdrop? Or /usr/sbin/sendmail > > is the only one binary which uses postdrop? > > At this time, only the Postfix sendmail program depends on postdrop. Ok. > If you take the script solution, be sure to use "$@" (with quotes) > and not $* (without quotes). I know :-) > Right: exec /usr/sbin/sendmail.real "$@" ex...@example.com > Wrong: exec /usr/sbin/sendmail.real $* ex...@example.com > > The wrong solution mis-handles arguments that contain whitespace. > > Wietse -- Pali Rohár pali.ro...@gmail.com
signature.asc
Description: PGP signature