Mail Server - Citadel

20 posts
by ghostfacesuk » Sat Jul 28, 2012 3:09 pm
Hello all,

This is my first post here! :D

So I bought myself a RPi just to play around with. Then after a few days of mucking around in Debian I decided to jump into the deep end...

So I read guide for setting up a mail server...

And decided to give it a go, the guide is very clear which was great for me so I am still a novice and was able to install and run Citadel (access Citadels webpage over network).

Then I read this guide to get the spam filter running...

Again pretty straight forward, however I had to use Vi to mod some stuff which wasn't so too bad.

Now this is where I hit a wall. After looking at all the options I didnt realise how much I had to consider when it come to setting up a mail server.

The plan
I wanted to setup mu RPi at home running 24/7 as a mail server. I know I do not have a static IP address so I was going to use something like DynDNS. Then I was going to purchase a domain name just for an email account and have it pointing to the DynDNS address.

The Problem
I don't fully understand what is required to get my server configured correctly (domain names, MX records, whats services to use, how to set it up).

So I would like to know if anyone has done something similar as I don't want to pay for a DynDNS service and pay for a domain name and not be able to use it as I intended.

Maybe you know a better way for me to do this? Also if anyone has used Citadel I would welcome some pointers when it comes to configuring the system.

Any feedback and information is always welcome. Thank you for your time and I look forward to your replies!
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by benthepoet » Sat Jul 28, 2012 8:38 pm
The basics of receiving e-mail for a domain actually aren't that complicated.If I want to receive mail for then I just need to setup my DNS A Record (Host) for to point to my mail server's external IP. The only time you need an MX record is when you want receive mail for but you want to point it to another IP (because may actually be pointing to your web server).

Not having a static IP isn't generally a problem, services like DynDNS and No-IP have clients you run on your server that will automatically check and update your DNS as your DNS changes.

If you're hosting out of your home, the only thing you need to keep in mind is that you'll need to setup port-forwarding on your router so any traffic bound for port 25 (SMTP) gets routed to your mail server's local IP (usually 192.168.x.x). Port 25 is the standard port that mail is sent and received on. Optionally if you wanted to access your e-mail with a client like Thunderbird over the internet, then you'd also need to forward port 143 (IMAP) so that the client can retrieve mail from the server. If you're just using the webmail interface though then you don't need to worry about this as that service resides on the mail server itself.

I'm working on writing up a tutorial for setting up the No-IP client on Debian, so that it will be a little clearer as to do what you have to do. Should be up sometime today or tomorrow.

Regarding Citadel, did you have any specific questions about administration?
Ben Hanna
Ducky Pond
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by ghostfacesuk » Sun Jul 29, 2012 12:40 am

Thank you for the detailed reply!

I was wanting to purchase a domain name like then have the mail that's sent to that address forwarded to my RPi (that's why I was asking about the MX records).

Thanks for the port information too, didn't think about that at the time.

Yeah a No-IP guide would be more than welcome, I'll look forward to reading / using it.
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by benthepoet » Sun Jul 29, 2012 3:40 am
I just published a quick tutorial on installing the No-IP client on Debian. I included some information also regarding commonly forwarded ports for certain servers.

Dynamic DNS with No-IP on Debian
Ben Hanna
Ducky Pond
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by mediamind » Sun Jul 29, 2012 11:59 am

Thanks for the tutorials. Have you tried running spamassassin and ClamAV with Citadel on the Pi? I'm curious to know if there's enough memory available...
Posts: 3
Joined: Wed Dec 28, 2011 8:26 pm
by ghostfacesuk » Sun Jul 29, 2012 4:17 pm
Hi Ben,

Thanks for the tutorial, again perfect even for a novice like me it was easy to do and follow.

Ive now signup up got No-IP and installed the client software on my RPi. After a reboot it appears to be in the service list.

I have also forwarded the relevent ports on my router.

So now I believe there is one step left... to configure the Citadel software. This at the moment is installed on my RPi with its default settings.

The question is do you have a guild for me to follow for my mail server completion? :D

Thanks again for your help!
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by benthepoet » Mon Jul 30, 2012 3:52 am
Given that IPs, domains, and ports should now be properly configured there's just a couple things you need to do to test out Citadel.

First in the Administration section you need to go to Domain name and Internet mail configuration. Here you need to add the domain you're using to both Local host aliases and Directory domains.

After that, back at the Administration section you should create a user if you haven't already. This user will receive mail using the address like so

Once that's all set, login as the user you just created and try sending an e-mail to external mail account you have (Hotmail, Yahoo, etc.). If the message successfully makes it there then you know the send portion is working correctly.

Then from that same external mail account send an e-mail to the user you just created. Wait a few minutes (despite popluar belief, e-mail is not always instantaneous). If it shows up in the user's Inbox on Citadel then that means you can successfully receive mail also.

If both of these tests are successful then your mail server is fully functional. Let me know if you run into any issues.
Ben Hanna
Ducky Pond
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by benthepoet » Mon Jul 30, 2012 5:15 am

I've done some tests and the Pi has enough RAM to run both spamassassin and ClamAV with Citadel. However, I'm not sure how it would perform under load. Unless you really need it, I'd actually recommend avoiding ClamAV though as tends to eat up a lot of RAM. Spamassassin is fine, though you'll probably want to pre-compile the spam rules to improve performance and reduce the max number of worker processes down to around 2 (this way it doesn't suck up all the RAM from spawning processes).
Ben Hanna
Ducky Pond
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by ghostfacesuk » Mon Jul 30, 2012 2:08 pm
Hi Ben,

Thanks for the information (again).

Soooooo close :P I can send and receive emails which is great! however when I send emails it says the sender is steve@raspberrypi which is not an address I can reply too...

However if I send an email to it works!

I noticed at the top when I create a new email it has a drop down menu in the from section, despite me putting in the information in the admin area it will not allow me to change it.

Any ideas?

Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by ghostfacesuk » Mon Jul 30, 2012 2:43 pm
Ah never mind I figured it out, had to add it to the user address book, there is an option in there 8-)

Thanks again for the help Ben, this has worked very well!
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by ghostfacesuk » Tue Jul 31, 2012 12:26 am
Ok I have ran into a problem with sending emails...

For some reason I can only send emails to my work email address (, that'll work every time.

When I send emails to or address it says its sent but I never receive the mail :/

I can however send from hotmail and yahoo to my citadel every time without fail... It's very odd.

Any ideas?
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by benthepoet » Tue Jul 31, 2012 1:00 am
I'd recommend checking your spam folder/settings on Yahoo/Hotmail. That's likely where it would be going.
Ben Hanna
Ducky Pond
Posts: 29
Joined: Sun Oct 02, 2011 5:36 am
Location: Traverse City, MI USA
by ghostfacesuk » Tue Jul 31, 2012 10:47 am

Yeah I checked the spam filter on both accounts but there wasn't anything. I wonder if its down to using a free domain name which may have been black listed?
Posts: 7
Joined: Sat Jul 28, 2012 2:52 pm
by BumBum » Sun Sep 02, 2012 8:11 am
hi guys,

i have citadel installed and have some problems with sending/receiving mails. i can send mails to my main gmail and yahoo accounts but other ones do not get mails. my smtp-outgoing in citadels always says: "DNS server returned answer with no data". als no rceiving emails on my mailserver in citadel at all. on my internet service provider i have just a domain with dynDNS activated.
of course i opened the main ports (attachement) and i am not able to solve my problem.
is there someone who could help me please ?

Bildschirmfoto 2012-09-02 um 09.49.35.png
Bildschirmfoto 2012-09-02 um 09.49.35.png (44.51 KiB) Viewed 11877 times
Posts: 5
Joined: Fri Aug 03, 2012 6:04 am
Location: Germany
by yozza » Sun Oct 28, 2012 10:21 pm
Just got Citadel working on my RPi, but strugging with retrieving mail from other servers. After I am logged on to the server and select Advanced -> Edit or delet thei room -> Remote Retrieval and type in my email account details I get the message displayed at two points "Unable to allocate the space required for /etc/citadel/netconfigs/8.20: No such file or directory".
This would appear to be linked to the install error which I ike others received making reference to /etc/citadel/netconfigs/7. These errors should not be unexpected as /etc/citadel/netconfigs does not exist!!
Anyone got any ideas how it should be created or what should be in it? & Citadel 8.14 with WebCit 8.14, server build 8.14 ,
Posts: 4
Joined: Sun Oct 28, 2012 9:07 pm
by yozza » Tue Oct 30, 2012 12:41 pm
Resolved, all I had to do was create netfolders and change owner and group to citadel, delete the folders I had put in there and then citadel was able to et up the retrieval correctly - sorted
Posts: 4
Joined: Sun Oct 28, 2012 9:07 pm
by blinxster » Mon Nov 05, 2012 6:24 pm
hi all.

I too have problems with netfolders and ownership.
Yozza could you elaborate on your solution? or anyone else on how to create these?

I am new to setting up web servers but have managed to send outgoing mail.

HELP Please :-s
I am having problems when it comes to incoming mail.
I am running an apache web server from my pi perfectly, and can access citadel through webcit on port 8054. Like I say, I can send mail from here without issues.

My pi hostname is set to server

within webcit I have set:
Administration>Edit site-wide configuration>NodeName to server

Administration>Edit site-wide configuration>FQDN to

Administration>DirectoryDomains to

Administration> LocalHostAliases to

Am I setting citadel up incorrectly?
Do I need to alter my mx records at, or is it ok as it is?
Also as I said at the start I am experiencing the same ownership issue as with yozza's post:
citserver[12938]: Failed to adjust ownership of: /etc/citadel/netconfigs/7 [No such file or directory]

Any help would be much appreciated.
Thanks in advance
Posts: 1
Joined: Mon Nov 05, 2012 6:05 pm
by JoeS » Tue Mar 05, 2013 9:32 pm
Hello, I'm trying to get access to my email acounts from my iPhone 5 and I'm having trouble. Everything is set up properly and works without fail for sending and receiving email through the web interface. But I can't get the iPhone configured to access it. I've looked for documentation, and all I can find is that it "can" do this, but not how. What have I missed? And how do I set up the Push notifications?
Posts: 1
Joined: Tue Mar 05, 2013 9:29 pm
Location: West Midlands U.K.
by markgresko » Wed May 14, 2014 5:39 pm

I have downloaded, installed and am currently running Citadel on my little Pi. I am able to receive email in to Citadel. However, I am unable to send email out. Whenever I try to send email, I get one or both of the following errors:
DNS server returned answer with no data, or,
Failed to create socket: Address family not supported by protocol

I believe I have port forwarding set up properly on my router, though I wouldn't rule out having missed a port. Does anyone have any ideas that might point me in the right direction to get this problem resolved?

Thank you in advance............
Posts: 12
Joined: Tue Jun 26, 2012 5:00 am
by minca » Thu Oct 23, 2014 9:35 am

I was using Citadel, but now I'm using Postfix+Dovecot:

everithing works great, but all mails I send to etc an Gmail end in SMAP.

I got my own domain.
I've also updated my DNS records with this TXT record spf1 ~all...

any help?

Posts: 1
Joined: Thu Oct 23, 2014 9:27 am