- Prerequisites (Prasyarat)
-
Topologi Jaringan
Gambar Topologi Jaringan
-
Konfigurasi Server dan Client
Konfigurasi Server : -------------------------------------------------- - Sistem Operasi : Linux Debian (10/11) - IP Address NIC 1 : DHCP Internet - Gateway : DHCP Internet - Hostname : ns100 (Gantilah angka 100 dengan nomer absen anda masing-masing) - Domain : sekolah100.sch.id (Gantilah angka 100 dengan nomer absen anda masing-masing) - IP Address NIC 2 : 192.168.100.1/24 (Gantilah angka 100 dengan nomer absen anda masing-masing) Konfigurasi Client : -------------------------------------------------- - Sistem Operasi : Windows - IP Address : DHCP
-
-
Seting Server
- DHCP Server
Pastikan instalasi dan konfigurasi DHCP server sudah berjalan dengan baik
- DNS Server
Pastikan instalasi dan konfigurasi DNS server sudah berjalan dengan baik
- WEB Server
Pastikan instalasi dan konfigurasi WEB server sudah berjalan dengan baik
- DATABASE Server
Pastikan instalasi dan konfigurasi DATABASE server sudah berjalan dengan baik
-
Instalasi dan Konfigurasi MAIL Server
-
Update konfigurasi DNS Server (BIND)
Login sebagai user root
login as: root
This email address is being protected from spambots. You need JavaScript enabled to view it. .1's password: Linux ns100 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2022-02-09) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.Update konfigurasi BIND
Edit file zona domain (db.sekolah100)
root@ns100:~# nano /etc/bind/db.sekolah100 ; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA sekolah100.sch.id. root.sekolah100.sch.id. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns100.sekolah100.sch.id. @ IN MX 10 mail.sekolah100.sch.id. @ IN A 192.168.100.1 ;@ IN AAAA ::1 ns100 IN A 192.168.100.1 mail IN A 192.168.100.1 www IN CNAME sekolah100.sch.id.
Edit file zona reverse IP (db.192)
root@ns100:~# nano /etc/bind/db.192 ; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA sekolah100.sch.id. root.sekolah100.sch.id. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns100.sekolah100.sch.id. 1 IN PTR sekolah100.sch.id. 1 IN PTR mail.sekolah100.sch.id.
Restart service DNS
root@ns100:~# /etc/init.d/bind9 restart [ ok ] Restarting bind9 (via systemctl): bind9.service.
Uji perubahan konfigurasi BIND yang telah dilakukan menggunakan tool nslookup.
Ketik nslookup lalu tekan Enter
Ketik mail.sekolah100.sch.id lalu tekan Enter
Ketik 192.168.100.1 lalu tekan Enter
Ketik exit lalu tekan Enter untuk keluar dari tool nslookup
Pastikan hasilnya seperti berikut ini:root@ns100:~# nslookup > mail.sekolah100.sch.id Server: 127.0.0.1 Address: 127.0.0.1#53 Name: mail.sekolah100.sch.id Address: 192.168.100.1 > > 192.168.100.1 1.100.168.192.in-addr.arpa name = mail.sekolah100.sch.id. 1.100.168.192.in-addr.arpa name = sekolah100.sch.id. > > exit root@ns100:~#
-
Install paket Mail Server
root@ns100:~# apt install postfix dovecot-imapd dovecot-pop3d Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: dovecot-core libexttextcat-2.0-0 libexttextcat-data liblua5.3-0 libstemmer0d Suggested packages: dovecot-gssapi dovecot-ldap dovecot-lmtpd dovecot-lucene dovecot-managesieved dovecot-mysql dovecot-pgsql dovecot-sieve dovecot-solr dovecot-sqlite dovecot-submissiond ntp ufw procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite postfix-cdb mail-reader postfix-doc The following NEW packages will be installed: dovecot-core dovecot-imapd dovecot-pop3d libexttextcat-2.0-0 libexttextcat-data liblua5.3-0 libstemmer0d postfix 0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Need to get 8,025 kB of archives. After this operation, 19.3 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:2 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 libexttextcat-2.0-0 amd64 3.4.5-1 [15.9 kB] Get:3 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 liblua5.3-0 amd64 5.3.3-1.1 [120 kB] Processing triggers for rsyslog (8.1901.0-1) ... Processing triggers for systemd (241-7~deb10u8) ... Processing triggers for man-db (2.8.5-2) ... Processing triggers for libc-bin (2.28-10) ... Processing triggers for dovecot-core (1:2.3.4.1-5+deb10u6) ... root@ns100:~#
Tekan [Enter]
Gunakan tombol panah atas atau bawah untuk memilih Internet Site, kemudian gunakan tombol TAB untuk memilih [ok] lalu tekan [Enter]
Pastikan nama dari System mail name sesuai dengan aturan (FQDN)
Pilih [ok] lalu tekan [Enter]
-
Konfigurasi Postfix
root@ns100:~# dpkg-reconfigure postfix
Pilih [ok] lalu tekan [Enter]
Pilih Internet Site lalu tekan [Enter]
Pilih [ok] lalu tekan [Enter]
Pilih [ok] lalu tekan [Enter]
Pilih [ok] lalu tekan [Enter]
Pilih [No] lalu tekan [Enter]
Tambahkan atau tuliskan IP address 0.0.0.0/0 lalu pilih [ok] dan tekan [Enter]
Pilih [ok] lalu tekan [Enter]
Pilih [ok] lalu tekan [Enter]
Pilih ipv4 kemudian pilih [Ok] lalu tekan [Enter]
setting myorigin setting destinations: ns100.sekolah100.sch.id, ns100.sekolah100.sch.id, localhost.sekolah100.sch.id, , localhost setting relayhost: setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 0.0.0.0/0 setting mailbox_size_limit: 0 setting recipient_delimiter: + setting inet_interfaces: all setting inet_protocols: ipv4 WARNING: /etc/aliases exists, but does not have a root alias. Postfix (main.cf) is now set up with the changes above. If you need to make changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf(1). After modifying main.cf, be sure to run 'service postfix reload'. Running newaliases root@ns100:~#
Tambahkan home_mailbox = Maildir/ di baris paling akhir dari file main.cf
root@ns100:~# nano /etc/postfix/main.cf smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_un$ myhostname = ns100.sekolah100.sch.id alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = ns100.sekolah100.sch.id, ns100.sekolah100.sch.id, localhost.sek$ relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 0.0.0.0/0 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4 home_mailbox = Maildir/
Hilangkan tanda # pada baris listen = *
root@ns100:~# pico /etc/dovecot/dovecot.conf # A comma separated list of IPs or hosts where to listen in for connections. # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces. # If you want to specify non-default ports or anything more complex, # edit conf.d/master.conf. #listen = *, :: listen = * # Base directory where to store runtime data. #base_dir = /var/run/dovecot/
Ubah disable_palintext_auth dari yes menjadi no
root@ns100:~# nano /etc/dovecot/conf.d/10-auth.conf ## ## Authentication processes ## # Disable LOGIN command and all other plaintext authentications unless # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP # matches the local IP (ie. you're connecting from the same computer), the # connection is considered secure and plaintext authentication is allowed. # See also ssl=required setting. #disable_plaintext_auth = yes disable_plaintext_auth = no
Aktifkan lokasi atau letak direktori Mailbox
root@ns100:~# nano /etc/dovecot/conf.d/10-mail.conf # See doc/wiki/Variables.txt for full list. Some examples: # mail_location = maildir:~/Maildir # mail_location = maildir:~/Maildir # mail_location = mbox:~/mail:INBOX=/var/mail/%u # mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n # # mail_location = mbox:~/mail:INBOX=/var/mail/%u # If you need to set multiple mailbox locations or want to change default # namespace settings, you can do it by defining namespace sections.
Restart service postfix dan dovecot
root@ns100:~# /etc/init.d/postfix restart [ ok ] Restarting postfix (via systemctl): postfix.service. root@ns100:~# /etc/init.d/dovecot restart [ ok ] Restarting dovecot (via systemctl): dovecot.service.
Membuat atau menambahkan user untuk email
root@ns100:~# adduser haryadi Adding user `haryadi' ... Adding new group `haryadi' (1001) ... Adding new user `haryadi' (1001) with group `haryadi' ... Creating home directory `/home/haryadi' ... Copying files from `/etc/skel' ... New password: 123 Retype new password: 123 passwd: password updated successfully Changing the user information for haryadi Enter the new value, or press ENTER for the default Full Name []:Tekan [Enter] Room Number []:Tekan [Enter] Work Phone []:Tekan [Enter] Home Phone []:Tekan [Enter] Other []:Tekan [Enter] Is the information correct? [Y/n] y root@ns100:~#
root@ns100:~# adduser siswa100 Adding user `siswa100' ... Adding new group `siswa100' (1002) ... Adding new user `siswa100' (1002) with group `siswa100' ... Creating home directory `/home/siswa100' ... Copying files from `/etc/skel' ... New password: 123 Retype new password: 123 passwd: password updated successfully Changing the user information for siswa100 Enter the new value, or press ENTER for the default Full Name []:Tekan [Enter] Room Number []:Tekan [Enter] Work Phone []:Tekan [Enter] Home Phone []:Tekan [Enter] Other []:Tekan [Enter] Is the information correct? [Y/n] y root@ns100:~#
Aktifkan direktori Maildir
root@ns100:~# maildirmake.dovecot /etc/skel/Maildir
Restart service postfix dan dovecot
root@ns100:~# /etc/init.d/postfix restart [ ok ] Restarting postfix (via systemctl): postfix.service. root@ns100:~# /etc/init.d/dovecot restart [ ok ] Restarting dovecot (via systemctl): dovecot.service.
-
Pengujian di Server
Uji coba mengirim email dari user haryadi ke user siswa100
Ketik telnet localhost 25 tekan [Enter]
Ketik mail from: haryadi tekan [Enter]
Ketik rcpt to: siswa100 tekan [Enter]
Ketik data tekan [Enter]
Ketik testinggggggggggggg tekan [Enter]
Ketik . (titik) tekan [Enter]
Ketik quit tekan [Enter]root@ns100:~# telnet localhost 25 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 ns100.sekolah100.sch.id ESMTP Postfix (Debian/GNU) mail from: haryadi 250 2.1.0 Ok rcpt to: siswa100 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> testinggggggggggggg . 250 2.0.0 Ok: queued as 23463FFA72 quit 221 2.0.0 Bye Connection closed by foreign host. root@ns100:~#
Memeriksa kiriman email dari user haryadi ke user siswa100
Ketik telnet localhost 110 tekan [Enter]
Ketik user siswa100 tekan [Enter]
Ketik pass 123 tekan [Enter]
Ketik stat tekan [Enter]
Ketik retr 1 tekan [Enter]
Ketik quit tekan [Enter]root@ns100:~# telnet localhost 110 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. +OK Dovecot (Debian) ready. user siswa100 +OK pass 123 +OK Logged in. stat +OK 1 444 retr 1 +OK 444 octets Return-Path: <
This email address is being protected from spambots. You need JavaScript enabled to view it. > X-Original-To: siswa100 Delivered-To:This email address is being protected from spambots. You need JavaScript enabled to view it. Received: from localhost (localhost [127.0.0.1]) by ns100.sekolah100.sch.id (Postfix) with SMTP id 23463FFA72 for <siswa100>; Wed, 9 Feb 2022 11:18:20 +0700 (WIB) Message-Id: <This email address is being protected from spambots. You need JavaScript enabled to view it. > Date: Wed, 9 Feb 2022 11:18:20 +0700 (WIB) From:This email address is being protected from spambots. You need JavaScript enabled to view it. testinggggggggggggg . quit +OK Logging out. Connection closed by foreign host. root@ns100:~# -
Seting dan konfigurasi webmail Roundcube
Membuat database roundcube melalui phpMyAdmin
Instal webmail Roundcube
root@ns100:~# apt install roundcube Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: aspell aspell-en dbconfig-common fontconfig-config fonts-dejavu-core libaspell15 libfontconfig1 libgd3 libjbig0 libjpeg62-turbo libtiff5 libwebp6 libxpm4 libxslt1.1 php-auth-sasl php-gd php-intl php-mail-mime php-mbstring php-net-sieve php-net-smtp php-net-socket php-pear php-pspell php-xml php7.3-gd php7.3-intl php7.3-mbstring php7.3-pspell php7.3-xml roundcube-core roundcube-mysql Suggested packages: aspell-doc spellutils dbconfig-mysql | dbconfig-pgsql | dbconfig-sqlite | dbconfig-sqlite3 | dbconfig-no-thanks libgd-tools roundcube-plugins php-net-ldap2 php-crypt-gpg php-net-ldap3 The following NEW packages will be installed: aspell aspell-en dbconfig-common fontconfig-config fonts-dejavu-core libaspell15 libfontconfig1 libgd3 libjbig0 libjpeg62-turbo libtiff5 libwebp6 libxpm4 libxslt1.1 php-auth-sasl php-gd php-intl php-mail-mime php-mbstring php-net-sieve php-net-smtp php-net-socket php-pear php-pspell php-xml php7.3-gd php7.3-intl php7.3-mbstring php7.3-pspell php7.3-xml roundcube roundcube-core roundcube-mysql 0 upgraded, 33 newly installed, 0 to remove and 0 not upgraded. Need to get 7,557 kB of archives. After this operation, 28.6 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 dbconfig-common all 2.0.11+deb10u1 [599 kB] Get:2 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 libxslt1.1 amd64 1.1.32-2.2~deb10u1 [237 kB] Get:3 http://mirror.smkn1klaten.sch.id/debian-security buster/updates/main amd64 php7.3-xml amd64 7.3.31-1~deb10u1 [109 kB] Get:4 http://mirror.smkn1klaten.sch.id/debian buster/main amd64 php-xml all 2:7.3+69 [6,012 B]
aspell-autobuildhash: processing: en [en_CA-w_accents-only]. aspell-autobuildhash: processing: en [en_CA-wo_accents-only]. aspell-autobuildhash: processing: en [en_GB-ise-w_accents-only]. aspell-autobuildhash: processing: en [en_GB-ise-wo_accents-only]. aspell-autobuildhash: processing: en [en_GB-ize-w_accents-only]. aspell-autobuildhash: processing: en [en_GB-ize-wo_accents-only]. aspell-autobuildhash: processing: en [en_GB-variant_0]. aspell-autobuildhash: processing: en [en_GB-variant_1]. aspell-autobuildhash: processing: en [en_US-w_accents-only]. aspell-autobuildhash: processing: en [en_US-wo_accents-only]. root@ns100:~#
Lakukan perubahan pada file config.inc.php seperti berikut ini:
root@ns100:~# nano /etc/roundcube/config.inc.php // The IMAP host chosen to perform the log-in. // Leave blank to show a textbox at login, give a list of hosts // to display a pulldown menu or set one host as string. // To use SSL/TLS connection, enter hostname with prefix ssl:// or tls:// // Supported replacement variables: // %n - hostname ($_SERVER['SERVER_NAME']) // %t - hostname without the first part // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) // %s - domain name after the '@' from e-mail address provided at login screen // For example %n = mail.domain.tld, %t = domain.tld //$config['default_host'] = ''; $config['default_host'] = 'sekolah100.sch.id'; // SMTP server host (for sending mails). // Enter hostname with prefix tls:// to use STARTTLS, or use // prefix ssl:// to use the deprecated SSL over SMTP (aka SMTPS) // Supported replacement variables: // %h - user's IMAP hostname // %n - hostname ($_SERVER['SERVER_NAME']) // %t - hostname without the first part // %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part) // %z - IMAP domain (IMAP hostname without the first part) // For example %n = mail.domain.tld, %t = domain.tld //$config['smtp_server'] = 'localhost'; $config['smtp_server'] = 'sekolah100.sch.id'; // SMTP port (default is 25; use 587 for STARTTLS or 465 for the // deprecated SSL over SMTP (aka SMTPS)) $config['smtp_port'] = 25; // SMTP username (if required) if you use %u as the username Roundcube // will use the current username for login //$config['smtp_user'] = '%u'; $config['smtp_user'] = ''; // SMTP password (if required) if you use %p as the password Roundcube // will use the current user's password for login //$config['smtp_pass'] = '%p'; $config['smtp_pass'] = ''; // provide an URL where a user can get support for this Roundcube installation // PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
Seting Virtualhost untuk subdomain mail.sekolah100.sch.id
root@ns100:~# cd /etc/apache2/sites-available root@ns100:/etc/apache2/sites-available# cp 000-default.conf mail.conf
root@ns100:/etc/apache2/sites-available# nano mail.conf <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port t$ # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com #ServerAdmin webmaster@localhost #DocumentRoot /var/www/html ServerAdmin
This email address is being protected from spambots. You need JavaScript enabled to view it. ServerName mail.sekolah100.sch.id ServerAlias mail.sekolah100.sch.id DocumentRoot /var/lib/roundcube # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noetroot@ns100:/etc/apache2/sites-available# a2ensite mail.conf root@ns100:/etc/apache2/sites-available# /etc/init.d/apache2 restart [ ok ] Restarting apache2 (via systemctl): apache2.service. root@ns100:/etc/apache2/sites-available# /etc/init.d/postfix restart [ ok ] Restarting postfix (via systemctl): postfix.service. root@ns100:/etc/apache2/sites-available# /etc/init.d/dovecot restart [ ok ] Restarting dovecot (via systemctl): dovecot.service.
-
Pengujian di client
Buka browser kemudian ketikan alamat email mail.sekolah100.sch.id gunakan akun haryadi
Gbr.24 Halaman login webmail roundcube
Klik menu Compose untuk mengirim email ke user siswa100
Gbr.25 Tampilan halaman webmail roundcube
Langkah-langkah mengirim email pada webmail roundcube
- Pada kolom (To) isikan alamat penerima email dalam hal ini siswa100
- Pada kolom (Subject) isikan judul email
- Pada kolom (Save sent message) ketikkan isi email
- Klik menu (Send) untuk memproses pengiriman email ke akun siswa100
Gbr.26 Proses pengiriman email
Klik Logout untuk keluar dari halaman webmail roundcube
Gbr.27 menu logout webmail roundcube
Login kembali menggunakan akun siswa100
Gbr.28 login webmail roundcube
Setelah login maka muncul kiriman email dari user haryadi
Gbr.29 login dengan akun siswa100
User siswa100 membalasa kiriman email dari user haryadi menggunakan menu Reply
Gbr.30 Proses membalas kiriman email
Mengetikkan isi balasan email, kemudian mengirimkannya dengan klik menu Send
Gbr.31 isi menu reply webmail roundcube
Login kembali menggunakan user haryadi
Gbr.32 Halaman login webmail roundcube
Balasan email sudah muncul di Inbox
Gbr.33 halaman Inbox webmail roundcube
-
- Kesimpulan
Selamat! akhirnya kita telah belajar dan berhasil melakukan instalasi dan konfigurasi Mail Server menggunakan Roundcube.
Semoga bermanfaat
- DHCP Server
H. Instalasi dan Konfigurasi Mail Server
Hits: 283