Skip to content
Lefteris Chatzimparmpas edited this page Aug 6, 2022 · 2 revisions

Here's an example Dockerfile, that grabs the latest imapfilter source code from Git, and builds it:

FROM debian:bullseye-slim

RUN apt-get update && \
    apt-get install -y make gcc git libssl-dev libpcre2-dev liblua5.4-dev && \
    git clone https://github.com/lefcha/imapfilter.git && \
    cd imapfilter && \
    make -j INCDIRS=-I/usr/include/lua5.4/ LIBLUA=-llua5.4 && \
    make install

CMD ["/usr/local/bin/imapfilter", "-c", "/config.lua"]

You can build an image:

docker build -t imapfilter .

Assuming a config located in ~/.imapfilter/config.lua, for example:

myaccount = IMAP {
    username = 'user',
    password = 'secret',
    ssl = 'auto',
}

while true do
    myaccount.inbox:enter_idle()
    -- processing commands go here
end

You can run imapfilter:

docker run -v ~/.imapfilter/config.lua:/config.lua imapfilter
Clone this wiki locally