- Imapsync tool based on the imapsync command and the original project here [imapsync source website]
(https://imapsync.lamiral.info/)
-
The tool has 2 versions
-
The first one requires input of user data (source username , password , hostname , and destination username ,hostname and password)
-
The second version is file upload version that reads credentials from a file with the following separation method
hostname1;username1;password1;hostname2;username2;password2
-
Allowed file format is only .txt with
;
separator of the credentials
2.Hosting tools like Ipinfo Source Website requires an account at ipinfo.io and the access token
- The ipinfo token is to be replaced in the tools.py file
3.DNS Checking tools. Checks for DNS configuration of a domain (TXT , MX ,A , DNSSEC , PTR Record types)
4.Mail Records. Embedded tools from EasyDmarc
- Clone the Repo with git clone
- Make sure you have Python with version higher than 3.10
- Install globally the venv module or virtualenv package
dnf -y install python3-virtualenv
dnf -y install python-virtualenv
apt-get install virtualenv -y
- Create virtualenvironment folder with
virtualenv .venv
- Activate the virtualenvironment
source .venv/bin/activate
- Install the packages.txt file with the python dependencies
pip3 install -r packages.txt
waitress-serve --listen=0.0.0.0:5000 wsgi:application
-
You will be able to access the app on port 5000 with your local IP such as 192.168.1.15:5000 for example
-
Once this is done you can set it up as a service by copying the service file
- Copy the file to /etc/systemd/system/tools.service
- Enable the service systemctl enable --now tools.service
- You can run it as a regular user (recommended) or as root
- The App is build for personal usage and internal usage
- It has no security policies implemented into the form-post requests
useradd -m tools -s /sbin/nologin
- Create it without a login but with a home so you can locate the files there
- Make sure all files have permissions to be run as user tools
chown -R /home/tools/
- Make sure to install bind-utils
dnf -y install bind-utils
apt install -y bind9-utils
- On line 229 in the code replace the token with your personal account token from ipinfo official website.
- The free api token has 50 000 requests per month.
- Here is the actual code where you have to replace it with your token
access_token = 'ipinfo-personal-account-access-token'
handler = ipinfo.getHandler(access_token)
- Dockerfile
- imapsync requirements file. You can find the apt install dependency command here as well Imapsync Install guide
-
Filename install-requirements-imapsync.sh uploaded in the repo
-
Dockerfile
# Use an official Python runtime as a parent image
FROM python:3.11
# Set the working directory in the container
WORKDIR /imapsync-hosting-tools
# Copy the current directory contents into the container at /app
COPY . /imapsync-hosting-tools
# Copy requirements.txt file
COPY requirements.txt /imapsync-hosting-tools/requirements.txt
COPY install-requirements-bash.sh /imapsync-hosting-tools
# Install dependencies from requirements.txt and bash
RUN apt-get update && apt-get install -y bash && \
bash -c "apt-get install -y python3.11 python3.11-venv python3.11-dev wget"
RUN bash -c "pip3 install --upgrade pip"
RUN bash -c "pip3 install --no-cache-dir -r requirements.txt"
RUN bash -c "wget -N https://imapsync.lamiral.info/imapsync"
RUN chmod +x imapsync
RUN cp imapsync /usr/local/bin/imapsync
RUN bash install-requirements-bash.sh
# Expose port 8000 for the Hosting tools server
EXPOSE 8000
# Define the command to run Hosting Tools on container start
CMD ["python3.11", "-m", "flask", "run", "--host=0.0.0.0", "--port=8000"]
-
Build the image with docker build . at the location of the Dockerfile and all files in folder imapsync-hosting-tools
-
Then just run the container with docker run -d -p 8000:8000 if you
-
To check the list of docker images use
docker image ls
and obtain the id from there
- For firewalld use the bellow command.
firewall-cmd --permanent --add-port=8000/tcp&&firewall-cmd --reload
- If you are using ufw
ufw allow 8000&&ufw reload
![Ip check/Ipinfo tool](hosting-tools-images/ip-check-tool.jpg