EricJMarti / inventory-hunter

⚡️ Get notified as soon as your next CPU, GPU, or game console is in stock
MIT License
1.12k stars 263 forks source link

Email Alerter Failing on Header Value #182

Open DCastaban opened 3 years ago

DCastaban commented 3 years ago

In cloning the repo, setting up an SMTP server as linked in the medium article and confirming sending mail works, I now get this error upon any use of the script: E2021-03-23 04:51:39,523 [root] email alerter failed to alert Traceback (most recent call last): File "/src/alerter/common.py", line 38, in __call__ alerter(**kwargs) File "/src/alerter/emailer.py", line 47, in __call__ msg["Subject"] = set_subject File "/usr/local/lib/python3.9/email/message.py", line 409, in __setitem__ self._headers.append(self.policy.header_store_parse(name, val)) File "/usr/local/lib/python3.9/email/policy.py", line 146, in header_store_parse raise ValueError("Header values may not contain linefeed " ValueError: Header values may not contain linefeed or carriage return characters

I am trying to rebuild the docker container myself with a hardcoded subject to see if it fixes this problem.

Thank you so much for this project! Appreciate any help.

DCastaban commented 3 years ago

I have gotten it working with Discord webhooks, works absolutely flawlessly. I'd prefer email, but if no one has any time, I'll have to wait until I can look into making a pull request myself to fix this come May.