{
    "content": [
        {
            "type": "text",
            "text": "# reformail (man)\n\n## NAME\n\nreformail - E-mail reformatting tool\n\n## SYNOPSIS\n\nreformail -s command [option...]\nreformail -D len filename\nreformail -x header:...\nreformail -X header:...\nreformail [options...]\nSee below for additional options\n\n## DESCRIPTION\n\nThe reformail program reads a message on standard input, reformats it in some way, and writes\nthe message to standard output:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (3 subsections)\n- **OPTIONS** (4 subsections)\n- **AUTOREPLIES**\n- **BUGS** (1 subsections)\n- **SEE ALSO**\n- **AUTHOR** (1 subsections)\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "reformail",
        "section": "",
        "mode": "man",
        "summary": "reformail - E-mail reformatting tool",
        "synopsis": "reformail -s command [option...]\nreformail -D len filename\nreformail -x header:...\nreformail -X header:...\nreformail [options...]\nSee below for additional options",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "Concatenate multi-line headers. Headers split on multiple lines are combined into a single line."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "If n is 1, each line will be terminated with CRLF. If n is 0 (default), each line will be terminated with LF. reformail reads a message with either line terminator, and will force the message to have the specified line termination."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Any initial blank lines are removed. If the first non-blank line is a \"From\" line, it gets converted to a \"Return-Path:\" header, and any existing \"Return-Path:\" header gets removed. If the message does not start with a \"From\" line, the message remains unchanged."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Add the \"From\" line to the message, if it's not there. reformail will attempt to generate the \"From\" line from any Errors-To:, Return-Path:, or From: headers in the message. \"root\" will be used if reformail is unable to determine the return address. -i'header: value' Appends a custom header to the message. If this header already exists it is renamed by prepending \"Old-\" to the name of the header. -I'header: value' Append a custom header to the message. If this header already exists in the message, the old header is completely removed. If the value is empty, any existing header is completely removed, and nothing gets appended. -R oldheader: newheader: Rename the indicated header. -u'header:' If this header occurs multiple times in the message, remove all occurrences except the first one. -U'header:' If this header occurs multiple times in the message, remove all occurrences except the last one."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "courier",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/courier/8/json"
            },
            {
                "name": "sendmail",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sendmail/8/json"
            },
            {
                "name": "mailbot",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/mailbot/1/json"
            },
            {
                "name": "maildrop",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/maildrop/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "Splitting mailboxes into individual messages",
                        "lines": 10
                    },
                    {
                        "name": "Detecting duplicate messages",
                        "lines": 11
                    },
                    {
                        "name": "Extracting headers",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 10,
                "subsections": [
                    {
                        "name": "-c",
                        "lines": 3,
                        "flag": "-c"
                    },
                    {
                        "name": "-d_n_",
                        "lines": 4
                    },
                    {
                        "name": "-f0",
                        "lines": 5
                    },
                    {
                        "name": "-f1",
                        "lines": 24
                    }
                ]
            },
            {
                "name": "AUTOREPLIES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": [
                    {
                        "name": "-u -U -a -A",
                        "lines": 2,
                        "flag": "-A"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Sam Varshavchik",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 12,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "reformail - E-mail reformatting tool\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "reformail -s command [option...]\n\nreformail -D len filename\n\nreformail -x header:...\n\nreformail -X header:...\n\nreformail [options...]\n\nSee below for additional options\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The reformail program reads a message on standard input, reformats it in some way, and writes\nthe message to standard output:\n",
                "subsections": [
                    {
                        "name": "Splitting mailboxes into individual messages",
                        "content": "The -s option splits the mbox-formatted mailbox file on standard input into individual\nmessages. An external program is executed for each message. The contents of each individual\nmessage will be provided to the external program on standard input.\n\nIf the FILENO environment variable is set to a number, reformail will consecutively increment\nFILENO each time the program is executed for each individual message.\n\nIf FILENO is not set, it's initial value will be \"000\". If FILENO is set to a non-numeric\nvalue, FILENO will remain unchanged.\n"
                    },
                    {
                        "name": "Detecting duplicate messages",
                        "content": "The -D option implements a simple way to delete duplicate messages in incoming mail.\nfilename is a file that will be approximately 'len' bytes long. This file will be used by\nreformail to save message IDs seen in recent mail.  reformail reads the message on standard\ninput. If the message has a Message-ID: header that's already in the cache file, reformail\nterminates with the exit code set to 0. Otherwise, reformail terminates with the exit code\nset to 1.\n\nNote\nUnlike a similar feature in the formail command, reformail takes care of locking the\nfile, so it's not necessary to implement your own locking mechanism for this option.\n"
                    },
                    {
                        "name": "Extracting headers",
                        "content": "The -x and -X options extract the indicated headers from the message, and print them to\nstandard output. Multiple -x and -X options can be specified at the same time, and may be\nintermixed.\n\nThe -x option extracts and prints the contents of the header. The -X option prints the name\nof the header as well.\n\nIn all other situations, reformail copies the message on its standard input to its standard\noutput, reformatting the message as follows:\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "-a'header: value'\nAppend a custom header to the message if this header does not already exist. If the\nheader is either Message-ID: or Resent-Message-ID: and the value is empty, reformail\ngenerates a (hopefully) unique message ID for you.\n\n-A'header: value'\nAppend a custom header to the message even if this header already exists. If the header\nis either Message-ID: or Resent-Message-ID: and the value is empty, reformail generates a\n(hopefully) unique message ID for you.\n",
                "subsections": [
                    {
                        "name": "-c",
                        "content": "Concatenate multi-line headers. Headers split on multiple lines are combined into a\nsingle line.\n",
                        "flag": "-c"
                    },
                    {
                        "name": "-d_n_",
                        "content": "If n is 1, each line will be terminated with CRLF. If n is 0 (default), each line will be\nterminated with LF.  reformail reads a message with either line terminator, and will\nforce the message to have the specified line termination.\n"
                    },
                    {
                        "name": "-f0",
                        "content": "Any initial blank lines are removed. If the first non-blank line is a \"From\" line, it\ngets converted to a \"Return-Path:\" header, and any existing \"Return-Path:\" header gets\nremoved. If the message does not start with a \"From\" line, the message remains\nunchanged.\n"
                    },
                    {
                        "name": "-f1",
                        "content": "Add the \"From\" line to the message, if it's not there.  reformail will attempt to\ngenerate the \"From\" line from any Errors-To:, Return-Path:, or From: headers in the\nmessage. \"root\" will be used if reformail is unable to determine the return address.\n\n-i'header: value'\nAppends a custom header to the message. If this header already exists it is renamed by\nprepending \"Old-\" to the name of the header.\n\n-I'header: value'\nAppend a custom header to the message. If this header already exists in the message, the\nold header is completely removed. If the value is empty, any existing header is\ncompletely removed, and nothing gets appended.\n\n-R oldheader: newheader:\nRename the indicated header.\n\n-u'header:'\nIf this header occurs multiple times in the message, remove all occurrences except the\nfirst one.\n\n-U'header:'\nIf this header occurs multiple times in the message, remove all occurrences except the\nlast one.\n"
                    }
                ]
            },
            "AUTOREPLIES": {
                "content": "The autoreply options from earlier versions of mailbot have been moved into mailbot(1)[1].\n",
                "subsections": []
            },
            "BUGS": {
                "content": "For the -a, -A, and -I options, a space after the header name and the colon is considered to\nbe a non-empty field.\n\nDo not provide the same header to more than one family of header-modifying options, such as",
                "subsections": [
                    {
                        "name": "-u -U -a -A",
                        "content": "times (use a pipe, perhaps).\n",
                        "flag": "-A"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "courier(8)[2], sendmail(8), mailbot(1)[1], maildrop(1)[3].\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "",
                "subsections": [
                    {
                        "name": "Sam Varshavchik",
                        "content": "Author\n"
                    }
                ]
            },
            "NOTES": {
                "content": "1. mailbot(1)\nhttp://www.courier-mta.org/maildrop/mailbot.html\n\n2. courier(8)\nhttp://www.courier-mta.org/maildrop/courier.html\n\n3. maildrop(1)\nhttp://www.courier-mta.org/maildrop/maildrop.html\n\n\n\nCourier Mail Server                          06/20/2015                                 REFORMAIL(1)",
                "subsections": []
            }
        }
    }
}