Mail Server Basic
Receiving Mail Process When someone sends you an email it moves from their email client to their mail server. Their mail server then uses the recipient email address to determine where the mail is supposed to go and delivers the email to your mail server. Your mail server stores the received email in a mailbox until your mail client asks for it. This is where IMAP and POP enter the picture.
IMAP (Internet Message Access Protocol) and POP (Post Office Protocol) IMAP and POP are the two most prevailing methods or protocols for retrieving email from a mail server. Both of these protocols are supported by almost all popular mail client programs like Outlook, Thunderbird and Apple Mail. When your mail client reads an email it can either download the email from the mail server to your local desktop and delete it from the mail server, or just allow you to see the email contents, without saving it locally, similar to your viewing a webpage. In the first case, where you download an email to your local machine, POP is used. In the second case, where you view the email, it actually stays on the mail server.
Main differences POP – Downloads email locally IMAP – Mail is stored on the mail server
Sending Emails SMTP POP or IMAP, when you send an email you will use some form of SMTP (Simple Mail Transfer Protocol), which totally different from IMAP and POP. When you click on send on an email message the mail client contacts the SMTP server that is part of your mail service. The server authenticates you using your login id and password and receives the email message from your client. The mail server then looks up the recipient’s mail server and passes the message to that server. Your mail client then places the sent email in either your local sent mail folder or in the case of IMAP the sent email folder on the server.
SMTP Relay SMTP Relay, which stands for Simple Mail Transfer Protocol, lets you send email messages through your email account using your existing email service. For example, you can continue to use Microsoft Outlook to compose, receive, and send email messages, but the actual email messages are processed through our SMTP relaying services. This lets you bypass ISP restrictions on your outbound email messages and allows you to use your professional looking "sales@coolexample.com" email address rather than a general “sales@ispname” address.
Spam control Spam is often sent by mass mailing operations that use computers to send millions of messages in a short period of time. Spam has become a popular marketing tactic because it is cheap and easy to send. Also, many spammers set up their accounts overseas in countries where the government may be indifferent to their activities. Or they may use a free email service to set up temporary accounts they can suspend or abandon once they have been reported. For these reasons, reporting spammers often involves a lot of effort with very limited impact.
Never respond to spam. This includes clicking on any of the advertisements included in the body of a spam email. Once you respond to spam, the spammer knows your email address is active. They then know they can send more spam email to that address. Not only that, it also means they may add your address to databases they can use to spoof the “from” address in future spam emails, a common practice among spammers that makes them hard to track and shut down.
Be careful when using the “unsubscribe” instructions at the bottom of emails. Only use this option if you are receiving emails you requested. If you didn’t request the emails (such as by subscribing to a newsletter) chances are it’s just a trick to get you to click on the link and let the spammers know they have found an active email address.
Do not share your primary password on bulletin boards or online forums Do not share your primary password on bulletin boards or online forums. Just as with web pages, spammers can use software to scan these online communities for email addresses they can add to their databases. Avoid using your primary email address in online forms. It is recommended that you use a secondary email address when you sign up for online services or make purchases online. Setting up a secondary address can be done through a free email provider such as Microsoft’s Hotmail, Yahoo, or Google’s GMail.
Installation of Mailserver Yum install postfix Yum install dovecot Modify mail server configuration Service postfix start Service dovecot start Vi /etc/postfix/main.cf
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer Telnet SSH SCP, rsync
Webmin Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. Download webmin.rpm file from google Install webmin rpm file
Webmin In a web browser, enter the https address of the server with the port number 10000 to access Webmin - for example: https://192.168.1.1:10000 -or- https://myserver.example.net:10000 You will need to enter the root password of the server running Webmin to use the Webmin interface and administer the server.
Team viewer TeamViewer is a proprietary computer software package for remote control, desktop sharing, online meetings, web conferencing and file transfer between computers. The software operates with the Microsoft Windows, OS X, Linux, iOS, Android, Windows RT and Windows Phone operating systems. It is possible to access a machine running TeamViewer with a web browser. While the main focus of the application is remote control of computers, collaboration and presentation features are included.
What is Telnet? Telnet is a user command and an underlying TCP/IP protocol for accessing remote computers. Through Telnet, an administrator or another user can access someone else's computer remotely. On the Web, HTTP and FTP protocols allow you to request specific files from remote computers, but not to actually be logged on as a user of that computer. With Telnet, you log on as a regular user with whatever privileges you may have been granted to the specific application and data on that computer.
SSH Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers that connects, via a secure channel over an insecure network, a server and a client (running SSH server and SSH client programs, respectively). The protocol specification distinguishes between two major versions that are referred to as SSH-1 and SSH-2.
SCP Secure copy or SCP is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol. scp SourceFile user@host:directory/TargetFile scp user@host:directory/SourceFile TargetFilescp -r user@host:directory/SourceFolder TargetFolder
rsync rsync is a utility software and network protocol for Unix-like systems (with ports to Windows) that synchronizes files and directories from one location to another while minimizing data transfer by using delta encoding when appropriate One of the earliest applications of rsync was to implement mirroring or backup for multiple Unix clients to a central Unix server using rsync/ssh and standard Unix accounts.
The example below is for automatical settings The example below is for automatical settings. Ecxample ⇒ Copy files and directories in /var/www/html on a HostA[10.0.0.31] to in /home/backup on HostB[10.0.0.30].
Rsync - Synchronizes files and directories [root@dlp ~]# yum -y install rsync xinetd [root@dlp ~]# vi /etc/xinetd.d/rsync # default: off # description: The rsync server is a good addition to an ftp server, as it \ # allows crc checksumming etc. service rsync { disable = no # change flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
[root@dlp ~]# /etc/rc.d/init.d/xinetd start Starting xinetd:[ OK ] [root@dlp ~]# chkconfig xinetd on [root@dlp ~]# mkdir /home/backup [root@dlp ~]# vi /etc/rsyncd.conf # any name you like [website] # destination directory path = /home/backup # Hosts you allow to copy (specify source Host) hosts allow = 10.0.0.31 hosts deny = * list = true uid = root gid = root read only = false
[2]Configure on Source Host.[root@www ~]# yum -y install rsync [root@www ~]# vi /etc/rsync_exclude.lst # specify files or directories you'd like to exclude to copy test test.txt
[3]It's OK. Execute rsync on Source Host like follows. [root@www ~]# rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /var/www/html/ 10.0.0.30::website # Add in cron if you'd like to run reguraly [root@www ~]# crontab -e # run at 2:00 AM in a day 00 02 * * * rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /var/www/html/ 10.0.0.30::website
Packet Analysis by using TCPDUMP and WIRESHARK TCPDUMP Command Wireshark installation