E-mail client/server question from a recent convert

Hey drop us a line about the show. Feel free to ask questions, provide feedback and criticism, or just ramble on about anything your little heart desires.

Moderators: snarkout, Patrick, dann

Post Reply
User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

E-mail client/server question from a recent convert

Post by Mortuis » Tue Mar 28, 2006 1:49 pm

So far I've converted two computers to linux, one running Ubuntu Server, the other is an Ubuntu desktop. I currently use MS Outlook 2000 as my mail client, and would like to switch to a linux app instead. One thing I was wondering though, was if I could set up the server to download mail from a pop account, whatever ISP I happen to have at the time, and then use that as a sort of mail server so that I can access the mail on the server from any client computer. In theory, I'd like to be able to do this from any computer at home, or even from work.

There's lots of software out there, and I'm not familure with all the terminology, but it looks like fetchmail would do this for me. It looks like I can set it to download from a POP server, and then I can access the server from client computers with a mail client via IMAP. I guess I'm looking for confermation that I'm on the right path, and if there is a better way to go about what I'm trying to accomplish.

User avatar
Gomer_X
Posts: 901
Joined: Fri Jun 03, 2005 1:31 pm
Location: Cincinnati, Ohio, USA
Contact:

Re: E-mail client/server question from a recent convert

Post by Gomer_X » Tue Mar 28, 2006 2:14 pm

Mortuis wrote:There's lots of software out there, and I'm not familure with all the terminology, but it looks like fetchmail would do this for me. It looks like I can set it to download from a POP server, and then I can access the server from client computers with a mail client via IMAP. I guess I'm looking for confermation that I'm on the right path, and if there is a better way to go about what I'm trying to accomplish.
You are correct. Fetchmail connects to an IMAP or POP3 server and downloads your mail, then tosses it to sendmail, which delivers it to your account.

I found it dead simple to set up. It worked perfectly the first time. All you need is a .fetchmailrc in your home directory. It should look like this:

Code: Select all

poll pop.gmail.com proto POP3 
user 'boogerboy@gmail.com' there is 'mortuis' here pass xxxxxxx
Variables are mailserver and protocol on first line, email address and local username on second. xxxxxxx is your password, of course.

Just type 'fetchmail' and watch it run. Once you're sure it's working OK, you can do 'fetchmail -d 1000' which runs it in daemon mode, and does a run every 1000 seconds.

I found this to be useful for a fuller explanation.

User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

Post by Mortuis » Wed Mar 29, 2006 9:21 am

Thanks, now I know specifically what to read up on.

Just to make sure I understand correctly, fetchmail retrieves mail and inserts it into sendmails repository/database/whatever, and sendmail interacts with whatever client I use to access my e-mail?

What I'm confused about is when you say sendmail delivers it to my account. If I want to keep a copy of all messages I don't delete, is this done on the server end in sendmail, or does it have to be done on the client end? One thing I'm hoping to accomplish is have my e-mail stored in a central location, and just use the client to interact with my mail but to have everything be the same or as close as possable datawise whereever I am connecting from.

User avatar
snarkout
Site Admin
Posts: 1342
Joined: Tue Aug 16, 2005 9:35 pm

Post by snarkout » Wed Mar 29, 2006 9:47 am

Sounds like you want imap then - you can "leave a copy of message on the server" with pop, but this almost certainly bites you in the ass once in a while *because* it's controlled by the client rather than the server.
Shared pain is lessened, shared joy is increased; thus do we refute entropy.
--Spider Robinson

User avatar
Gomer_X
Posts: 901
Joined: Fri Jun 03, 2005 1:31 pm
Location: Cincinnati, Ohio, USA
Contact:

Post by Gomer_X » Wed Mar 29, 2006 10:03 am

Mortuis wrote:What I'm confused about is when you say sendmail delivers it to my account. If I want to keep a copy of all messages I don't delete, is this done on the server end in sendmail, or does it have to be done on the client end? One thing I'm hoping to accomplish is have my e-mail stored in a central location, and just use the client to interact with my mail but to have everything be the same or as close as possable datawise whereever I am connecting from.
Int the real (ie UNIX) world sendmail is running, listening on port 25 all the time. When a system gets mail for you, it connects to you on port 25 and dumps the mail to you. These days, our computers aren't mail servers. Instead we connect to the ISP and get our mail when we feel like it. Fetchmail was designed to fill this gap by getting your mail and passing it to sendmail to deliver locally.

What sendmail does is deliver mail to your box, which is usually in /var/spool/mail/$USERNAME. What I do is SSH into the box that runs fetchmail and read mail there with mutt. Alternatively you could set up nfs or samba or something similar and export your mail spool so you can access it anywhere on the LAN. Most mail clients can be set up to read a spool in mbox format, or even access your mail spool on another machine through SSH.

If you're wanting to read mail somewhere outside your LAN, you may want to leave mail on the server (at the ISP) and access it through POP from Thunderbird or Evolution (or mutt or Kmail).

There are (unfortunately) many options to choose from, but you should be able to do whatever you want.

User avatar
Mortuis
Posts: 37
Joined: Mon Oct 24, 2005 3:06 pm
Location: Salt Point, NY, USA
Contact:

Post by Mortuis » Wed Mar 29, 2006 3:37 pm

Thanks for the info.

I'm going about things this way becuase I don't want to use my ISP's mail server, I want to host my mail in my LAN on my server so that over time I can hoard all my e-mail in one place even if I switch ISP's or whatever, and still be able to access it from wherever. In a perfect world, I'd be able to port in my e-mail from outlook (my current mail repository) and Eudora (my old mail program) so that all my mail from forever is collected and accessable from one place, but I'm willing to settle with from here on only.

I am not shy of learning how things work and figuring out how to set things up, I just come to forums to receive direction on what to look up from people who understand linux since I'm still climbing the learning curve here and the amount of non-relavent information is overwhelming.

In my mind this means I need some mechanism that will get the mail onto my server, this seems to be fetchmail's job. The other part of the puzzle is a method of accessing the mail on the server from another computer, it sounds like sendmail has something to do with this, and I will have to use IMAP to keep it on the server. I was a little confused when you said sendmail delivers the mail though, because in my mind that implies that the e-mail doesn't live on the server, it just sits there until it gets pushed to another computer, which isn't what I want.

Although it'd be preferable to have a GUI application I could use to access my e-mail, at least from home, I have no problem learning how to use a terminal client while SSH'd into my server when I'm not home.

I understand that my descriptions are possably broken and it's difficult to understand what I am shooting for as I'm still learning how all this works. I appreciate all the help you've given me on the matter.

hellonorman
Posts: 267
Joined: Wed Dec 28, 2005 11:08 pm

Post by hellonorman » Thu Mar 30, 2006 9:48 am

Mortuis wrote: The other part of the puzzle is a method of accessing the mail on the server from another computer, it sounds like sendmail has something to do with this, and I will have to use IMAP to keep it on the server.
I don't believe sendmail will be involved in how you access your mail once it is on your machine. For that you could run an imap server such as courier-imap. Then any client would point to your imap server much the same way that your client used to point to your ISP's pop server. The beauty of imap is that all your mail is accessed on the server such that any client anywhere will always have an up to date view of your mail.

User avatar
Gomer_X
Posts: 901
Joined: Fri Jun 03, 2005 1:31 pm
Location: Cincinnati, Ohio, USA
Contact:

Post by Gomer_X » Thu Mar 30, 2006 10:25 am

Mortuis wrote:Thanks for the info.

I understand that my descriptions are possably broken and it's difficult to understand what I am shooting for as I'm still learning how all this works. I appreciate all the help you've given me on the matter.
Feel free to keep asking. I find that by far the best way to learn something is to explain it to somebody else.

I don't know much about serving IMAP on a LAN, but I'm starting to think this may be worth looking into. I can SSH in and use mutt from any computer, but my wife would look at me like I'm crazy if I suggested that. :D

User avatar
snarkout
Site Admin
Posts: 1342
Joined: Tue Aug 16, 2005 9:35 pm

Post by snarkout » Thu Mar 30, 2006 10:37 am

Also be aware that your ISP probably blocks a number of ports. This can be overcome by using non-standard ports, but it's something to keep in mind. To your ISPs mind, sending mail from your own mailserver is probably in violation of their AUP.
Shared pain is lessened, shared joy is increased; thus do we refute entropy.
--Spider Robinson

User avatar
Linc
Site Admin
Posts: 345
Joined: Mon Apr 26, 2004 11:54 pm
Contact:

Post by Linc » Thu Mar 30, 2006 3:42 pm

Gomer_X wrote:
Mortuis wrote:Thanks for the info.

I understand that my descriptions are possably broken and it's difficult to understand what I am shooting for as I'm still learning how all this works. I appreciate all the help you've given me on the matter.
Feel free to keep asking. I find that by far the best way to learn something is to explain it to somebody else.

I don't know much about serving IMAP on a LAN, but I'm starting to think this may be worth looking into. I can SSH in and use mutt from any computer, but my wife would look at me like I'm crazy if I suggested that. :D
Yeah guys, I actually use fetchmail and imap myself for all my different email addresses. It's a great thing to use and easy as pie to set up. Here's what I did:
I grabbed an old sparcstation, but any older computer will do, really. I installed debian on it and chose the server install and mail server. This, by default, installs almost everything you need. When it asks about your mail configuration, tell it that you are running just a local server (you'll be getting your mail via fetchmail).
The debian install should go very fast - less than half an hour easy. Then you'll need to install imap. This is just an apt-get away. Be forewarned that this uses ssl (a good thing but I was not expecting it). After that, the easy way is to set up accounts with the account name matching the account name of your email address. For instance 1 of my email addresses is linc.fessenden at gamil dot com, so I made an account called linc.fessenden. I then log into that account and make fetchmail get my mail from the gmail account via pop3 every so often. i do this with my other email accounts as well.
Now you *can* just as easilly tell fetchmail on one user to get email from many different accounts, but I find seperating things out by user makes it easy for me to keep track of what is coming in on what account, and I may want to use different smtp servers to respond on different accounts too.
OK, so now fetchmail os getting your mails for you and putting them into accounts on your imap server. Now you tell your mail clients to hit that server via imap (with ssl) to get your email to your email application. You then tell your email app that it needs to use the smtp address of your email provider for that account.
There you have it, you have a local imap email that follows you wherever you go in your house, and if you do as I did and poke a hole in your firewall for the imap port, you can access all your email accounts from your own server ans always have access to all your email no matter where you are.
-Linc Fessenden

In the Beginning there was nothing, which exploded - Yeah right...

Post Reply