Skip to content

Recipe for machine-readable messages #110

@awdeorio

Description

@awdeorio

It would be helpful to include this handy recipe for producing a list of machine-readable output files. It came up in the discussion of #107 .

$ mailmerge --sample

$ mailmerge --no-limit --output-format raw | \
  grep -v '>>>' | \
  csplit \
    --elide-empty-files \
    --silent \
    --prefix 'message-' \
    --suffix-format '%03d.eml' \
    - \
    '/^TO:/' '{*}'

$ ls message-*
message-000.eml  message-001.eml

$ cat message-000.eml 
TO: [email protected]
SUBJECT: Testing mailmerge
FROM: My Self <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Wed, 11 Nov 2020 17:35:20 -0000

Hi, Myself,

Your number is 17.

$ cat message-001.eml 
TO: [email protected]
SUBJECT: Testing mailmerge
FROM: My Self <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Wed, 11 Nov 2020 17:35:20 -0000

Hi, Bob,

Your number is 42.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions