procmail

Command

This executable can run non-interactive system commands.
  1. CommentThe program is picky about the file ownership, and waits for some input.
    This function can be performed by any unprivileged user.
    echo -e ':0\n| /path/to/command >/path/to/temp-file
    procmail -m /path/to/temp-file
    This function is performed by the privileged user if executed via sudo because the acquired privileges are not dropped.
    RemarksIf there are environment variables involved, they must be passed via sudo VAR=value ... or exported then sudo -E ....
    echo -e ':0\n| /path/to/command >/path/to/temp-file
    procmail -m /path/to/temp-file