iredmail / dockerized

Official dockerized iRedMail.

Home Page:https://www.iredmail.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add a custom.sh script for post-startup functions

blacksteel1288 opened this issue · comments

commented

it would be very useful to have a custom.sh script that runs as part of the entrypoint.sh scripts. this could be used for any further customizations, or in my case, to add external logging to a centralized log server and to set a default IP blacklist with iptables.

this could potentially be done by something along the lines of modifying https://github.com/iredmail/dockerized/blob/master/entrypoints/all_in_one.sh

to add this after line 74:

run_entrypoint ${CUSTOM_DIR}/custom.sh

currently, to add external logging, I have to run a custom start_iredmail.sh script to start the iredmail container that contains lines like this:

docker exec -d iredmail bash -c "tail -n 0 -q -F /var/log/fail2ban/fail2ban.log >> /proc/1/fd/1"

while this does work, it requires me to start the container manually all the time. I can't use the standard docker run or docker-compose up to start iredmail. So, on unplanned restarts when the container starts automatically, these custom commands are not called.

adding a custom.sh option on the entrypoint.sh would solve this.

additionally/alternatively, it would be great if there was a way to set rsyslog configurations for external logging, as currently not all logs appear in stdout, which is required for docker containers to send logs to remote log servers.