When doing update on a Debian/Ubuntu server, if a package is trying to modify a config file, it’s asking for a manual choice. If you’re trying to try to automate the process, you’d probably like to get rid of that ask and keep the current config file by default.
There is no way to easily automate deployment of Oracle JRE since there is no official repository for most of the linux distros. But there’s still a workaround to automatically download the JRE and install it locally on a server by using command lines.
If you want to execute some special commands, log or make an API call when you’re receiving an email onto your server, you can easily set up this by using procmail. Procmail is designed to filter and sort emails but can make any call you want.
Here, as an example, we will set up a simple call to a python script that will read the content of the mail (headers and body) and put the information into a log file.
1. Install procmail
Depending on the OS you’re using, you should find a package pre-compiled in the common repositories.
For example, on a Debian-based:
apt-get install procmail
or on a CentOS-based:
yum install procmail
2. Build the python script you want to call to analyze the message
You now have to prepare your script you will execute when receiving an email, that will read and parse the content to log interesting information in a file.