Cari Blog Ini

23 November 2013

Installing Squirrel Web Mail

Hotmail Sejak awalnya memperkenalkan konsep kotak surat yang dapat diakses melalui web (cara sebelum Microsoft membeli mereka), webmail telah menjadi cara populer mengakses email, sementara di jalan. This article describes setting up webmail for the users of your Debian system. Artikel ini menjelaskan pengaturan webmail untuk para pengguna sistem Debian Anda.
SquirrelMail is probably the most popular open source webmail client. SquirrelMail mungkin adalah open source paling populer klien webmail. It has a focus on compatibility, so it's usable even with the most archaic browser as long as it supports frames and cookies. Memiliki fokus pada kompatibilitas, sehingga bahkan dapat digunakan dengan browser yang paling kuno asalkan mendukung frame dan cookie. Yet, it offers all features of a complete mail client. Namun, ia menawarkan semua fitur klien email yang lengkap.
For starters you'll need a PHP-enabled webserver, like apache or apache2 with the php4 module. Sebagai permulaan Anda akan memerlukan PHP-enabled webserver, seperti apache atau apache2 dengan modul PHP4.
SquirrelMail runs on top of an IMAP-server. SquirrelMail berjalan di atas server IMAP. Having an IMAP-server installed and working is a pre-condition and is not really covered in this article. Memiliki IMAP-server terinstal dan bekerja adalah suatu pra-kondisi dan tidak benar-benar tercakup dalam artikel ini.
Examples of good IMAP server packages are courier-imap , cyrus and dovecot . If you don't want to offer your users direct IMAP access, you can block outside access to port 143 except for the machine hosting SquirrelMail. Contoh yang baik Paket-paket server IMAP courier-imap, cyrus dan dovecot. Jika Anda tidak ingin menawarkan pengguna Anda langsung akses IMAP, Anda dapat memblokir akses luar ke port 143 kecuali untuk mesin SquirrelMail hosting.
On to installing SquirrelMail. Aktif untuk menginstal SquirrelMail. This is easy: Hal ini mudah:
 apt-get install squirrelmail apt-get install squirrelmail 
You'll see that it depends on squirrelmail-locales , the translations package. Anda akan melihat bahwa itu tergantung pada squirrelmail-locales, paket terjemahan. If you're using etch or sid, the squirrelmail-locales package is only recommended, so you can remove it if you have English speaking users exclusively. Jika Anda menggunakan etch atau sid, yang squirrelmail-locales paket hanya direkomendasikan, sehingga Anda dapat menghapusnya jika Anda memiliki pengguna berbahasa Inggris secara eksklusif.
After installation, it's time for configuration, run from the command line: Setelah instalasi, saatnya untuk konfigurasi, jalankan dari baris perintah:
 squirrelmail-configure squirrelmail-configure 
This will present an interactive menu where all possible aspects of SquirrelMail can be configured. Hal ini akan menyajikan menu yang interaktif di mana semua aspek yang mungkin SquirrelMail dapat dikonfigurasi. Start with the bottom option, D. Set pre-defined settings for specific IMAP servers. Mulailah dengan opsi bawah, D. Set pre-pengaturan untuk server IMAP tertentu. This preloads some settings specifically for your IMAP server package. Ini preloads beberapa pengaturan khusus untuk paket server IMAP Anda.
Menu 1, Organisation Preferences, enables you to brand SquirrelMail with your own system name and logo. Menu 1, Organisasi Preferensi, memungkinkan Anda untuk merek SquirrelMail dengan nama sistem Anda sendiri dan logo. Menu 2, Server Settings is for configuring the backends of your webmail. Menu 2, Server Settings adalah untuk mengkonfigurasi backends webmail Anda. The option "Domain" is the domain that is appended to your outgoing email. Opsi "Domain" adalah domain yang ditambahkan ke outgoing email. By default this is read from /etc/mailname . Secara default ini dibaca dari / etc / mailname.
Press A to configure your IMAP server. Tekan A untuk mengkonfigurasi server IMAP Anda. Changing the options "Authentication Type" and "TLS" will make the connection with your IMAP server more secure. Mengubah pilihan "Authentication Type" dan "TLS" akan membuat koneksi dengan server IMAP Anda lebih aman. However, this only makes sense when your IMAP server is not on localhost; encrypting traffic over the local interface is wasting processor cycles. Namun, ini hanya masuk akal ketika server IMAP Anda tidak berada di localhost; mengenkripsi lalu lintas melalui antarmuka lokal membuang-buang siklus prosesor. The option Server Software should already be set to to your IMAP server package when you loaded the predefined settings. Opsi Software Server harus sudah ditetapkan untuk ke server IMAP Anda paket bila Anda memasukkan pengaturan standar. Option B, SMTP settings, should not have to be changed in most cases. Pilihan B, pengaturan SMTP, seharusnya tidak harus diubah dalam kebanyakan kasus.
Menu 3 Folder Defaults can safely be left untouched. Menu 3 Folder Defaults dapat dengan aman tidak disentuh. Under 4, General Options, you can make some tweaks. Kurang dari 4, Jenderal Pilihan, Anda dapat membuat beberapa tweak. Be sure to set option 11, allow server-side sorting. This greatly improves SquirrelMail performance and works with nearly all IMAP servers. Pastikan untuk mengeset opsi 11, memungkinkan menyortir sisi server. SquirrelMail ini sangat meningkatkan kinerja dan bekerja dengan hampir semua server IMAP. Feel free to look around the configuration options. Jangan ragu untuk melihat-lihat opsi-opsi konfigurasi. I'd advise not to enable any plugins until you've verified that your current setup actually works. Aku tidak menyarankan untuk mengaktifkan plugin apapun sampai Anda sudah memverifikasi bahwa Anda setup saat ini benar-benar bekerja. Once it does, you can add plugins. Setelah itu terjadi, Anda dapat menambahkan plugin. If something breaks, you'll know which plugin to blame. Jika sesuatu istirahat, Anda akan mengetahui plugin untuk menyalahkan.
Press S to save and Q to quit. Tekan S untuk menyimpan dan Q untuk keluar. Under /etc/squirrelmail you'll also find some configuration files for plugins and the file default_pref where you can set default preferences for new users. Bawah / etc / squirrelmail Anda juga akan menemukan beberapa file konfigurasi untuk plugin dan file default_pref di mana Anda dapat mengatur preferensi default untuk pengguna baru.
Now to make the install web-accessible. Sekarang untuk membuat web-install diakses. With the configuration files you'll find an Apache configuration snippet you can edit and add to your Apache config. Dengan file-file konfigurasi Anda akan menemukan potongan konfigurasi Apache Anda dapat mengedit dan menambah konfigurasi Apache Anda. It's wise to add it to the configuration of Apache-SSL aswell, so your users can access their mailbox over a secure connection. Itu bijaksana untuk menambahkannya ke konfigurasi dari Apache-SSL juga, sehingga pengguna Anda dapat mengakses kotak surat mereka melalui sambungan aman. After that, reload Apache. Setelah itu, reload Apache. We should be done! Kita harus dilakukan!
Now go to https://webmail.example.com/src/configtest.php (if you configured SquirrelMail at the webmail.example.com virtual host). Sekarang, masuklah ke https: / / webmail.example.com / src / configtest.php (jika Anda dikonfigurasi webmail.example.com SquirrelMail di virtual host). If this configuration test doesn't turn up any errors, proceed to https://webmail.example.com. You will be presented with a login screen. Jika tes konfigurasi ini tidak muncul kesalahan, lanjutkan ke https: / / webmail.example.com. Anda akan dihadapkan dengan layar login. Enter your username and password (the same as your system login). Masukkan username dan password anda (sama dengan sistem anda login). If all went fine you should see your mailbox! Jika semua berjalan baik-baik saja Anda akan melihat kotak surat Anda!
If it does not work, check whether your browser has cookies enabled. Jika tidak bekerja, periksa apakah browser Anda cookie diaktifkan. Also verify whether your IMAP server is working correctly (in its logs, and/or with a regular IMAP mail client). Juga memverifikasi apakah server IMAP Anda bekerja dengan benar (dalam log, dan / atau dengan klien email IMAP biasa). You can also check your webserver logs for any error messages. Anda juga dapat memeriksa log server Web Anda untuk pesan kesalahan.
Postfix is an attempt to provide an alternative to the widely-used Sendmail program. Postfix attempts to be fast, easy to administer, and hopefully secure, while at the same time being sendmail compatible enough to not upset your users.
Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It’s fast, simple to set up, requires no special administration and it uses very little memory.
When sending mail, the Postfix SMTP client can look up the remote SMTP server hostname or destination domain (the address right-hand part) in a SASL password table, and if a username/password is found, it will use that username and password to authenticate to the remote SMTP server. And as of version 2.3, Postfix can be configured to search its SASL password table by the sender email address.
SquirrelMail is a standards-based webmail package written in PHP. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages render in pure HTML 4.0 (with no JavaScript required) for maximum compatibility across browsers. It has very few requirements and is very easy to configure and install. SquirrelMail has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation.
Note : If you install Postfix/Dovecot mail server you will ONLY be able to send mail within your network. You can only send mail externally if you install SASL authentication with TLS. As otherwise you get “Relay Access Denied” error.
Install Postfix MTA (Mail Transfer Agent)
Use the following command to install postfix in debian
#aptitude install postfix postfix-tls libsasl2 sasl2-bin libsasl2-modules popa3d
During installation, postfix will ask for few questions like name of server and answer those questions by entering your domain name and select Internet site for postfix.
Postfix configuration file is located at:/etc/postfix/main.cf. You can edit this file using popular text editor vi /etc/postfix/main.cf
Restart Postfix Server using the following command
#/etc/init.d/postfix restart
Install Dovecot
Dovecot is POP3/IMAP server which needs MTA like Postfix to work properly.
#aptitude install dovecot-imapd dovecot-pop3d dovecot-common
Dovecot configuration file is located at: /etc/dovecot/dovecot.conf
Before we proceed we need to make some changes with dovecot configuration file. Double check the following entries in the file if the values are entered properly.
Edit the dovecot configuration file using the following command
#vi /etc/dovecot/dovecot.conf
# specify protocols = imap imaps pop3 pop3s
protocols = pop3 imap
# uncomment this and change to no.
disable_plaintext_auth = no
pop3_uidl_format = %08Xu%08Xv

Now, create a user to test our pop3 mail with outlook:
#adduser user_name
Note: Always create a separate user to test your mail or ftp.
Restart Dovecot using the following command
#/etc/init.d/dovecot restart
Now, you can use your outlook express to test whether your new mail server is working or not. Just enter username: with password in outlook.
Remember you will NOT be able to send email outside your network, you will be only be able to send within your domain or local network. If you attempt to send email you get “relay access denied” error from outlook express. However, you should have no problems in receiving your email from outlook. Inorder to send email external email you will need to configure SASL authentication as described below.
Configure SASL Authentication with TLS
SASL Configuration + TLS (Simple authentication security layer with transport layer security) used mainly to authenticate users before sending email to external server, thus restricting relay access. If your relay server is kept open, then spammers could use your mail server to send spam. It is very essential to protect your mail server from misuse.
Let us set up SMTP authentication for our users with postfix and dovecot.
Edit the postfix configuration file /etc/postfix/main.cf and enter the few lines to enable authentication of our users
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = yourdomain.com
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options = noanonymous

postfix does a chroot so it can’t communicate with saslauthd.
#rm -r /var/run/saslauthd/
#mkdir -p /var/spool/postfix/var/run/saslauthd
#ln -s /var/spool/postfix/var/run/saslauthd /var/run
#chgrp sasl /var/spool/postfix/var/run/saslauthd
#adduser postfix sasl
On the Dovecot side you also need to specify the dovecot authentication daemon socket. In this case we specify an absolute pathname. Refer to this postfix manual here
Edit /etc/dovecot/dovecot.conf file
#vi /etc/dovecot/dovecot.conf
Look for the line that starts with auth default, before that insert the lines below.
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}

}
}
Now, rename previous auth default to auth default2. If you dont rename this then dovecot server will give you error like multiple instances of auth default.
Now restart all the following components of mail server
#/etc/init.d/saslauthd restart
#/etc/init.d/postfix restart
#/etc/init.d/dovecot restart
Test whether your mail server works or not with your outlook express. Configure a user with a user name (without @domain) and make sure that you select my server requires authentication. Under settings select same as incoming mail server
Note:
1. If you dont enable My server requires authentication in outlook you cannot send emails to external recipients and you get relay access denied error.
2. Do not use root login to login to your mail server.
3. Dont forget to create a new user before you authenticate using outlook.

Forwarding Mails
Ever wondered how to forward your mails especially if you are a webmaster managing number of sites. You might need to forward any email sent to your primary email address. Its that easy. Just create a .forward file on your home directory. Insert list of emails addresses separated by commas, where you want to get forwarded.
Login as user and type
echo ‘destination_email_address’ > .forward
or you can use vi to create .forward file. Just Delete .forward file if you dont want any forwarding.

Installing Squirrel Web Mail
Before installing Squirrel Web Mail you need to make sure you have installed apache2 with php support
#aptitude install apache2
#aptitude install libapache2-mod-php5 php5-cli php5-common php5-cgi
#aptitude install squirrelmail
Squirrelmail configuration file is located in: /etc/squirrelmail/ folder. By default all settings are preloaded.
# Run squirrelmail configuration utility as ROOT
/usr/sbin/squirrelmail-configure

Now we want to setup to run under apache. Edit apache configuration file /etc/apache2/apache2.conf and insert the following line
Include /etc/squirrelmail/apache.conf
Restart the webserver using the following command
#/etc/init.d/apache2 restart
Access your webmail using the following link
http://yourdomain or server ip/squirrelmail
Create a separate local user and login as a new user.
Mail Server Logs
Always refer to logs located in /var/log/mail.log so that you can identify what the problem is before you can troubleshoot.


Tidak ada komentar:

Posting Komentar