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 connect to port 25 of random servers on the Internet or should know how to forward to a host that can. They should also be more or less permanently connected to the Internet. University mail servers will meet these criteria. 5) (Optional) If you want your machine to forward unknown local users to a smarthost, then add this as the final director in your exim.conf: smartuser: driver = smartuser new_address = [EMAIL PROTECTED] With this, mail sent to "fred" will go to fred's spool if fred is a local user, and to [EMAIL PROTECTED] otherwise.