Sunteți pe pagina 1din 5

Installing Citadel Email Server on Raspberry Pi

Before setting up the e-mail server, establish a static private IP address within your network for the
Raspberry Pi. A mail server is controlled via an IP address in the network, exactly like a website. In
order to always be accessible from all other e-mails servers, the server needs the same address
permanently.

In your local network, the Raspberry Pi mail server requires a static private IP address to manage
inbound and outbound e-mails at all times. However, since the Raspberry Pi is usually assigned only
one dynamic IP address in your local network, you issue one static IP address to the Raspberry Pi.
In order to change the local IP address of the Raspberry Pi, you first need to know the current
(dynamic) IP address. For example, when you’re on the desktop of the Raspbian operating system you
can use the mouse to hover over the internet icon which will then show you the IP address.
Setup a static IP address as outlined in Setting up an static IP address for Raspian Jessie.
Perform the set up in the terminal and update all installed packages with the following command
lines:
sudo apt-get update
sudo apt-get upgrade

Citadel is pre-configured so that IPv4 and IPv6 are set as the default transfer protocols. As soon as the
program detects that no IPv6 is online, the installation process is aborted. You can use this command to
activate the protocol
sudo modprobe ipv6

and then set up Citadel with the following command line:


sudo apt-get install citadel-suite.

As the software is installing, you’ll be prompted to set some settings. Here’s what you need to do:

• Leave the first screen with its defaults and select OK.

view
• On the next screen, select the internal method as a good authentication method.

view
• Set an administrative username, and on the next couple screens create and confirm a password
for it.

view
• Since this is going to be a dedicated e-mail server, select “internal”

view
• Leave the web port and ssl port screens as their defaults.

view
• Select your language, and once you click OK, it should finish installing.

view
When it’s done, you can start the program by typing this
sudo service citadel start

At this point, you can open up a web browser and type in your Pi’s static IP address and port number
(10.7.239.2:8008). It should bring up your citadel webmail server. However, if you try to login, you’ll
probably get an error.

view
This is because by default, Citadel binds itself to the IPv6 protocol, but we need to bind it to the IPv4
protocol. And to do that you need to run through setup again:

• Start the setup again


sudo /usr/lib/citadel-server/setup

• Again, make a username and password

view
• Leave the following screen as default

view
• Set the IPv4 protocol to 0.0.0.0 to bind Citadel to it

view
• Leave the rest of the screens as their defaults
• Restart the citadel service
sudo service citadel restart

Now you should be able to login!


If you explore the citadel software, you’ll see all the different features it could provide. While there’s a
lot of cool options we could configure, for this tutorial, we’re only focusing on the e-mail. At this point,
if you were to write an e-mail and try to send it, nothing would happen. This is because we haven’t told
citadel how to route it yet. So basically right now all we have is a mailbox in need of a mail truck to
route it. To figure out how to get it routed, we need to click on the “Administration” tab select “Edit
Site Wide Settings”. There are several tabs, but the SMTP, IMAP, and POP3 tabs are the different
routing protocols that we could configure. But for this tutorial, we’re only going to look at SMTP
(Simple Mail Transfer Protocol). Clicking on that tab, you’ll see all the different ports that SMTP could
use.
The first step is to make sure those ports are properly routed out to the internet. So the first stop is to
take a look at your router. To get to your router, open up a web browser, and in your address bar, type in
your base IP address. (ex. 10.0.0.2) It should prompt you for a username and password.

Now that your in your router, you want to look for an option called “Forwarding” or “Port
Forwarding”, which is often in the advanced settings. When you find it, you want to add your Pi’s IP
address and each of the port numbers to the router, and add the same outward facing port number to the
router so that any traffic sent to that port will then be forwarded to your Pi. Along with the SMTP ports,
also be sure to forward port 8008 for your webmail interface. Use this command to edit the port file:
sudo nano /etc/default/webcit
The forwarding should ensure that our traffic gets properly routed inside our network, but out in the
open web, email traffic requires a DNS or Domain Name System. Often you have to pay to have a
DNS assigned to your IP address, but I’m a cheap skate. So if you head over to www.no-ip.com, you’ll
see that they have a free DNS hosting option that you can sign up for. Mossel Bay Mesh Network -
Domain name: msbmesh.ddns.net.
Now if you were to type your IP address:8008 (10.7.239.2:8008) into a web browser, you should see
your webmail interface come up. If not, check your router to make sure port 8008 is properly
forwarded to your Pi.

The last step is to configure citadel using your new domain name. So go back to the “Administration”
option and select “Domain Names and Internet Mail Settings”. Under “Local Host Aliases”, type in
your new domain name and click “Add”. Then click back on “Administration” and select “Edit
Sitewide Administration”. Remove the node name, and add your domain name to the fully qualified
domain name textbox. Then save the changes, go back to administration one last time, and restart your
server.
Now it’s time to test it out! You should be able to send and recieve e-mail to anyone from your own
homemade e-mail server!. One thing to note is that 9 times out of 10 your e-mail will get filtered to
spam, so let your recipient know that and to add you to their safe senders list. From here you can add
stuff like spam filters, blacklists, new user registration, and tons of other features.

S-ar putea să vă placă și