initial framework
This commit is contained in:
parent
5c5379b743
commit
65f0bc1173
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
MAINTAINER Ding Corporation
|
||||||
|
|
||||||
|
# install packages
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y fetchmail maildrop mpack \
|
||||||
|
&& apt-get clean && rm -fr /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
VOLUME /var/mail
|
||||||
|
VOLUME /config
|
||||||
|
|
||||||
|
RUN maildirmake /var/mail/working \
|
||||||
|
&& echo "to /var/mail/working" > /root/.mailfilter
|
||||||
|
TOUCH /var/mail/save-attachments.log
|
||||||
|
|
||||||
|
ADD save-attachments.crontab /etc/cron.d/save-attachments
|
||||||
|
ADD save-attachments.sh /opt/save-attachments.sh
|
||||||
|
RUN chmod 0644 /etc/cron.d/save-attachments
|
||||||
|
|
||||||
|
ADD docker-entrypoint.sh /opt/docker-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/opt/docker-entrypoint.sh"]
|
||||||
|
CMD cron && tail -f /var/mail/save-attachments.log
|
0
docker-entrypoint.sh
Executable file
0
docker-entrypoint.sh
Executable file
2
save-attachments.crontab
Normal file
2
save-attachments.crontab
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*/5 * * * * mail /opt/save-attachments.sh >> /var/mail/save-attachments.log 2>&1
|
||||||
|
|
6
save-attachments.sh
Executable file
6
save-attachments.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
LOG=/dev/stderr
|
||||||
|
echo "== $(date -Is) ==" >> $LOG
|
||||||
|
|
||||||
|
fetchmail
|
||||||
|
|
Loading…
Reference in New Issue
Block a user