Python has this built in:
```python
>>> import email
>>> s = """header1: yo
... header2: yolo
...
... email starts here
...
... then I sign off
... """
>>> em = email.message_from_string(s)
>>> em.items()
[('header1', 'yo'), ('header2', 'yolo')]
>>> em._payload
'email starts here\n\nthen I sign off\n'
```