NAME
MilterProbe - Give a milter one message, as an MTA would, and print what it did with it
VERSION
version 0.002
DESCRIPTION
Connects to the milter at --socket, and gives it one message the way postfix or sendmail would: the connection from --client-ip, HELO, the envelope, the header, the body and the end of the message. Then it prints each change the milter asked for, one to a line, and last of all the milter's verdict.
add_header Authentication-Results: mx.test.test; dmarc=pass header.from=test.test
accept
It obeys what the milter negotiates, as an MTA does: a step the milter asked to leave out is not sent, and no reply is waited for where the milter said it sends none.
USAGE
milterprobe --socket SPEC [--client-ip IP] [--client-host NAME] [--helo NAME]
[--from ADDRESS] [--rcpt ADDRESS ...] [--header 'Name: value' ...]
[--body TEXT | --message FILE] [--macro STAGE:NAME=VALUE ...]
[--timeout SECONDS] [--json]
OPTIONS
--socket-
Where the milter listens, as postfix writes it:
unix:/pathor/path,inet:port@hostorinet6:port@host. Required. --client-ip,--client-host,--helo-
What the MTA tells the milter about the client. Without
--client-ip, the milter is told the family of the address is unknown. --from,--rcpt-
The envelope sender, and each recipient. Without them, the null sender and one null recipient.
--header-
A header field,
Name: value, put ahead of the ones in--message. Give it once per field. --body,--message-
The body, or a file holding the whole message, header and body (
-for standard input). Bare LF becomes CRLF, as on the wire. --macro-
A macro sent before a stage:
connect,helo,mail,rcpt,data,eohoreom. For example--macro mail:i=QUEUEID. Give it once per macro.connect:jdefaults to the name of this host, andmail:itoMILTERPROBE, as an MTA sends both. --timeout-
Seconds to wait for each reply, 10 by default.
--json-
Print one JSON object instead:
verdict, andchanges, a list of them asdecode()in Milter::Client gives them.
OUTPUT
Each change is its action, then what it changes:
add_header NAME: VALUE
insert_header INDEX NAME: VALUE
change_header INDEX NAME: VALUE
delete_header INDEX NAME
add_rcpt ADDRESS [ARGS]
delete_rcpt ADDRESS
change_from ADDRESS [ARGS]
replace_body BYTES
quarantine REASON
A folded header value is printed unfolded, so that each change takes one line. The verdict is accept, continue (the milter let the whole message through without saying so), discard, reject, tempfail, reply and the SMTP reply, timeout or eof. The change and the verdict are the same words as the action of decode() in Milter::Client.
EXIT STATUS
0 when the milter gave a verdict, whatever it was. 1 when it did not reply in time or hung up. 2 when the arguments are wrong, or the milter cannot be reached.
FUNCTIONS
$raw = message(\%opts)
The message to send: each --header, then the header and body of --message, or else a blank line and --body. Dies when --message cannot be read, or a --header is not Name: value.
$line = describe(\%what)
One line for a change or a verdict, as decode() in Milter::Client gives it.
SEE ALSO
Please see those modules/websites for more information related to this module.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/Troglodyne-Internet-Widgets/Milter-Client/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHORS
Current Maintainers:
George S. Baugh <george@troglodyne.net>
COPYRIGHT AND LICENSE
Copyright (c) 2026 Troglodyne LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.