<commit_before>FROM ubuntu:16.04

MAINTAINER <EMAIL>

ENV MAILNAME=localdomain.test \
    MAIL_ADDRESS= \
    MAIL_PASS= \
    MAIL_FS_USER=docker \
    MAIL_FS_HOME=/home/docker 

RUN set -x; \
    apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
    && echo "postfix postfix/mailname string $MAILNAME" | debconf-set-selections \
    && echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        postfix \
        dovecot-core \
        dovecot-imapd \
        dovecot-lmtpd \
        rsyslog \
        iproute2 \
    && apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y \
    && rm -rf /var/cache/apt/archives/* /var/cache/apt/*.bin /var/lib/apt/lists/* \
    && rm -rf /usr/share/locale/* && rm -rf /usr/share/man/* && rm -rf /usr/share/doc/* \
    && touch /var/log/auth.log && update-locale \

    # Create mail user
    && adduser $MAIL_FS_USER --home $MAIL_FS_HOME --shell /bin/false --disabled-password --gecos "" \
    && chown -R ${MAIL_FS_USER}: $MAIL_FS_HOME \
    && usermod -aG $MAIL_FS_USER postfix \
    && usermod -aG $MAIL_FS_USER dovecot \

    && echo "Installed: OK"

ADD postfix /etc/postfix

COPY dovecot/auth-passwdfile.inc /etc/dovecot/conf.d/
COPY dovecot/??-*.conf /etc/dovecot/conf.d/

ADD entrypoint /usr/local/bin/

RUN chmod a+rx /usr/local/bin/* \

    # Configure Postfix
    && /usr/sbin/postconf -e mydestination=localhost \
    && /usr/sbin/postconf -e mynetworks='127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128' \
    && /usr/sbin/postconf -e virtual_maps='hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual_regexp' \
    && /usr/sbin/postconf -e sender_canonical_maps=regexp:/etc/postfix/sender_canonical_regexp \
    && /usr/sbin/postconf -e virtual_transport=lmtp:unix:private/dovecot-lmtp \
    && /usr/sbin/postconf -e mailbox_transport=lmtp:unix:private/dovecot-lmtp \
    && /usr/sbin/postconf -e virtual_mailbox_domains=/etc/postfix/vhost \
    && /usr/sbin/postconf -e virtual_mailbox_maps=hash:/etc/postfix/vmailbox \
    && /usr/sbin/postconf compatibility_level=2 \
    && /usr/sbin/postmap /etc/postfix/virtual_regexp \
    && /usr/sbin/postmap /etc/postfix/virtual \
    && /usr/sbin/postmap /etc/postfix/vmailbox \
    && /usr/sbin/postmap /etc/postfix/sender_canonical_regexp \
    
    # Configures Dovecot
    && cp -a /usr/share/dovecot/protocols.d /etc/dovecot/ \
    && sed -i -e 's/include_try \/usr\/share\/dovecot\/protocols\.d/include_try \/etc\/dovecot\/protocols\.d/g' /etc/dovecot/dovecot.conf \

    && echo "Configured: OK"

VOLUME ["/var/mail"]
EXPOSE 25 143 993

ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["tail", "-fn", "0", "/var/log/mail.log"]<commit_msg>Add entrypoint as last task<commit_after>FROM ubuntu:16.04

MAINTAINER <EMAIL>

ENV MAILNAME=localdomain.test \
    MAIL_ADDRESS= \
    MAIL_PASS= \
    MAIL_FS_USER=docker \
    MAIL_FS_HOME=/home/docker 

RUN set -x; \
    apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
    && echo "postfix postfix/mailname string $MAILNAME" | debconf-set-selections \
    && echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        postfix \
        dovecot-core \
        dovecot-imapd \
        dovecot-lmtpd \
        rsyslog \
        iproute2 \
    && apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y \
    && rm -rf /var/cache/apt/archives/* /var/cache/apt/*.bin /var/lib/apt/lists/* \
    && rm -rf /usr/share/locale/* && rm -rf /usr/share/man/* && rm -rf /usr/share/doc/* \
    && touch /var/log/auth.log && update-locale \

    # Create mail user
    && adduser $MAIL_FS_USER --home $MAIL_FS_HOME --shell /bin/false --disabled-password --gecos "" \
    && chown -R ${MAIL_FS_USER}: $MAIL_FS_HOME \
    && usermod -aG $MAIL_FS_USER postfix \
    && usermod -aG $MAIL_FS_USER dovecot \

    && echo "Installed: OK"

ADD postfix /etc/postfix

COPY dovecot/auth-passwdfile.inc /etc/dovecot/conf.d/
COPY dovecot/??-*.conf /etc/dovecot/conf.d/


RUN set -x; \

    # Configure Postfix
    /usr/sbin/postconf -e mydestination=localhost \
    && /usr/sbin/postconf -e mynetworks='127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128' \
    && /usr/sbin/postconf -e virtual_maps='hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual_regexp' \
    && /usr/sbin/postconf -e sender_canonical_maps=regexp:/etc/postfix/sender_canonical_regexp \
    && /usr/sbin/postconf -e virtual_transport=lmtp:unix:private/dovecot-lmtp \
    && /usr/sbin/postconf -e mailbox_transport=lmtp:unix:private/dovecot-lmtp \
    && /usr/sbin/postconf -e virtual_mailbox_domains=/etc/postfix/vhost \
    && /usr/sbin/postconf -e virtual_mailbox_maps=hash:/etc/postfix/vmailbox \
    && /usr/sbin/postconf compatibility_level=2 \
    && /usr/sbin/postmap /etc/postfix/virtual_regexp \
    && /usr/sbin/postmap /etc/postfix/virtual \
    && /usr/sbin/postmap /etc/postfix/vmailbox \
    && /usr/sbin/postmap /etc/postfix/sender_canonical_regexp \
    
    # Configures Dovecot
    && cp -a /usr/share/dovecot/protocols.d /etc/dovecot/ \
    && sed -i -e 's/include_try \/usr\/share\/dovecot\/protocols\.d/include_try \/etc\/dovecot\/protocols\.d/g' /etc/dovecot/dovecot.conf \

    && echo "Configured: OK"

ADD entrypoint /usr/local/bin/
RUN chmod a+rx /usr/local/bin/entrypoint

VOLUME ["/var/mail"]
EXPOSE 25 143 993

ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["tail", "-fn", "0", "/var/log/mail.log"]
{'fraction_non_alphanumeric': 0.1615425626443931, 'fraction_numerical': 0.012440021325750844, 'mean_word_length': 2.719762062128222, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2513653', 'n_tokens_mistral': 2284, 'n_tokens_neox': 2194, 'n_words': 364}