SuperMike
February 6th, 2008, 10:59 PM
If you're doing web development testing and need to bring up a quick and dirty local POP/IMAP/SMTP mail server on Ubuntu, here's what I figured out. Following these instructions, you can bring up a working local mail server on Ubuntu in under 1 minute. It's not 100% secure like other mail servers, and it's with an unsupported product, but hey, it's great for testing your web applications out as a web developer.
sudo apt-get update
sudo apt-get install hula*
sudo hulasetup --domain=localhost
sudo /etc/init.d/hula start
Connect to: http://localhost:89/ for the web admin interface.
Login is admin/hula.
Create a new user under Context by clicking it and then clicking Create in the bottom right-hand corner. Choose User, then fill in the required fields. Don't create an OU to contain your users because I tried and I don't think it works.
Connect to http://localhost:8080/ for the webmail interface. Login as your new user and password. It should load okay. Note the inbox doesn't dynamically refresh and you have to wait a bit on messages and then click Refresh. Takes about 30 seconds for a sent message to appear for some unknown reason.
Your email address is the user ID you created + "@" + hostname. So, if I'm "supermike", and my computer is named "powerful", my email address is "supermike@powerful". Note I don't have a ".com" on the end because I didn't name my computer "powerful.com".
For POP and SMTP connectivity from Thunderbird, note that I couldn't get POP to work, so I used IMAP. Go with anything you want in the Account Wizard except Email Address should be as stated in the last paragraph, like "supermike@powerful", choose IMAP, Incoming Server is localhost, then OK, OK, on everything else. Change your Outgoing SMTP Server to localhost, port 25, set the username to your username for the account you created in Hula (like "supermike"), and check TLS, if available. Click OK, OK, and now you can send and receive email addressed to user@host ("supermike@powerful" in my case). When you read or send messages, the password it wants is the one you created on the user account in Hula.
If you ever need to stop HulaMail, do 'sudo hulastop'. If you need to start it, do 'sudo /etc/init.d/hula start'
Note that this mail server requires SMTP Authentication with that user's user account, so the ordinary PHP mail() function from your code won't work. Instead, if you're handy with base64_encode and SMTP auth and socket communication, you can go that route. Otherwise, you can use phpmailer, PEAR Mailer, or some other kind of mail class on the web.
Enjoy!
sudo apt-get update
sudo apt-get install hula*
sudo hulasetup --domain=localhost
sudo /etc/init.d/hula start
Connect to: http://localhost:89/ for the web admin interface.
Login is admin/hula.
Create a new user under Context by clicking it and then clicking Create in the bottom right-hand corner. Choose User, then fill in the required fields. Don't create an OU to contain your users because I tried and I don't think it works.
Connect to http://localhost:8080/ for the webmail interface. Login as your new user and password. It should load okay. Note the inbox doesn't dynamically refresh and you have to wait a bit on messages and then click Refresh. Takes about 30 seconds for a sent message to appear for some unknown reason.
Your email address is the user ID you created + "@" + hostname. So, if I'm "supermike", and my computer is named "powerful", my email address is "supermike@powerful". Note I don't have a ".com" on the end because I didn't name my computer "powerful.com".
For POP and SMTP connectivity from Thunderbird, note that I couldn't get POP to work, so I used IMAP. Go with anything you want in the Account Wizard except Email Address should be as stated in the last paragraph, like "supermike@powerful", choose IMAP, Incoming Server is localhost, then OK, OK, on everything else. Change your Outgoing SMTP Server to localhost, port 25, set the username to your username for the account you created in Hula (like "supermike"), and check TLS, if available. Click OK, OK, and now you can send and receive email addressed to user@host ("supermike@powerful" in my case). When you read or send messages, the password it wants is the one you created on the user account in Hula.
If you ever need to stop HulaMail, do 'sudo hulastop'. If you need to start it, do 'sudo /etc/init.d/hula start'
Note that this mail server requires SMTP Authentication with that user's user account, so the ordinary PHP mail() function from your code won't work. Instead, if you're handy with base64_encode and SMTP auth and socket communication, you can go that route. Otherwise, you can use phpmailer, PEAR Mailer, or some other kind of mail class on the web.
Enjoy!