I am running the tool in a Docker Compose and have the problem that the alerting is sent by mail without attachment if the report exceeds a defined length.
I have googled and researched and tested a lot but so far without success. I have understood that the ‘gvmd’ command for customising the email setting should be executed before starting the main service.
Does anyone have a tip on how I should adjust the ‘docker-comopse.yml’ file to bypass the limitation?
You can add the command: section to the gvmd section in the docker-compose.yml file. This will pass arguments to the default command in the entrypoint.sh.
In this case you want to set the arguments:
--max-email-attachment-size=NUMBER
Maximum size of alert email attachments, in bytes.
--max-email-include-size=NUMBER
Maximum size of inlined content in alert emails, in bytes.
--max-email-message-size=NUMBER
Maximum size of user-defined message text in alert emails, in bytes.
So, the gvmd should have a command section like this:
Thank you for your feedback.
Unfortunately it did not work. I get the following message:
docker logs 9feee43f77d0
setting up configuration file for mail agent
error: exec: “–max-email-attachment-size=10000000”: executable file not found in $PATH
setting up configuration file for mail agent
Oh, sorry, maybe you have to add gvmd to the command section as well since it seems like it is trying to execute the arguments. I suggest reading the docker documentation about how to use the command section and how it interacts with the entrypoint.sh.
Your issue is similar to this one here. However, the Community Containers do not use a systemd service file. So, the values need to be set via the command line. It seems your goal is to do this via the docker-compose.yml file, but there are other ways to accomplish this.
Did you have any error messages this time when trying to start the container?
I took a closer look at the docker initialization for the gvmd container. Using command: in the way I suggested above will override some important functions since CMD is being used to run a custom script instead of simply passing arguments. Sorry about that, I don’t often use Docker.
It looks like you can try setting an environment variable for the start-gvmd.sh script to override the default arguments to gvmd command. Looking at the the start-gvmd.sh script -f --listen-mode=666 are the default args.
You will need to keep those and then add the additional ones I mentioned above. Here is how you can set the environment variable:
Sorry, I guess I really botched this question to help you out. Looks like all three of these flags are actively used in gvmd and they are all default set to 0 as you can see here. So, you shouldn’t need to set the arguments anyway.
Did you check the sendmail MTA logs to see if the email is being rejected by the mail server?
Thanks for assisting @rippledj. This is what is working for me, thanks to @ChanScan from this topic Attachment size. I have the script run via cron job after another job that pulls the feed containers. Its working with the 3 ARGS set to -1 with the -f flag included. Although, better solution will be to have the container start with the ARGS via the compose file.
Oh, this is very interesting. Can you share your evidence that these command line arguments are not passed to the container please. It would be the first report that gvmd command line arguments are not working for docker containers.