Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Verbiage: Setup email server, front-ends, coding our own.

Chacham (981) writes | about 8 years ago

User Journal 2

Well, a friend and i decided to setup up his and my email system.

Well, a friend and i decided to setup up his and my email system.

For email, we're using Exim 4. For me, a rule rejects all email at the smtp level for the base domain, rewrites the envelope header ignoring the username, and puts the subdomain as the user. Between that and aliases, i have three subdomains where the email comes to the same email address, but the header (in the email, not the envelope) is not changed. For him, he expects a dot in the email address, and ignores the data after the dot.

For example, for me:

1) john.doe@example.com
2) john.doe@a.example.com
3) john.doe@b.example.com

Case 1 is ignored, case two gets sent to a@example.com, case 3 gets sent to b@example.com.

For him:

john.doe@example.com

gets sent to john@example.com.

In either case, the header can be used for identification. And that all works fine.

Next comes the server. We chose Cyrus because its supports virtual users, IMAP, and Sieve. It's documentation is basically non-existent, but it can be done with some effort.

For the front-end we tried SquirrelMail, Horde /Imp, and IlohaMail.org. We found them hard to use or inconsistent in design, but we're using SquirrelMail in the meanwhile.

So, we decided to write our own web front-end. We brainstormed this Sunday for an hour or so, and decided to make a read only version (at first). We'll use Ajax so we only update the apropriate parts of the page, the Yahoo! UI libraries so it looks nice, javascript all over the place for automation (and AJAX), and Perl with CPAN's libraries for IMAP and the like. We'll skip mod_perl for now, and do straight CGI unless there's a reason to use mod_perl.

We discussed password storing. A persistent IMAP connection may not make sense, though even if it did, storing the password seems optimal. Cookies are usually used, but we'd like to skip those. I despise cookies. (I also despise flash, but my despisal for Javascript has gone down since Netscape stopped crashing on me. :) ) Saving it in the session seems like not a good idea, and in the user's HTML page too. So, for a basic encryption scheme we decided to use a crypt key (bi-directional, one key) created by the server on a per session basis. The encrypted password is stored in the session, and the key is stored in the user's webpage.

So, the order is:

1) User connects.
2) Check username/password.
3) Create session key.
4) Create crypt key.
5) Encrypt password with key, store is session var.
6) Store session key in a HIDDEN HTML INPUT tag.
7) Store crypt key in a HIDDEN HTML INPUT tag.

This way, the password is stored, but is only in clear-text in memory. It's not bulletproof, but we think it'll do the job.

We hope to design it to use CSS, so it can be made pretty later. Being neither of us really knows it, however, we may not get it perfectly.

I had started Learning Perl (actually, i have the third edition) some time back, but stopped when the need dropped. I just picked it up again, and even put it in the (coveted) bathroom--where most reading gets done--replacing Daughters of England (temporarily, i'm sure!). Needless to say, i hope to be hacking out some Perl soon.

I actually am not sure if this whole thing will work out. But for now, i'm going to enjoy being "involved" in a project.

cancel ×

2 comments

Sorry! There are no comments related to the filter you selected.

Perlmonks (1)

IpalindromeI (515070) | about 8 years ago | (#16136844)

In case you don't know about it, check out Perlmonks [perlmonks.org] if you need any Perl help. One of the best Perl communities there is. If email is more your thing, there are also about a bajillion lists [cpan.org] , but I believe the beginner list [cpan.org] is the best for new Perl users asking for help. I've never used or read that list, but I hear the helpers are very friendly.

Re:Perlmonks (1)

Chacham (981) | about 8 years ago | (#16136903)

Thanx!
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>