Admin instructions mail server: Difference between revisions
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Mail Server Documentation== | ==Mail Server Documentation== | ||
:Basic configuration of server should follow the standard class server | :Basic configuration of server should follow the standard class server (see labs 1 and 9) | ||
<ol> | <ol> | ||
<li>Power on you Virtual machine</li> | <li>Power on you Virtual machine</li> | ||
Line 40: | Line 40: | ||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
find /home/ | find /home/ping/Maildir/cur -type f -mtime +7 -exec rm {} \; | ||
find /home/ | find /home/ping/Maildir/new -type f -mtime +7 -exec rm {} \; | ||
find /home/ | find /home/ping/Maildir/tmp -type f -mtime +7 -exec rm {} \; | ||
</pre> | </pre> | ||
:[[File:MAILSVR_emailflush_sh.png|link=https://wiki.ihitc.net/mediawiki/images/b/b5/MAILSVR_emailflush_sh.png|500px]] | :[[File:MAILSVR_emailflush_sh.png|link=https://wiki.ihitc.net/mediawiki/images/b/b5/MAILSVR_emailflush_sh.png|500px]] |
Latest revision as of 01:56, 16 April 2021
Mail Server Documentation
- Basic configuration of server should follow the standard class server (see labs 1 and 9)
- 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/ping/Maildir/cur -type f -mtime +7 -exec rm {} \; find /home/ping/Maildir/new -type f -mtime +7 -exec rm {} \; find /home/ping/Maildir/tmp -type f -mtime +7 -exec rm {} \;
* 20 * * * * /home/ping/scriptname.sh