You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

116 lines
3.9 KiB

  1. FROM hasufell/exherbo
  2. MAINTAINER Julian Ospald "hasufell@posteo.de"
  3. # copy paludis config
  4. COPY ./config/paludis /etc/paludis
  5. ##### PACKAGE INSTALLATION #####
  6. # update world with our options
  7. RUN chgrp paludisbuild /dev/tty && \
  8. eclectic env update && \
  9. source /etc/profile && \
  10. cave sync && \
  11. cave resolve -z -1 repository/net -x && \
  12. cave resolve -z -1 repository/hasufell -x && \
  13. cave resolve -z -1 repository/python -x && \
  14. cave resolve -z -1 repository/perl -x && \
  15. cave resolve -z -1 repository/nicoo -x && \
  16. cave update-world -s mail && \
  17. cave resolve --recommendations ignore --suggestions ignore -ks -Sa -sa -B world -x -f --permit-old-version '*/*' && \
  18. cave resolve --recommendations ignore --suggestions ignore -ks -Sa -sa -B world -x --permit-old-version '*/*' && \
  19. cave purge -x && \
  20. cave fix-linkage -x -- --recommendations ignore --suggestions ignore && \
  21. rm -rf /usr/portage/distfiles/*
  22. RUN eclectic config accept-all
  23. ################################
  24. ##### APPLICATION CONFIG #####
  25. # copy "mailbase" stuff
  26. COPY ./config/mailcap /etc/mailcap
  27. COPY ./config/mail /etc/mail
  28. COPY ./config/pam.d /etc/pam.d
  29. # create dovecot certificates
  30. RUN mkdir -p /var/tmp/dovecot-cert
  31. RUN cp /usr/share/doc/dovecot-*/mkcert.sh /var/tmp/dovecot-cert/ ; \
  32. cp /usr/share/doc/dovecot-*/dovecot-openssl.cnf /var/tmp/dovecot-cert/
  33. RUN chmod +x /var/tmp/dovecot-cert/mkcert.sh
  34. WORKDIR /var/tmp/dovecot-cert
  35. RUN ./mkcert.sh
  36. RUN chown root:dovecot /etc/ssl/certs/dovecot.pem ; \
  37. chmod 0644 /etc/ssl/certs/dovecot.pem ; \
  38. chown root:dovecot /etc/ssl/private/dovecot.pem ; \
  39. chmod 0600 /etc/ssl/private/dovecot.pem
  40. WORKDIR /
  41. RUN rm -r /var/tmp/dovecot-cert
  42. # create postfix certificates
  43. RUN openssl req -new -x509 -nodes -out /etc/ssl/certs/postfix.pem -keyout \
  44. /etc/ssl/private/postfix.key -days 3650 -subj '/CN=www.example.com'
  45. # Postfix configuration
  46. ADD ./config/postfix/postfix.main.cf /etc/postfix/main.cf
  47. ADD ./config/postfix/postfix.master.cf.append /etc/postfix/master-additional.cf
  48. RUN cat /etc/postfix/master-additional.cf >> /etc/postfix/master.cf
  49. RUN sed -r -i -e \
  50. '/^smtp[[:space:]]+inet[[:space:]]+/a\ -o content_filter=spamassassin' \
  51. /etc/postfix/master.cf
  52. RUN newaliases -oA/etc/mail/aliases
  53. # Dovecot configuration
  54. COPY ./config/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
  55. COPY ./config/dovecot/dovecot.mail /etc/dovecot/conf.d/10-mail.conf
  56. COPY ./config/dovecot/dovecot.ssl /etc/dovecot/conf.d/10-ssl.conf
  57. COPY ./config/dovecot/dovecot.auth /etc/dovecot/conf.d/10-auth.conf
  58. COPY ./config/dovecot/dovecot.master /etc/dovecot/conf.d/10-master.conf
  59. COPY ./config/dovecot/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
  60. COPY ./config/dovecot/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
  61. COPY ./config/dovecot/dovecot.sieve /etc/dovecot/conf.d/90-sieve.conf
  62. COPY ./config/dovecot/dovecot.managesieve \
  63. /etc/dovecot/conf.d/20-managesieve.conf
  64. # Uncomment to add verbose logging
  65. COPY ./config/dovecot/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
  66. # spamassasin configuration
  67. COPY ./config/spamassasin/spamassasin.local.append \
  68. /etc/mail/spamassassin/local.cf.append
  69. RUN mkdir /etc/mail/spamassassin/.pyzor /etc/mail/spamassassin/.razor
  70. COPY ./config/spamassasin/pyzor.servers /etc/mail/spamassassin/.pyzor/servers
  71. RUN cat /etc/mail/spamassassin/local.cf.append >> /etc/mail/spamassassin/local.cf
  72. COPY ./update-spamlists /usr/bin/update-spamlists
  73. RUN chmod +x /usr/bin/update-spamlists
  74. # supervisord configuration
  75. COPY ./config/supervisord.conf /etc/supervisord.conf
  76. ##############################
  77. # Nice place for your settings
  78. VOLUME ["/mail_settings"]
  79. # Copy boot scripts
  80. COPY boot /
  81. RUN chmod 755 /boot
  82. COPY boot.d /boot.d
  83. RUN chmod -R 755 /boot.d
  84. # Add user vmail that owns mail
  85. RUN groupadd -g 5000 vmail
  86. RUN useradd -g vmail -u 5000 vmail -d /vmail -m
  87. # Volume to store email
  88. VOLUME ["/vmail"]
  89. EXPOSE 25 465 993 4190
  90. CMD /boot && exec /usr/bin/supervisord -n -c /etc/supervisord.conf