Whatever you do to filter out the id I suggest NOT to remove the messages directly from the what you've called "dark magic".
I think a better approach would be to echo out the command and then if you are happy with it copy & paste... Another suggestion is to reduce the spawning of subshells in the pipeline and let do awk(1) the filtering: doas mailq | awk -F\| /administrator/'{printf "smtpctl remove %s\n",$1}'