SquirrelMail: Installation on Ubuntu 16.04 (en)

From OnnoWiki
Revision as of 07:02, 4 January 2025 by Onnowpurbo (talk | contribs) (Created page with "'''WARNING:''' Squirrelmail has issues with PHP 7.0. Downgrade to PHP 5.6 Set up POP3, IMAP & SMTP Server ==Set Up Additional Repo== sudo add-apt-repositor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WARNING: Squirrelmail has issues with PHP 7.0. Downgrade to PHP 5.6

Set up POP3, IMAP & SMTP Server

Set Up Additional Repo

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Ubuntu 16.04

sudo locale-gen id_ID.UTF-8

apt-get install apache2 php7.0 php7.0-xmlrpc php7.0-mysql php7.0-gd php7.0-cli \
php7.0-curl mysql-client mysql-server dovecot-common dovecot-imapd \
dovecot-pop3d postfix squirrelmail squirrelmail-decode php7.0 php5.6 \
php5.6-mysql php-gettext php5.6-mbstring php-mbstring php7.0-mbstring \
php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0

Downgrade to php5:

sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

Inform Apache about the presence of squirrelmail:

sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf

Edit the file /etc/apache2/sites-available/squirrelmail.conf:

vi /etc/apache2/sites-available/squirrelmail.conf

#users will prefer a simple URL like http://webmail.example.com
<VirtualHost *:80>
  DocumentRoot /usr/share/squirrelmail
  ServerName example.com
</VirtualHost>

Enable squirrelmail:

sudo a2ensite squirrelmail.conf

SquirrelMail Configuration

Configure Domain Squirrelmail:

/usr/sbin/squirrelmail-configure
2 -> 1 -> domain.id -> S -> Q

For Ubuntu version 11.10 and above, edit Dovecot configuration:

vi /etc/dovecot/conf.d/10-mail.conf

mail_location = mbox:~/mail:INBOX=/var/mail/%u

Restart Server in Ubuntu 14.04:

service dovecot restart
/etc/init.d/apache2 restart
/etc/init.d/postfix restart

Webmail can be accessed through:

http://ip-address-server/squirrelmail

SMTP Postfix Configuration

Ideally, the SMTP Server Postfix should be informed about the domain, relayhost, and local IP:

vi /etc/postfix/main.cf
mydestination = school, localhost.localdomain, localhost, school.sch.id
relayhost = smtp.telkom.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/16

Fetching Emails to INBOX

Send email using telnet to port 25:

telnet localhost 25

helo test.com
mail from: <test@test.com>
rcpt to: <user@domain.com>
data
From: <test@test.com>
To: <user@domain.com>
Subject: test

test 

.

quit

Replace user@domain.com with the email you created. For example, victim.com:

telnet localhost 25

helo test.com
mail from: <test@test.com>
rcpt to: <onno@victim.com>
data
From: <test@test.com>
To: <onno@victim.com>
Subject: test

test

.

quit

Error

IPv6 Problem

If there is an issue with IPv6 add to main.cf:

inet_protocols = ipv4

References

Interesting Links