Skip to content

Instantly share code, notes, and snippets.

View henrikj242's full-sized avatar

Henrik 242 Jensen henrikj242

View GitHub Profile
@henrikj242
henrikj242 / bashrc
Created August 19, 2020 08:17
bashrc
# cd to a some default direcory
# cd /c/code/
# load ssh agent so to not keep having to enter keyfile password
eval $(ssh-agent -s)
ssh-add
# Was only used on a particular project
# export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
# export PATH=$PATH:/c/Users/henrik/.vagrant.d
@henrikj242
henrikj242 / action_mailbox_inbound_email_from_email_source.md
Last active February 19, 2025 10:31
Create ActionMailbox::InboundEmail from raw email source

I wanted to fetch emails from an IMAP or POP3 account, and send them to my Rails app with all the benefits from the ActionMailbox, but I couldn't seem to find a well-defined way to do this.

So, I ended up looking at the source of the relay ingress

Here we can see how the controller takes the raw email source and creates the InboundEmail:

ActionMailbox::InboundEmail.create_and_extract_message_id! request.body.read