[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [exim/fetchmail] A day in the life of an email



Mark Phillips wrote:
> I am looking at setting up mail properly on my machine.  I have an email
> account at university and use ppp to gain dial-up access to uni.  I wish
> to set things up so that I can receive and send email from my local
> machine (rather than rlogin to a uni machine to read email as I do at the
> moment.)

It is nice to have both these options available to you.

> Please excuse my ignorance, but I am a bit unsure about what I must do and
> about exactly what happens with email.  Here is my current understanding
> of what the story is:
> 
> 1.  Email arrives at the mail server at uni with the address
> "mark@ist.flinders.edu.au" and is stored in a spool directory there.

True.

> 2.  I contact the mail server using fetchmail, asking it very nicely to
> remove the email from my spool directory there, and send it to my machine
> at home.  Fetchmail does this with the POP protocol.

You have to configure the politeness level in .fetchmailrc ;)

> 3.  Fetchmail feeds this email into some black box (I don't understand
> this bit - is it a file or is it a program that is sitting around waiting
> for such events???).  Exim somehow notices that there is email coming into
> this black box and stores this in /var/spool/exim/input.  Exim then looks
> and sees that the domain of the message is "ist.flinders.edu.au". 
> Fortunately this domain has been configured as the local domain in
> exim.conf so exim knows to distribute these messages to local users.  It
> then sees the user is "mark" and so knows to distribute this to "mark" on
> the local machine.  It moves the email from /var/spool/exim/input to
> /var/spool/mail/mark. 

This is not my understanding.  Fetchmail is the program that translates
between your university address and your local address.  You configure
this in your .fetchmailrc.

There is no black box.  Fetchmail communicates directly with exim thru
port 25 using the SMTP protocol.  Exim sees the mail as coming to your
local machine address/username.  Exim will periodically (or immediately, if
configured so) move your mail from the input spool to your
/var/spool/mail/mark directory.

> 4.  I then run a program such as "pine" which sees there is email in
> /var/spool/mail/mark and enables me to read it.  I have received my email.

True.  Although exim can be configured to further process the email
and sort it into mailboxes based on criteria you give, rather than just
dumping it into /var/spool/mail/mark.

> 5.  I then decide to send a message to fred@banana.com.  I compose an
> email in pine which puts the message in the "black box" talked about
> above.  Exim again somehow notices it and stores it in
> /var/spool/exim/input.  It sees that "banana.com" is not a local domain.
> It decides to forward the email to some "smarthost" configured in
> exim.conf.  What mechanism/protocol does it use to do this?  What should
> the smarthost be?  Should it be my home machine (I think not??).  Should
> it be the mail server at uni?  Anyway, somehow it passes the email on to
> some machine that somehow knows what it is doing and delivers the email.

As above, pine will communicate directly with port 25 or your local machine
and talk to exim.  Exim sees that the mail is not from the local
network, so it forwards it to the smarthost, which is your uni server.
Exim talks to the uni server thru the same SMTP port 25.

> 6.  I then send an email to "fred@ist.flinders.edu.au" who might be a
> friend at uni.  Again exim gets this email, but sees that the domain is
> "ist.flinders.edu.au".  I have configured this as a local domain so exim
> trys to deliver this to a local user.  But fred is not a local user on my
> home machine.  He is a user at uni.  I want this email forwarded on to the
> machine at uni.  How is this done?

Exim knows that ist.flinders.edu.au is not local, so it sends it to the
smarthost, which is the uni server.  The uni server knows to give it to
fred at that domain.

What you may be configuring exim to do is to pretend to be a member of
ist.flinders.edu.au in the headers of the email to prevent other servers
from rejecting your email for lack of a proper domain.

This will not confuse the uni server (at the same domain) becuase it _should_
be configured to accept mail from it's own domain.

> Well, I think this sums up the state of my knowledge or lack of knowledge.
> I would appreciate any clarifying comments/explanations/hints etc.

I would appreciate any clarifications of my understanding of it also.

-Mitch


Reply to: