Mhrw is a command-line software tool that allows users to manipulate mail headers with ease.
With mhrw, you can replace or add some part of the header below the former last headerline. It is important to note that the body of the message is not touched, and anything below the header is passed through. Additionally, the message will always pass until EOF.
To use mhrw, you can read mails from < stdin > or from < file > if an argument is given. This software supports two operating modes, which are easy to use. You can replace some part of the header matched by a regular expression or add some part to the header below the former last headerline.
To showcase an example of how to use mhrw, you can define a mail header similar to the one below:
Received: somehost (somehost.somewhere) by uid 1007 with esmtp
X-Authenticated-SMTP: username
Received: anyhost; date
Subject: some test
Then, you can use the following command to modify the header:
mhrw '^X-Authenticated-SMTP: .*$' ''
This will result in the mail header being altered as follows:
Received: somehost (somehost.somewhere) by uid 1007 with esmtp
Received: anyhost; date
Subject: some test
You can use any regular expression you like, limited by default to 4 subqueries. The second argument in the replacement string interprets written n and r sequences.
The installation of mhrw is straightforward as it does not rely on libraries and is written with a basic set of commands. To build the binary on most platforms, simply run the following commands:
./configure
make
make install
Overall, mhrw is a great tool for mailheader manipulation that is both efficient and easy to use.
Version 0.8.1: N/A