Linux command
formail 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Extract headers from email
formail -x [Subject:] < [email.txt]
Add header to email
formail -a "[X-Custom: value]" < [email.txt]
Split mbox into messages
formail -s [command] < [mbox]
Extract From line
formail -x From: < [email.txt]
Force addition of header
formail -A "[X-Custom: value]" < [email.txt]
Generate auto-reply
formail -r < [email.txt]
说明
formail is a mail processing utility from the procmail suite. It extracts headers, adds or modifies headers, splits mbox files, and helps generate automated replies. The tool reads from stdin and writes to stdout, designed for use in pipelines and procmail recipes. It handles RFC 822 mail format intricacies.
参数
- -x _header_
- Extract specific header.
- -X _header_
- Extract header with continuation lines.
- -a _header_
- Add header if not present.
- -A _header_
- Add header always.
- -i _header_
- Replace header.
- -u _header_
- Make header unique.
- -r
- Generate reply headers.
- -s _command_
- Split and process with command.
- -b
- Don't escape body "From " lines.
- -n _count_
- Output only first n messages.
FAQ
What is the formail command used for?
formail is a mail processing utility from the procmail suite. It extracts headers, adds or modifies headers, splits mbox files, and helps generate automated replies. The tool reads from stdin and writes to stdout, designed for use in pipelines and procmail recipes. It handles RFC 822 mail format intricacies.
How do I run a basic formail example?
Run `formail -x [Subject:] < [email.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -x _header_ do in formail?
Extract specific header.