SquirrelMail: Installation (en)
Set up POP3, IMAP & SMTP Server
Ubuntu 16.04
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
Inform Apache about the presence of SquirrelMail:
cp /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf
Older Ubuntu
sudo locale-gen id_ID.UTF-8 apt-get install apache2 php5 php5-xmlrpc php5-mysql php5-gd php5-cli \ php5-curl mysql-client mysql-server dovecot-common dovecot-imapd \ dovecot-pop3d postfix squirrelmail squirrelmail-decode
Ensure Dovecot supports imap, usually the default is okay:
vi /etc/dovecot/dovecot.conf protocols = imap pop3
Inform Apache about the presence of Squirrelmail:
cp /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf
For Ubuntu 14.04 use:
cp /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf
SquirrelMail Configuration
Configure Domain Squirrelmail:
/usr/sbin/squirrelmail-configure 2 -> 1 -> domain.id -> S -> Q
For Ubuntu version 11.04, edit Dovecot configuration:
vi /etc/dovecot/dovecot.conf mail_location = mbox:~/mail:INBOX=/var/mail/%u
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:
/etc/init.d/dovecot restart /etc/init.d/apache2 restart /etc/init.d/postfix restart
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 email 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
Error Syslog
In Ubuntu 11.10, if you encounter an error like:
ERROR: Could not complete request. Query: SELECT "INBOX" Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information. [2012-03-12 11:21:18]
Possible cause:
syslog:Mar 12 11:21:18 ServerTIK dovecot: imap(username): Error: mkdir(/home/username/mail/.imap/INBOX) failed: Operation not permitted
SOLUTION:
Perform:
apt-get install mailutils mail username
For username do:
mkdir /home/username/mail mkdir /home/username/mail/.imap touch /home/username/mail/.imap/INBOX chown username.username /home/username/mail/
IPv6 Problem
If there is an issue with IPv6 add to main.cf:
inet_protocols = ipv4
Several Squirrelmail Screen Captures
References
- http://www.squirrelmail.org/plugins.php
- http://ubuntuforums.org/showthread.php?t=1149842 - User Self Registration