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

1998-12-15 Thread Jiri Baum
Hello,

Just one minor comment, since others seem to be handling the query...

 Mark Phillips wrote:
...
  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???).
...
 There is no black box.  Fetchmail communicates directly with exim thru
 port 25 using the SMTP protocol.

Actually, there's another way you can hand a message to exim, and that is
by invoking it directly, as /usr/sbin/exim (or /usr/sbin/sendmail).

You can configure fetchmail to use either method.

BTW, you might need to configure exim to accept invalid sender addresses
from fetchmail, but I've forgotten how I did that.

  5.  I then decide to send a message to [EMAIL PROTECTED]  I compose an
  email in pine which puts the message in the black box talked about
  above.
...
 As above, pine will communicate directly with port 25 or your local
 machine and talk to exim. 

I would suspect that most programs would call /usr/sbin/sendmail, because
that's a lot easier to do. Certainly elm has that filename hard-coded into
it, and so does mutt.

/usr/sbin/sendmail is another name for exim, which then does whatever it's
supposed to with the message - typically, it'll either write it to
someone's mailbox, telnet 25 to another host, or write it into its private
area to deal with it later.


HTH

Jiri [EMAIL PROTECTED]


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

1998-12-10 Thread Mark Phillips
On Tue, 8 Dec 1998, Mike Touloumtzis wrote:

 3) Set qualify_domain = ist.flinders.edu.au to make your locally
generated mail appear to originate from that machine.  This is
potentially not necessary if ist.flinders.edu.au accepts mail
for *.flinders.edu.au and the MX records are set up correctly
in the DNS, but I don't think it can hurt.

Thanks for your help.  Things are almost working.  Only one problem at
the moment.  

Setting the qualify_domain to ist.flinders.edu.au works well at making my
email appear to originate from uni.  The only problem is when at home
I email to mark, the email ends up at my account at uni.  This is not
the desired behaviour.  mark is my local username and the email should
have been sent locally.  For some reason it is not.  I presume that
because I addressed the email to mark not to [EMAIL PROTECTED], it
decided to qualify it for me to [EMAIL PROTECTED].

Is there any way of getting it to make the from address appear to be
[EMAIL PROTECTED] while at the same time, allowing mark
to be completed as [EMAIL PROTECTED]?

Cheers,

Mark.

_/\___/~~\
/~~\_/~~\__/~~\__Mark_Phillips
/~~\_/[EMAIL PROTECTED]
/~~\HE___/~~\__/~~\APTAIN_
/~~\__/~~\
__
They told me I was gullible ... and I believed them! 



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

1998-12-10 Thread Mike Touloumtzis
On Thu, Dec 10, 1998 at 06:17:20PM +1030, Mark Phillips wrote:

 On Tue, 8 Dec 1998, Mike Touloumtzis wrote:
 
  3) Set qualify_domain = ist.flinders.edu.au to make your locally
 generated mail appear to originate from that machine.  This is
 potentially not necessary if ist.flinders.edu.au accepts mail
 for *.flinders.edu.au and the MX records are set up correctly
 in the DNS, but I don't think it can hurt.
 
 Thanks for your help.  Things are almost working.  Only one problem at
 the moment.  
 
 Setting the qualify_domain to ist.flinders.edu.au works well at making my
 email appear to originate from uni.  The only problem is when at home
 I email to mark, the email ends up at my account at uni.  This is not
 the desired behaviour.  mark is my local username and the email should
 have been sent locally.  For some reason it is not.  I presume that
 because I addressed the email to mark not to [EMAIL PROTECTED], it
 decided to qualify it for me to [EMAIL PROTECTED].
 
 Is there any way of getting it to make the from address appear to be
 [EMAIL PROTECTED] while at the same time, allowing mark
 to be completed as [EMAIL PROTECTED]?
 

Hmmm... the first thing to do is to check to see if mail for
yourhostname.flinders.edu.au ends up at ist.flinders.edu.au when sent
from the outside world.  If this is the case, then you can just use your
hostname+domain for qualify_domain and replies should work OK (this is
the way my company's setup works; mail to [EMAIL PROTECTED]
will get to me).  Try hostname.ist.flinders.edu.au as your local
host/domain + qualify_domain too, as 'ist' is not the real hostname of
your smarthost--see below).

I played around with 'dig' for a sec, and it looks this depends
on frodo.cc.flinders.edu.au (AKA flinders.edu.au, and the catchall
mail destination for your university according to the MX records)
if your machine is hostname.flinders.edu.  If your machine is
hostname.ist.flinders.edu, it depends on ist.flinders.edu.au, AKA
adam.ist.flinders.edu.au.  Frodo resolves to a different IP than adam,
so these are probably distinct machines.  One or both of these machines
might know enough about you to get mail to your spool just based on your
username.  'ist' sounds like a better bet, as it's more specific to you.

frodo.cc.flinders.edu.au's SMTP server accepts mail for
[EMAIL PROTECTED], but that doesn't mean anything
nowadays; many servers delay bounces to make it harder for spammers to
verify addresses.  The only way to find out for sure is to try it.

Note that the success of this may also depend on whether or not your
smarthost will rewrite your email address.  Sendmail has some advanced
anti-spam features to verify senders, and a bogus hostname might throw it.
Again, the only way to find out is to try.

Barring this, your best option is probably to use the address rewriting
features of exim (set your real hostname+domain as the qualify_domain, but
rewrite them to the smarthost for mail that leaves the machine).  This is
something I have never used myself, but I took a quick look at spec.txt
in the exim docs, and it appears that you can turn rewriting on and off
for each director rule, and specify rewriting options for both envelope
and headers.  There's also the command line 'exim -brw [EMAIL PROTECTED]'
that will spit out the rewritten versions for testing purposes.

miket


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

1998-12-09 Thread Mitch Blevins
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
 [EMAIL PROTECTED] 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 [EMAIL PROTECTED]  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 [EMAIL PROTECTED] 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


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

1998-12-09 Thread Mike Touloumtzis

Hi Mark,

Some answers are given below.  I hope they're correct; they're based
on my experience in a similar situation (although my machine is behind
a firewall).

miket

On Wed, Dec 09, 1998 at 11:00:45AM +1030, 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.)
 
 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
 [EMAIL PROTECTED] and is stored in a spool directory there.
 
 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.
 
 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. 
 

Fetchmail connects to port 25 on your local machine.  Depending on your
machine's configuration, either exim is started by inetd in response
to this, or exim is running as a daemon and was already listening on
that port.

 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.
 
 5.  I then decide to send a message to [EMAIL PROTECTED]  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.
 

Exim uses SMTP to connect to the smarthost.  For the smarthost, you want
a machine with certain characteristics (see below).

 6.  I then send an email to [EMAIL PROTECTED] 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?
 

You probably don't want to your machine to have the same hostname as your
university smarthost.  Mail sent via SMTP is sent using an envelope,
a list of addresses that is not contained within the message itself (this
is what allows Bcc to work).  So even though the mail that fetchmail
fetches is addressed to [EMAIL PROTECTED] within the message,
fetchmail uses something like mark or [EMAIL PROTECTED] as the envelope
recipient when it talks to your SMTP server via TCP port 25.

You don't really want fetchmail getting too smart about parsing recipients
from your message, or you might end up looping the message back to all
of its original recipients.

Here's the way you probably want your mail to work:

1) Configure exim to treat yourhostname.flinders.edu.au as a local
   domain.  Add whatever other local domains are needed to get
   fetchmail to work; this may just involve setting
local_domains_include_host = true
   or I believe it will work to set
sender_unqualified_hosts = yourhostname.flinders.edu.au

2) Remove ist.flinders.edu.au from the local_domains.  This is a
   distinct host from yours; having your machine accept mail for
   it complicates the situation and shouldn't be necessary.
   Presumably the only thing that will ever cause mail to be
   routed to your machine from the outside world is fetchmail
   anyway.

3) Set qualify_domain = ist.flinders.edu.au to make your locally
   generated mail appear to originate from that machine.  This is
   potentially not necessary if ist.flinders.edu.au accepts mail
   for *.flinders.edu.au and the MX records are set up correctly
   in the DNS, but I don't think it can hurt.

4) Set ist.flinders.edu.au as your smarthost.  Smarthosts should be
   able to directly