Skip to content

Commit

Permalink
Changes Python installation + script to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkratz committed Apr 27, 2024
1 parent f97a9f0 commit 0af48bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ RUN sudo locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8

# Install specific packages
RUN sudo apt-get install -y getmail6 python2
RUN sudo apt-get install -y getmail6 python3
RUN sudo git clone https://github.com/ralbear/IMAPbackup.git

# Remove apt lists (for storage efficiency)
RUN sudo rm -rf /var/lib/apt/lists/*

# Run list command
# RUN cd IMAPbackup && sudo python imapgrab.py -l -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD
# RUN cd IMAPbackup && sudo python3 imapgrab38.py -l -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD

# Assuming that folder is mount to /mnt, create mail-output folder
RUN sudo mkdir -p /mnt/mail

# Check if logging is enabled
CMD if [ "${MAILLOG}" = "TRUE" ]; \
then sudo mkdir -p /mnt/log && cd IMAPbackup && sudo python2 imapgrab.py -L imapgrab -d -v -M -f /mnt/mail/$MAILFOLDER -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD -m "_ALL_" >> /mnt/log/$(date +'%Y-%m-%d_%H-%M-%S')_mail-backup.log; \
else cd IMAPbackup && sudo python2 imapgrab.py -L imapgrab -d -v -M -f /mnt/mail/$MAILFOLDER -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD -m "_ALL_"; \
then sudo mkdir -p /mnt/log && cd IMAPbackup && sudo python3 imapgrab38.py -L imapgrab -d -v -M -f /mnt/mail/$MAILFOLDER -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD -m "_ALL_" >> /mnt/log/$(date +'%Y-%m-%d_%H-%M-%S')_mail-backup.log; \
else cd IMAPbackup && sudo python3 imapgrab38.py -L imapgrab -d -v -M -f /mnt/mail/$MAILFOLDER -s $MAILHOST -u $MAILUSER -p $MAILPASSWORD -m "_ALL_"; \
fi

0 comments on commit 0af48bf

Please sign in to comment.