Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe for machine-readable messages #110

Open
awdeorio opened this issue Nov 11, 2020 · 0 comments
Open

Recipe for machine-readable messages #110

awdeorio opened this issue Nov 11, 2020 · 0 comments

Comments

@awdeorio
Copy link
Owner

awdeorio commented Nov 11, 2020

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.
@awdeorio awdeorio changed the title Reciple for machine-readable messages Recipe for machine-readable messages Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant