SquirrelMail is an open source standards-based webmail package written in PHP. When installed, SquirrelMail is ready out of the box. All it needs is an installed web server like Apache, SMTP server like Postfix, and IMAP server like Dovecot.
Here are the installation guides for Postfix and Dovecot.
Starting the Web Server

1. If you did not add Web Server and squirrelmail during installation, you can add it now. Using the Package Manager tool, add the Web Server package in the Servers category. Also add the optional package squirrelmail located in the Mail Server package under the category Servers.
2. Start the httpd service. Learn how to start and stop services here.Configuring SquirrelMail

1. From a Terminal window, type in /usr/share/squirrelmail/config/conf.pl and press Enter. This will launch the SquirrelMail Configuration utility.
If your Terminal window has a white background, make sure that the colors are off by looking for the command Turn color on. If the command is Turn color off, type in C and press Enter to turn the colors off. This will ensure that you will be able to read all of the text.
3. Type in 1 and press Enter to select the Domain menu. Type in your domain name and press Enter. Save your changes when you are done.
I recommend installing the Retrieve User Data plugin so the user’s name will appear whenever he or she sends an email in SquirrelMail.Testing SquirrelMail


1. Click the globe icon at the top near the System menu to launch the Firefox web browser.
If an error occurs, you probably did not install the Graphical Internet package. You can add it now using the Package Manager tool.

2. In the address box, type in http://localhost/webmail and press Enter. Type in a valid username and password and click Login.
If you encounter any problems, check the log file at /var/log/maillog.Relocating SquirrelMail into the domain root
By default, SquirrelMail is located in the /webmail of your domain. If you prefer to access SquirrelMail from the root of your domain, follow the steps below.


1. Create the file /etc/httpd/conf.d/sqroot.conf containing the lines below.
<VirtualHost *:80> DocumentRoot /usr/share/squirrelmail </VirtualHost>
If you are using SSL and you want to force users to use SSL, add the Redirect directive inside the VirtualHost section to redirect browsers to the secured version. See the example below.redirect permanent / https://mail.acme.local

2. Restart the httpd service. Learn how to restart services here.Related Pages
«« Previous: How to Setup SMTP Auth
Next: How to Configure the Firewall »»
Visit the forum to ask for help or to give a comment.
***
Posted on 4/23/2007 and last updated on 2/13/2010
Filed under CentOS 5 , Red Hat Enterprise Linux 5 , SquirrelMail







September 12th, 2007 at 2:33 am
what should i do so that those user using the email like yahoo, google and etc can send email to my localhost mail?
September 14th, 2007 at 3:10 pm
Here’s how they usually do it
1. They get a static internet address from an internet service provider.
2. They purchase a domain name like this one, “linux-mail.info”, from a domain name registrar.
3. They setup a dedicated machine available 24 hours a day 7 days a week to serve as the mail server. This machine is usually called “mail”. The machine name plus the purchased domain name will give you the fully qualified domain name (FQDN). Ex. “mail.linux-mail.info”. This site will help you setup this mail server using the best free and open source software.
4. They add an MX (Mail Exchange) record containing the static internet address and FQDN into the DNS (Domain Name System) database using a tool provided by the domain name registrar.
5. Finally, they register a reverse DNS for the static internet address and FQDN with the internet service provider. This is an anti-spam measure. Otherwise, some sites will not accept mail coming from your server.
That’s it. If this sounds too costly or too complicated and you really need your own email address, I suggest you get an email hosting service. This would be cheaper and will spare you a whole lot of trouble.
October 3rd, 2007 at 8:20 pm
The webmail is not working for me, I get:
Error connecting to IMAP server: localhost.
13 : Permission denied
What’s wrong?
October 6th, 2007 at 4:28 am
You probably did not disable SELinux. Leaving SELinux enabled causes a lot of problems including this one and disabling it does not make your system any less secure.
December 12th, 2007 at 6:05 am
Good reference for build linux as mail server.
I already setup my own family mail server use this manual. There is 1 more problem that i still cannot figure out with my webmail using squirrelmail ? How can the squirrelmail user change their password.
t.Q
December 13th, 2007 at 2:58 pm
Ok, I’ve added a SquirrelMail Change Password Howto.
January 14th, 2008 at 4:06 am
gr8 work u’ve share here .. i got my mail server ran with flying color
thanks for this detail tutorial .. work for me.
btw any chance that u update it to work with user registration. i couldn’t find it anywhere ..
March 17th, 2008 at 3:03 pm
ERROR:
ERROR: Connection dropped by IMAP server.
Query: CAPABILITY
i disabled firewall and SELinux..
Please help.. thnx…
March 17th, 2008 at 5:27 pm
I was able to replicate your problem by removing the write permission to the mailbox specified in mail_location. Please check the file /var/log/maillog, it will describe the exact problem. In my case, it showed
dovecot: chdir(/home/johndoe) failed with uid 500: Permission denied
March 18th, 2008 at 11:12 pm
I tried all of the walkthrough so far (from the “home” portion of this site.) I was able to send mail using telnet, and was able to send to outside addresses, but when I try to send mail to myself using squirrelmail (and only squirrelmail), nothing appears in my inbox. What can I do about this?
Info:
OS: Fedora Core 8
Machine: VMware v.6.0.2 virtual machine
Any insights would be appreciated…
Aaron Thompson
March 18th, 2008 at 11:27 pm
Please try out SquirrelMail again and post the last few lines of /var/log/maillog. The log might give us a clue on what the problem could be.
March 18th, 2008 at 11:44 pm
just somw help if one is running SELinux, that changes need to be made as SELinux blocks access
Need to run this command
setsebool -P httpd_can_network_connect=1
March 19th, 2008 at 1:00 am
Thank you for reminding me of the log. I have found the fix to the problem: the mydomain and myhostname variables were not defined in main.cf of postfix. The server was rejecting a connection to itself because it didn’t know what it was supposed to be accepting.
And for the record, I always disable SELinux, its features are not worth the trouble it causes.
Thanks for the suggestions!
Aaron Thompson
March 19th, 2008 at 10:01 am
my maillog
Mar 19 18:00:23 localhost dovecot: IMAP(lhan): Unknown client workaround: outlout-idle
Mar 19 18:00:23 localhost dovecot: child 6213 (imap) returned error 89
Mar 19 18:00:23 localhost dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
March 19th, 2008 at 11:54 am
outlout-idle should be outlook-idle in dovecot.conf
March 27th, 2008 at 12:41 pm
sir,
give me url to download the webmail server and Mail scanner
March 27th, 2008 at 6:54 pm
The link and instruction for MailScanner is found here. For the webmail server, I suggest you follow the above instructions because it will automatically download all the dependencies.
April 28th, 2008 at 1:10 am
Just need clarification. When setting up an email server, do we still need to run a DNS server (BIND, MyDNSConfig, etc.)? When you purchase a domain to registrars, don’t they give an MX record for you? Thank you so much..
April 28th, 2008 at 10:19 pm
No need, the registrars do provide an MX record.
April 28th, 2008 at 11:55 pm
Do I still need to contact the my registrar and ask for my control panel? Do I still need other informations or knowing my domain is enough. Thanks sir.
April 29th, 2008 at 12:02 am
Your registrar should provide you with a control panel. I have tried out HostMonster and Network Solution and both provided control panels.
April 29th, 2008 at 1:23 am
Our ISP is the one controlling our mx records. I just called a while ago and they said they are the one who will do the configuration. What should i tell them if i have this “mydomain.com” and i want to create another mail server which is named “anothermail.mydomain.com”
April 29th, 2008 at 2:23 am
Tell them exactly that, you want to create another mail server which is at anothermail.mydomain.com and give them the ip address of anothermail.mydomain.com
April 29th, 2008 at 2:52 am
Thanks for everything sir… This site is really great. You’ve provides tons of information that a newbie needs.
I think we should create a forum for this. Linux will become stronger if we will build one..
April 29th, 2008 at 6:58 am
One more thing sir. Is it necessary to syncronize the mx record that my registrar has given me to my actual host name? This is because my ISP has not given me the MX record that I am asking. I still can’t receive emails coming from Yahoo and Gmail. I think it is because of the MX record issue.
April 29th, 2008 at 7:04 am
Yes it should be synchronized. And a reverse DNS (ask your ISP about this) on the host name should be registered. Otherwise, your mail server might be flagged down as a spam server.
April 29th, 2008 at 7:10 am
I still don’t get a reply from my ISP regarding my problem. I can’t wait to sit down without doing anything. I am now installing MyDNSConfig and I am planning to create my own MX record. Is this possible setup?
April 29th, 2008 at 7:15 am
No, because you still have to go to your ISP and ask them relinquish control of your domain. Visit http://www.checkdns.net/quickcheckdomainf.aspx to get information about your domain.
April 29th, 2008 at 7:49 am
Everything works great except to my mail server.
Message:
Error connecting to mail server mail.mydomain.com [202.x.x.x] port 25: Connection Refused.
Some of your MX do not work properly.
April 29th, 2008 at 7:59 am
So that’s the problem. A lot of things may cause this.
1. Is the IP address correct
2. Is the firewall opened for SMTP port 25
3. Is Postfix running
Use the
Test Postfix step but this time, try it from outside your network. If all else fails, you have to resolve this issue with your ISP.
May 5th, 2008 at 9:46 am
Everything is working perfectly.. Thank you so much!
I am managing a small network, I use ISA server 2000. I can access squirrelmail if i use a public ip address. When I test it inside my proxy, the clients behind ISA, http://www.mydomain.com/webmail is no longer accessible.. What could be the problem? Same is through with Mozill Thunderbird, I can access my mail server if i use public ip address but when I access my mail behind ISA, my mail server is no accessible again, this is my second problem..
Thanks…
May 5th, 2008 at 9:54 am
Everything is already working fine.. Thanks a lot.
I am using ISA server, my clients inside my network can’t access http://www.mydomain.com/webmail. Everything is working fine if I use public IP Address.
May 5th, 2008 at 10:04 am
What could be the problem if squirrelmail is not accessible from clients inside ISA server?
May 11th, 2008 at 3:36 am
I need to set up a relay server. I have a fixed IP and currently my mail server is being hosted outside.
My question is, how do I configure my relay mail server to fetch emails from my main mail server? We want to store our mails in our own relay server.
Appreciate the help. Thanks.
May 12th, 2008 at 3:51 pm
This is a job for Fetchmail http://en.wikipedia.org/wiki/Fetchmail
June 27th, 2008 at 9:32 am
the apache server is not restarting and when i type the command:
service httpd restart
the result is
stopping httpd failed
starting httpd failed
and if i try to start the apache from the localhost also dont work
September 16th, 2008 at 10:35 am
ERROR:
ERROR: Connection dropped by IMAP server.
Query: CAPABILITY
i disabled firewall and SELinux..
Please help.. thnx…
September 19th, 2008 at 4:04 pm
deltazero:
The last line of the code:
DocumentRoot /usr/share/squirrelmail
Has an error….
it should be:
That will fix it.
September 19th, 2008 at 4:10 pm
well that didn’t come through.
change the last line of the “VIRTUALHOST” line of code in sqroot.conf to :
/VIRTUALHOST
inside the brackets
September 19th, 2008 at 9:44 pm
Hi Kevin,
You’re right. The screenshot was correct but the text was wrong. I’ve fixed the text, thanks for pointing that out.
September 23rd, 2008 at 1:57 pm
Hi Sukhvinder,
Please check /var/log/maillog, it should give more information regarding the problem.
October 27th, 2008 at 9:43 pm
sorry but i didnt find the sqroot.conf , inside the squirrelmail i have folders class, config,……
October 28th, 2008 at 12:38 am
Hi deltazero,
sqroot.conf really does not exist, you have to create it.
October 28th, 2008 at 3:37 pm
i need to know how to create it, and if u can send it by email.
October 28th, 2008 at 9:41 pm
You can create it using any text editor. Just save it as sqroot.conf in /etc/httpd/conf.d
November 15th, 2008 at 12:40 pm
Hello friends!
How r u all? I hope all r fine.
Now lets help me to create a mail account!
Understand the problem and if u can plz help me….
I’ve two mail server named: 1. mail.example.net, 2.mail1.example.net, these two are pop and smtp server also.
I’ve a domain named example.net and it’s our master server. we host more domain to our master server like example.org,example.com,quashem.com etc.
All server are world reknown web server. Now the administration require a mail account named info@quashem.com for particular http://www.quashem.com domain.we use for our mail –sendmail configuration…
I know it’s require an MX record to put but where and where I would changed I can’t understand. and How to create an account named info to the particular domain?
If any body understand the problem and know the solution plz help me to do that.
It’s require to continue my job otherwise…………??
With Thanks
Nabil
January 21st, 2009 at 10:41 am
Hi,
Thank you for this great setup guide its great.
I have a small problem which is that if i use squirrelemail the emails are received ok but also have an attachment of its self if i use pop it does not happen.
Thank you for any help
Paul
January 31st, 2009 at 5:38 am
Hi,
I created Mail server successfully by using this guide..It great work to put all together it really helpful..
I had one simple problem..Plz help me out..
Myhostname name=server.example.com
Mydomain = example.com
When i send mail form one user to another i’ll get recipient mail id as user@localhost.example.com instead of user@server.example.com
January 31st, 2009 at 10:57 am
Hi Mohan,
I don’t know why localhost is the default in your case but whether it is localhost or server both are wrong anyway because your email address should be user@example.com. To correct this, click Options and click Personal Information in SquirrelMail.
February 1st, 2009 at 11:18 pm
I head the same problem as Mohan, And found it was the default settings of Squirral Mail. You have to go into the SquirrelMail Configuration utility to change the default.
February 3rd, 2009 at 8:59 am
Hi,
Now its working fine…After changing mail id in Personal Information in SquirrelMail.But i need permanent solution for this in config file itself for new users…Is it possible plz help me yar…
February 3rd, 2009 at 10:00 am
Hi Mohan,
You can automate that. See Auto update squirrelmail personal information
February 4th, 2009 at 6:42 am
Thanks for ur kind & quick Reply…
February 12th, 2009 at 8:54 pm
Hi.
i see with my search to google
i see a a WORD With name “mx server”
What is it?
sorry
for it is not in This object
But im…
waiting>.>.>.>…
February 12th, 2009 at 10:01 pm
Hi mr.jake,
You probably landed here because I mentioned that in my comment, see #2. You can learn more about MX server from the link below
http://en.wikipedia.org/wiki/Mail_exchange_server
February 13th, 2009 at 8:43 am
Hi
sorry about That
Mr.Jake
February 25th, 2009 at 10:28 pm
Good day.
Thank you very much for your instructions! This has helped me very much with a complicated task.
I have followed your steps up until the SquirrelMail installation. In my setup I have two machines. One is strictly a mail server that is set up as you indicated. The other is our webserver that has Squirrelmail successfully installed on it. How do I point squirrelmail to use IMAP to send and retrieve emails from the mail server? They are both on the same network.
Thank you!
February 26th, 2009 at 12:41 am
Hi TheProf,
Type in
/usr/share/squirrelmail/config/conf.pl to launch the SquirrelMail Configuration tool and select menu #2 Server Settings
March 8th, 2009 at 11:49 am
I Think Atmail Is Beter Than SquirrelMail!
i see it very Easy To Use!
and have a good style
But No problem…
thank you…
March 8th, 2009 at 11:50 am
This Link To see Demo
http://demo.atmail.com/parse.php?file=html/english/xp/xp.html&frame=1
Great Right?
March 8th, 2009 at 2:03 pm
Hi mr.jake,
You’re right, it is nice
I’ll review this and see if it can be a suitable replacement for SquirrelMail. In this age of Ajax and .Net, SquirrelMail is showing its age. Thanks for this tip.
April 3rd, 2009 at 10:27 pm
hi i am ohidul
I like to know dns server configaration
but i don’t know please help me.
thanks, ohidul(ice.iu)
May 5th, 2009 at 2:42 pm
Hi all,
I set up the server like this tutorial says. The only prob I have is that I can’t send mails outside the local domain. What am I doing wrong ?
June 12th, 2009 at 9:15 pm
Hi, great tutorials you made here!
I have 2 questions please:
1. Can you please explain how to configure postfix/dovecot/squirrel to work in a multiple-domain environment?
2. Is it possible to have 2 or more same usernames with different domains (info@domain1.com, info@domain2.com etc.).
Thank you