joplin-mail-gateway icon indicating copy to clipboard operation
joplin-mail-gateway copied to clipboard

Writing empty notes from emails

Open dm7500 opened this issue 4 years ago • 1 comments

When I try to retrieve new messages with ./fetch-joplin-mails.sh, The notes will create, but they'll be blank.

Receiving this when attempting to retrieve new messages from my inbox with ./fetch-joplin-mails.sh. Inbox is using Gmail. Config file is below as well.

===============================
Start: Mon Nov  2 11:19:53 EST 2020
Fetching mails
getmail_fetch version 5.13
Copyright (C) 1998-2019 Charles Cazabon.  Licensed under the GNU GPL version 2.
BrokenUIDLPOP3SSLRetriever:[email protected]:995:
  msg 1/1 (58876 bytes) ... delivered
1 messages retrieved
-------------------
Process /home/david/joplin-mailbox//new/1604333994.M288409P18659Q0R0cba1ff57cf1c31e.DESKTOP-KDSQM8N
Traceback (most recent call last):
  File "./decodemail.py", line 161, in <module>
    decode_file(filename, header_wanted, all)
  File "./decodemail.py", line 129, in decode_file
    output = decode_and_split(line.strip(), header_wanted)
  File "./decodemail.py", line 53, in decode_and_split
    thispiece = decode_piece(piece)
  File "./decodemail.py", line 37, in decode_piece
    for part in email.Header.decode_header(piece):
AttributeError: module 'email' has no attribute 'Header'
Create new note with name '1604333994.M288409P18659Q0R0cba1ff57cf1c31e.DESKTOP-KDSQM8N' in '_INBOX'
New note created - ID is: cc999
Set title to: EMAIL NOTE - Mon Nov  2 11:19:56 EST 2020
Using temp dir: /tmp/tmp.MXxJme2TUc
Setting body
Removing temp dir: /tmp/tmp.MXxJme2TUc
-------------------
Start Joplin Sync
Synchronisation target: Dropbox (7)
Starting synchronisation...
Created remote items: 1.
Downloading resources...
Created remote items: 1. Fetched items: 1/1. Completed: 02/11/2020 11:20
End: Mon Nov  2 11:20:07 EST 2020
#!/usr/bin/env bash

# ---------- Configuration ---------------

POP3_USER="joplin.inbox"
POP3_PW="FAKEPASS"
POP3_HOST="pop.gmail.com"
POP3_PORT=995

# Note: By default emails do get not deleted from your inbox which results in duplicate notes on every run.
# This is for the safety of your data and protects you from losing emails due to a bad setup.
# However, as soon as your setup is tested and working you may add the --delete flag to the getmail options.
# Alternative: if your email provider allows it (Gmail does) you may also set your inbox options to
# "archive mails when POP3 fetched".
GETMAIL_OPTS=--ssl

DEFAULT_TITLE_PREFIX="EMAIL NOTE"
DEFAULT_NOTEBOOK="_INBOX"

#AUTO_CREATE_NOTEBOOK=false

Running this on Ubuntu on WSL/ All pre-reqs installed as documented.

dm7500 avatar Nov 02 '20 16:11 dm7500

@dm7500 could you solve this in the meantime?

manolitto avatar Feb 07 '21 11:02 manolitto