![](https://it-infrastructure.solutions/content/images/2022/01/image-45.png)
This article has not been completed yet. However, it may already contain helpful Information and therefore it has been published at this stage.
Setting Up Office 365
![](https://it-infrastructure.solutions/content/images/2022/01/image-47.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-48.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-49.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-50.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-51.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-52.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-54.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-55.png)
Collecting Setup - Informations (Office 365 MX record)
![](https://it-infrastructure.solutions/content/images/2022/01/image-56.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-57.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-58.png)
Setting Up the Docker Mail-Relay Container
cd /var/lib/docker/custom_container
mkdir mail-relay
cd mail-relay
nano Dockerfile
FROM ubuntu:latest
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -q -y postfix rsyslog && \
postconf -e relayhost=<office 365 mx hostname> && \
postconf -e mynetworks="127.0.0.0/8 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12"
EXPOSE 25
CMD ["sh", "-c", "service rsyslog start ; service postfix start ; tail -F /var/log/mail.log"]
docker build . -t "mail-relay"
docker run -d -p 25:25 --restart always mail-relay
docker ps -a
![](https://it-infrastructure.solutions/content/images/2022/01/image-59.png)
![](https://it-infrastructure.solutions/content/images/2022/01/image-60.png)
Link: Download Portable SMTP Tester 1.0.1
![](https://it-infrastructure.solutions/content/images/2022/01/image-61.png)