Roznoshchik / Lurnby

A tool for active reading and personal knowledge management
https://www.lurnby.com
BSD 3-Clause "New" or "Revised" License
673 stars 17 forks source link

add by email fails if there is more than 1 recipient. #13

Closed Roznoshchik closed 2 years ago

Roznoshchik commented 2 years ago
def add_by_email():
    recipient = request.form['to']
    if '<' in recipient:
        recipient = recipient.split('<')[1][:-1]

This is the code being used to get the recipient of the email. When someone emails something to Lurnby and there is more than a single email in the request.form['to'] then the function fails as it isn't pulling out the right email.

A better solution would likely be to use regex to pull out the email that has @add-article.lurnby.com as the ending.

Roznoshchik commented 2 years ago

This has been fixed and multiple recipients no longer cause the app to error.