Skip to content

Commit

Permalink
Fix exim4 mail server
Browse files Browse the repository at this point in the history
  • Loading branch information
khurtado committed Nov 21, 2024
1 parent b71c0c9 commit a3aaf80
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/pypi/wmagent/wmagent-docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ln -s $HOST_MOUNT_DIR/srv/wmagent /data/srv/wmagent
passwdEntry=$(getent passwd $wmaUser | awk -F : -v wmaHome="/home/$wmaUser" '{print $1 ":" $2 ":" $3 ":" $4 ":" $5 ":" wmaHome ":" $7}')
groupEntry=$(getent group $wmaGroup)

# @TODO: Create needed unix accounts in container, rather than bind mounting files from the host
# workaround case where Unix account is not in the local system (e.g. sssd)
[[ -d $HOST_MOUNT_DIR/admin/etc/ ]] || (mkdir -p $HOST_MOUNT_DIR/admin/etc) || exit $?
if ! [ -f $HOST_MOUNT_DIR/admin/etc/passwd ]; then
Expand All @@ -85,6 +86,12 @@ if ! [ -f $HOST_MOUNT_DIR/admin/etc/group ]; then
echo $groupEntry >> $HOST_MOUNT_DIR/admin/etc/group
fi

# workaround for exim4 service, add back unix users needed into system files
echo "Debian-exim:x:105:" >> $HOST_MOUNT_DIR/admin/etc/group
echo "uucp:x:10:" >> $HOST_MOUNT_DIR/admin/etc/group
echo "Debian-exim:x:103:105::/var/spool/exim4:/usr/sbin/nologin" >> $HOST_MOUNT_DIR/admin/etc/passwd
echo "uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin" >> $HOST_MOUNT_DIR/admin/etc/passwd

# create regular mount points at runtime
[[ -d $HOST_MOUNT_DIR/admin/wmagent ]] || (mkdir -p $HOST_MOUNT_DIR/admin/wmagent) || exit $?
[[ -d $HOST_MOUNT_DIR/srv/wmagent/$WMA_VER_RELEASE/install ]] || (mkdir -p $HOST_MOUNT_DIR/srv/wmagent/$WMA_VER_RELEASE/install) || exit $?
Expand Down Expand Up @@ -148,3 +155,7 @@ userStatus="$(docker exec -u root -it wmagent sh -c "passwd -S $wmaUser" | awk '
if [ "${userStatus:0:1}" == "P" ]; then
docker exec -u root -it wmagent sh -c "echo $wmaUser:$wmaUser | chpasswd"
fi

# Configure exim4 server in non-local mode and start the service
docker exec -u root -it wmagent sed -ie "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='internet'/g" /etc/exim4/update-exim4.conf.conf
docker exec -u root -it wmagent service exim4 start

0 comments on commit a3aaf80

Please sign in to comment.