Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postfix support #110

Open
hazcod opened this issue Oct 12, 2018 · 4 comments
Open

Postfix support #110

hazcod opened this issue Oct 12, 2018 · 4 comments
Labels
area: compatibility Issue related to (Linux) kernel compatibility priority: p3 Low priority type: enhancement New feature or request

Comments

@hazcod
Copy link

hazcod commented Oct 12, 2018

Hello,

did anyone try postfix under gvisor?
Since postfix requires root access, this would make a fine candidate to shield off the kernel from.

Also, am I correc to state that the purpose of gvisor is to shield off the kernel implementation using the golang vm?

@prattmic
Copy link
Member

You mean Postfix the mail server? I don't think anyone has tried it, but I'd imagine it works.

Why does Postfix require root? Just to listen on a low port number? I believe that would be workable with Docker remapping the port.

@hazcod
Copy link
Author

hazcod commented Oct 14, 2018

@fvoznika fvoznika added the type: question General support/architecture question label Jan 11, 2019
@ianlewis
Copy link
Contributor

ianlewis commented Aug 1, 2019

You might be able to mount the right directories to get local mail delivery to work from a sandbox. Could you give it a try and let us know what you find?

@hazcod
Copy link
Author

hazcod commented Aug 1, 2019

I was unable to get postfix to work under root, this is as far as I got.
A logger.go Go file was used to print out logs sent to the /var/log/ socket:

FROM alpine:latest as gobuilder
COPY logger.go /logger.go
RUN apk add --no-cache musl-dev go \
	&& CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o /logger /logger.go


FROM alpine

ENV POSTFIX_VERSION="3.3.0-r4"

RUN apk add --no-cache "postfix=${POSTFIX_VERSION}" "postfix-pcre=${POSTFIX_VERSION}" \
	&& echo "mailgroup:x:1999:" >> /etc/group \
	&& rm -r /etc/postfix

COPY --from=gobuilder /logger $APP_DIR/logger
COPY conf/ $CONF_DIR
COPY run.sh $APP_DIR
RUN postmap -v -c $CONF_DIR $CONF_DIR/sender-canonical

RUN $APP_DIR/post-install.sh \
	&& chmod 500 $APP_DIR/logger \
	&& mkdir -p $CONF_DIR/dynamicmaps.cf.d \
	&& mkdir -p $CONF_DIR/postfix-files.d \
	&& chown -R root "$CONF_DIR" \
	&& chown :mailgroup /usr/sbin/postqueue  /usr/sbin/postdrop \
	&& chmod g+s /usr/sbin/postqueue  /usr/sbin/postdrop

EXPOSE 25000
VOLUME "$DATA_DIR"
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD nc -zv 127.0.0.1 25000 || exit 1
USER root
CMD $APP_DIR/run.sh

@ianlewis ianlewis added area: compatibility Issue related to (Linux) kernel compatibility priority: p3 Low priority type: enhancement New feature or request and removed type: question General support/architecture question labels Jan 30, 2020
@ianlewis ianlewis changed the title Postfix support? Postfix support Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: compatibility Issue related to (Linux) kernel compatibility priority: p3 Low priority type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants