Network Services

Hotspot Mikrotik 777

Technology has been used Bootstrap Compatible Mobile.

Design Hotspot-12 beautiful Server Mikrotik

Design Hot Spot Mikrotik Free

Hotspot login server free

Hotspot login server free.

Merge 2 lines in server Pfsense?

Merge 2 lines in server Pfsense server free.

setup squid cahce in Ubuntu

How to setup squid cahce in Ubuntu ?

Sunday, August 26, 2012

Dovecot Server for ubuntu



Dovecot Server


Quoting one of e-books



3.Dovecot Server :


Dovecot is a Mail Delivery Agent, written with security primarily in mind. It supports the major mailbox formats: mbox or Maildir. This section explain how to set it up as an imap or pop3 server.


3.1. Installation:
To install dovecot, run the following command in the command prompt:

sudo apt-get install dovecot-imapd dovecot-pop3d

3.2. Configuration:

To configure dovecot, you can edit the file /etc/dovecot/dovecot.conf. You can choose the protocol you use. It could be pop3, pop3s (pop3 secure), imap and imaps (imap secure). A description of these protocols is beyond the scope of this guide. For further information, refer to the Wikipedia articles on POP312 and IMAP13


IMAPS and POP3S are more secure that the simple IMAP and POP3 because they use SSL encryption to connect. Once you have chosen the protocol, amend the following line in the file 

/etc/dovecot/dovecot.conf:

protocols = pop3 pop3s imap imaps


Next, choose the mailbox you would like to use. Dovecot supports maildir and mbox formats. These are the most commonly used mailbox formats. They both have their own benefits and are discussed on the Dovecot web site14.


Once you have chosen your mailbox type, edit the file /etc/dovecot/dovecot.conf and change the following line:


mail_location = maildir:~/Maildir # (for maildir)
or
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)




Note:

You should configure your Mail Transport Agent (MTA) to transfer the incoming mail to this type of mailbox if it is different from the one you have configured.


Once you have configured dovecot, restart the dovecot daemon in order to test your setup:

sudo /etc/init.d/dovecot restart


If you have enabled imap, or pop3, you can also try to log in with the commands telnet localhost pop3 or telnet localhost imap2. If you see something like the following, the installation has been
successful:


bhuvan@rainbow:~$ telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Dovecot ready

3.3. Dovecot SSL Configuration:


To configure dovecot to use SSL, you can edit the file /etc/dovecot/dovecot.conf and amend 
following lines:





ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
ssl_disable = no
disable_plaintext_auth = no


You can get the SSL certificate from a Certificate Issuing Authority or you can create self signed SSL certificate. The latter is a good option for email, because SMTP clients rarely complain about "selfsigned certificates". Please refer to Section 5, “Certificates” [p. 171] for details about how to create self signed SSL certificate. Once you create the certificate, you will have a key file and a certificate file. Please copy them to the location pointed in the /etc/dovecot/dovecot.conf configuration file.

3.4. Firewall Configuration for an Email Server:


To access your mail server from another computer, you must configure your firewall to allow connections to the server on the necessary ports.


• IMAP - 143
• IMAPS - 993
• POP3 - 110
• POP3S - 995


3.5. References:
• See the Dovecot website15 for more information.
• Also, the Dovecot Ubuntu Wiki16 page has more details.




See you in the next lesson
Mr.Mohamed samir™



Exim4 for ubuntu



Quoting one of e-books



Exim4

2. Exim4


Exim4 is another Message Transfer Agent (MTA) developed at the University of Cambridge for use 
on Unix systems connected to the Internet. Exim can be installed in place of sendmail, although the 
configuration of exim is quite different to that of sendmail.





2.1. Installation:

To install exim4, run the following command:

sudo apt-get install exim4

2.2. Configuration:

To configure Exim4, run the following command:

sudo dpkg-reconfigure exim4-config


The user interface will be displayed. The user interface lets you configure many parameters. For example, In Exim4 the configuration files are split among multiple files. If you wish to have them in one file you can configure accordingly in this user interface.


All the parameters you configure in the user interface are stored in /etc/exim4/update-exim4.conf file. If you wish to re-configure, either you re-run the configuration wizard or manually edit this file using your favorite editor. Once you configure, you can run the following command to generate the master configuration file:
sudo update-exim4.conf


The master configuration file, is generated and it is stored in /var/lib/exim4/config.autogenerated.

Stpo:
At any time, you should not edit the master configuration file, /var/lib/exim4/
config.autogenerated manually. It is updated automatically every time you run update-exim4.conf

You can run the following command to start Exim4 daemon.

sudo /etc/init.d/exim4 start


2.3. SMTP Authentication:

This section covers configuring Exim4 to use SMTP-AUTH with TLS and SASL.




The first step is to create a certificate for use with TLS. Enter the following into a terminal prompt:

sudo /usr/share/doc/exim4-base/examples/exim-gencert




Now Exim4 needs to be configured for TLS by editing /etc/exim4/conf.d/main/03_exim4- config_tlsoptions add the following:


MAIN_TLS_ENABLE = yes



Next you need to configure Exim4 to use the saslauthd for authentication. Edit /etc/exim4/conf.d/auth/30_exim4-config_examples and uncomment the plain_saslauthd_server and
login_saslauthd_server sections:


plain_saslauthd_server:
    driver = plaintext
   public_name = PLAIN
   server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}
   server_set_id = $auth2
   server_prompts = :
   .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
   server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
   .endif
#
  login_saslauthd_server:
   driver = plaintext
   public_name = LOGIN
   server_prompts = "Username:: : Password::"
   # don't send system passwords over unencrypted connections
   server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}
   server_set_id = $auth1
   .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
   server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
   .endif






Additionally, in order for outside mail client to be able to connect to new exim server, new user needs
to be added into exim by using the following commands.



sudo /usr/share/doc/exim4/examples/exim-adduser

Users should protect the new exim password files with the following commands.


sudo chown root:Debian-exim /etc/exim4/passwd
sudo chmod 640 /etc/exim4/passwd



Finally, update the Exim4 configuration and restart the service:


sudo update-exim4.conf
sudo /etc/init.d/exim4 restart

2.4. Configuring SASL:



This section provides details on configuring the saslauthd to provide authentication for Exim4.

The first step is to install the sasl2-bin package. From a terminal prompt enter the following:

sudo apt-get install sasl2-bin

To configure saslauthd edit the /etc/default/saslauthd configuration file and set START=no to:

START=yes

Next the Debian-exim user needs to be part of the sasl group in order for Exim4 to use the saslauthd service:

sudo adduser Debian-exim sasl

Now start the saslauthd service:

sudo /etc/init.d/saslauthd start


Exim4 is now configured with SMTP-AUTH using TLS and SASL authentication.

2.5. References:



• See exim.org9 for more information.
• There is also an Exim4 Book10 available.
• Another resource is the Exim4 Ubuntu Wiki 11 page.



See you in the next lesson
Mr.Mohamed samir™