Admin instructions mail server

From ITCwiki
Jump to navigation Jump to search

Mail Server Documentation

Basic configuration of server should follow the standard class server (see labs 1 and 9)
  1. Power on you Virtual machine
  2. Install Debian Linux
    • Set the domain name to itc2480.campus.ihitc.net
  3. Create a new user account ping using the adduser program
  4. adduser ping
  5. Set a static IP for your server, capstone group used 172.17.50.28
  6. Apply your static IP address
  7. Install postfix, see lab 9

Auto Reply Configuration

  1. Install vacation
  2. Vacation is a Linux package that will auto-respond to received emails for the receiving users.
    sudo apt install vacation
  3. Run the vacation program in the profile you wish to set up the reply message from
  4. vacation
  5. Follow the prompts, for now reply with the default answer (Y)
  6. MAILSVR vaca prompts.png
    Click here for a larger image
  7. Edit the vacation.msg file
  8. nano vacation.msg
    MAILSVR vaca msg.png
    Click for a larger image
    • Enter the message that you would like to have in the auto-response.
  9. Set the response to auto mail every message
  10. The default response is every one week to send an auto-reply, for our use it is important to reply to every email.
    vacation -i -r 0
    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.
  11. Test your reply message from the CLI mailutils package or the MTA chosen to use on client computers

Auto Maildir Clean Up

  1. Create script to delete emails older than 45 days
  2. NOTE: The script must be owned by root and executable. Additionally, the crontab must be created with sudo priviledges
    sudo nano <scriptname.sh>
    #!/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 {} \;
    
    MAILSVR emailflush sh.png
    Click here for a larger image
  3. Make executable
  4. sudo chmod +x <sciptname.sh>
  5. Create a crontab job
  6. 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.
    * 20 * * * * /home/ping/scriptname.sh