Email Server on Raspberry Pi - CloudCommandos/JohnChan GitHub Wiki

Welcome to John Chan's journey in figuring out how to set up an email server on a Raspberry Pi!

04-09-2018

Used raspi-config to set up keyboard layout for Raspberry Pi.

Set up Raspberry Pi Wireless Connection

Enabling “predictable network interface names” under raspi-config causes interface name to incorporate MAC address. For the sake of following tutorials, “predictable network interface names” is not enabled so that interfaces have generic names (wlan0, eth0 …). Set up wlan0 as dhcp with ssid and password inside “/etc/network/interfaces”.

Set up Raspberry Pi Ethernet Connection

Set up eth0 as static with ip address and netmask inside “/etc/network/interfaces”.

Attempt to Set up Email Server using Citadel

Do not install citadel-suite and pick apache2 as server if apache2 is not set up yet! Otherwise it will cause the setup process to hang. running

dpkg --configure -a

does not solve the problem. Unable to use apt-get because dpkg must be fixed first. Restoring of system is deemed necessary.

05-09-2018

Reformatted Raspberry Pi memory card to solve the citadel-suite installation issue. Set up Wireless and Ethernet connections again.

Attempt to Set up Email Server using Postfix and Dovecot

Set up Email Server using Postfix and Dovecot following the tutorial on https://samhobbs.co.uk/raspberry-pi-email-server. Postfix is an open source mail transfer agent (MTA) for email sending and receiving. Dovecot is an open source IMAP/POP3 server. Stuck at setting Router Port Forwarding because there is no router available for experimentation.

16-09-2018

Found new online resources for setting up email server:

  1. https://habilisbest.com/raspberry-pi-as-personal-email-server.
  2. https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot

Found out that Raspberry Pi can't send out emails when connected to router at home. Emails can be sent out when connected to internet via mobile hotspot. Suspect that router is blocking outgoing mails on port 25. Online resources suggest that port 587 should work fine with TLS.

21-09-2018

Followed Young Ee's wiki (https://github.com/CloudCommandos/Raspclouds/wiki/Email-Server-on-Raspberry-Pi) up till "Installing Dovecot" section, but still can't receive emails. (24-09-2018: Pending re-evaluation due to syntax error)

22-09-2018

Decided to set up squirrelmail anyway.

wget -qO- https://netix.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz | tar xz -C /var/www/html/sqmail --strip-components 1 && chown -R www-data /var/www/html/sqmail

Also create directories "/var/local/squirrelmail/data/" and "/var/local/squirrelmail/attach/" or according to the squirrel mail settings. Squirrel mail can be configured with /var/www/html/sqmail/config/conf.pl

Port forwarding is configured on router for port 80 so that apache server of Raspberry Pi is accessible by the public through www.commandocloudlet.com. Squirrelmail is accessible at http://commandocloudlet.com/sqmail.

Current Status

Only outgoing email can be succesfully sent with mobile hotspot. Still working on sending and receiving email via router connection. Followed Young Ee's wiki (21-09-2018) but to no avail. Squirrel mail is set up and accessible through public domain http://commandocloudlet.com/sqmail.