Admin instructions mail server: Difference between revisions
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
<li>Set a static IP for your server, capstone group used 172.17.50.28</li> | <li>Set a static IP for your server, capstone group used 172.17.50.28</li> | ||
<li>Apply your static IP address</li> | <li>Apply your static IP address</li> | ||
<li>Install postfix, see lab 9</li> | |||
</ol> | </ol> | ||
Revision as of 00:42, 2 March 2021
Mail Server Documentation
- Basic configuration of server should follow the standard class server, see lab 1
- Power on you Virtual machine
- Install Debian Linux
- Set the domain name to itc2480.campus.ihitc.net
- Create a new user account ping using the adduser program
adduser ping
- Set a static IP for your server, capstone group used 172.17.50.28
- Apply your static IP address
- Install postfix, see lab 9
Auto Reply Configuration
- Install vacation
- Vacation is a Linux package that will auto-respond to received emails for the receiving users.
- Run the vacation program in the profile you wish to set up the reply message from
- Follow the prompts, for now reply with the default answer (Y)
- Edit the vacation.msg file
- Click for a larger image
- Enter the message that you would like to have in the auto-response.
- Set the response to auto mail every message
- The default response is every one week to send an auto-reply, for our use it is important to reply to every email.
- NOTE: It is important to understand this command sets the auto-reply delay. Using the -r 0 sets the vacation program to reply to EVERY message it receives. In a production environment, this is not recommended as it can create mail loops.
- Test your reply message from the CLI mailutils package or the MTA chosen to use on client computers
sudo apt install vacation
vacation
nano vacation.msg
vacation -i -r 0
Auto Maildir Clean Up
- Create script to delete emails older than 45 days
- NOTE: The script must be owned by root and executable. Additionally, the crontab must be created with sudo priviledges
sudo nano <scriptname.sh>
- Make executable
sudo chmod +x <sciptname.sh>
- Create a crontab job
sudo crontab -e
- NOTE: the astricks at the start of the following command are respective to the scheduling of time. A good additional resource for cron can be found at Vitux. Each astrik represents [Minute] [hour] [Day_of_the_Month] [Month_of_the_Year] [Day_of_the_Week]
- Add the following line to the chrontab file to schedule the job at 8PM every day.
#!/bin/bash find /home/testuser/Maildir/cur -type f -mtime +45 -exec rm {} \; find /home/testuser/Maildir/new -type f -mtime +45 -exec rm {} \; find /home/testuser/Maildir/tmp -type f -mtime +45 -exec rm {} \;
* 20 * * * * /home/ping/scriptname.sh