Email to Joplin Gateway

Hi guys, this might be interesting for you:
Just finished my very first draft of an “email-to-joplin gateway”.
Please take a look at https://github.com/manolitto/joplin-mail-gateway
Regards
Manfred

6 Likes

This looks great. I’m using my own mail server (dovecot) and sendmail as MDA.
The only problem is that you require a pop3 account. Therefore I won’t be able to use it.

But anyway, great work!

Oh, one more thing: for the sake of security you should read the mail credentials from a file and not pass them as arguments.

But dovecot supports POP3, no?
Why not just create a dedicated mail user and fetch via POP3 from your server?

Yes, it does.

Because I do not want to setup pop3 just for this. Also, I would run joplin cli and the script on the same server, therefore no remote fetch necessary.

Right now I don’t have much time, but maybe in the future, I can have a look at it. It should be easy to replace the fetch-joplin-mails.sh script with another one, which checks new mails in an IMAP folder…

Actually I just found an easy solution. I only have to use my current Maildir directory and read directly from there. There’s no need to fetch, since the LDA delivers the mail into the local mailbox/folder anyway…

fixed: all settings are now in a config

That sounds great. Looking forward to your further feedback.

Working well manolitto, thx

But my mails will not be removed, so every crontab creates the same note every time :frowning:

newbie question so my apologies in advance. is there a way to set this up on a windows10 machine? I’m in the process of moving everything over from Evernote (10 or so years of data). The last thing i’m trying to get figured out is getting my emails redirected into Joplin like I did with Evernote.

Yes, interested in that too. On Windows or connect to one of my mailboxes (IMAP) on my private shared webspace (I can configure mail adresses)

I found if I edited config.sh and added the --delete option, that fixed the repeating re-addition of previous mails.

Something like this:

GETMAIL_OPTS="--ssl --delete"

Event though deleted, the mail in my case, remains in the trash can on the mail server.

A great piece of work @manolitto :slight_smile:

Thanks, I already added some comments documenting this:

1 Like

Is it possible to use this with an email alias that doesn’t match the auth user name?
And would it be possible to add an option to specify a specific custom email folder to monitor for mails?

I’d like to use an existing email account for this. Either with a new alias or by pre-filtering relevant e-mails and moving them to a specific folder.

I was wondering why you are not using Fetchmail? I use it all the time on my server to import several external email addresses into my personal email folder on my server. It works really well and can connect to virtually any email system.

See:

@manolitto

Interesting! Yes this would be very useful. I make use of Jetpack mail post to Wordpress and it's a great feature (Jetpack provides the gateway). There's also Postie which needs one to have a mail server at hand (which I happen to have).

I've had a look at your Github material but right now I haven't got time to play with it (already spent too long setting up Joplin and syncing with Nextcloud!) and it looks like a fair bit of setup is needed.

I'll keep an eye on this - it's something I would use and when I get a mo' I'll give it a go ...

Would this work with the new Joplin server pre-release?

Hi, I am happily using the plugin. However, I have a problem with emails in HTML form. They are created without the html body (I simply get an empty note with the emails subject as title). I guess the translation of html into Joplin is not trivial. However, there should be an existing implementation provided by the joplin webclipper. Is there any chance the plugin will support html emails at some point?

Joplin 2.7.13, Ubuntu 20.04.2 LTS

Question regarding Joplin Mail Gateway - Github - GitHub - manolitto/joplin-mail-gateway: Simple (bash-based) mail gateway for the open source note taking and to-do application Joplin
I know this is not a direct Joplin related question but I couldn't find an answer anywhere else.

I've installed this on my Ubuntu server according to the readme instructions and it works well except for attachments. On the notes created by the mail gateway the plugs appear like this:

(resources/18c606636ec1400597d1ca09e629f236.png)

This breaks the link and does not load properly. When I manually edit the link to this:

(:/18c606636ec1400597d1ca09e629f236)

it works fine. It looks like it is parsing the file variable incorrectly but I don't know how to fix that. Is there a simple way to fix this or is there a configuration setting that I haven't set correctly?

Thanks for any assistance at all.
Steve

Does this support IMAP as well?