Very interesting Thomas. Are such "replacement placeholder" options documented anywhere?
They were documented in the file UDG.txt a long time ago. This was the guide that was used with PMail that allowed you to create the special User Defined Gateways. I've attached the zip file. Here's a snippet from the file.
Command substitution
--------------------
Most of the entries in this screen which accept strings allow
you to use special command substitution characters in the strings:
these are like "escape sequences" which will cause PMail to perform
some substitution at run-time. Command substitutions always begin
with a tilde (~) character, and are always two characters long.
The following command substitutions are recognised:
This sequence... Is replaced with this value
~c The full path to the file containing the message
~t The address to which to send this message
(note: this is not necessarily the To: field)
~s The message's subject field
~f The full form of the message's "from" field
~n The sender's user name in its simplest form
~b The sender's bindery id, as a long hex integer [Netware only]
~8 The first 8 chars in the sender's username
~y The time and date in RFC-822 format
~d A random integer, expressed as 4 hex digits
~q Y if this message is a BCC, N otherwise
~%name% The value of the environment variable %name%.
~p The user's personal name preference [the ~o should now be used when the name may contain high-bit characters]
~x The name.ext ONLY of the container file (no path)
~a The directory from which PMail was run (or base directory)
~h The current user's home mailbox location
~w The current user's new mail location
~~ A single tilde character.