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

Re: Getting email together with dman Newbie #61



On Mon, Dec 10, 2001 at 08:29:52PM +0200, Ian Balchin wrote:
> EXIM 
> 
> I ran eximconfig again, correctly, and am sure there is no problem
> there. 
> 
> 
> > The "visible" mail name of your system should be the same as "echo
> > $HOST".  Don't worry about it too much, just don't pick the name
> > of your ISP (or some other real server).  
> 
> looking at set i have no $HOST so gave hephaestus which is the
> machine name (I have $HOSTNAME which is perhaps what you meant?) 

good.

> 
> > When you get to the question
> > Which machine will act as the smarthost and handle outgoing mail?
> > this is where you enter in the name of your ISP's SMTP server.
> > ("imail.imaginet.co.za" according to what you wrote farther down)
> 
> OK, in Windows Pegasus this is entered as both my SMTP and POP3 host
> so sounds OK 

I have an exim.conf that was modified by hand (using advice
from this list, a while ago).  I tried just now to create an
exim.conf using eximconfig, and it produced something
different.

So....

looking at exim.conf in my emacs editor:

qualify_domain = achilles.net         # my isp's domain
qualify_recipient = localhost
#local_domains = not defined (see the comment delimiter at beg. of line)
local_domains_include_host = true
local_domains_include_host_literals = true
#relay_domains = 

Stuff after this didn't change much, until the section
ROUTERS CONFIGURATION
There is a new stanza before all the others:

lookuphost:
  driver = lookuphost
  transport = remote_smtp

Well that'll do for starters.  I don't know what it all means,
but try defining your keywords (or commenting them out) as
above using values appropriate to your situation.

I am not using my isp as a smarthost.  For outgoing mail,
my exim has to connect with the MTA of the recipient.
I should really fix this so that my outgoing email all gets
dumped onto my isp, for later delivery (that's what a smarthost
does).  Then I wouldn't have to stay connected until all my
outgoing emails have been sent to the respective remote
MTA's (which sometimes takes hours, if the recipient has
a stupid isp).  My isp's mail service is excellent,
and I'd be able to hang up virtually right away and
my isp (who is connected to the internet 24/7 anyway)
would worry about delivering to the stupid isps when
they can receive mail.

Anyway the point is that the configuration above won't
give you smarthost capability.  Doing that is On My
List of Stuff To Do (but fiddling with eximconfig today
is certainly pointing me in the right direction).


> FETCHMAIL 
> 
> 
> > First you need to tell mutt which host.  Edit ~/.muttrc for that.
> > Instead I use fetchmail for retrieving the mail.
> 
> OK, then that will be good enough for me, fetchmail seems to be the standard
> anyway. 
> 
> 
> I wrote the .fetchmailrc file.  Then I wondered where to put it.  
> The /usr/share/doc/fetchmail/sample.rc file states 
> 
> 
> 1.  put in your home directory (ie. /home/ian) 
> 2.  permissions should not be greater than -rw-------  (0600) 
> 
> 
> this is what i have done, but as I wrote it from root, I have done a
> chown to change it to my ownership as there was a complaint that i
> did not own it. 

Excellent.
> 
> 
> Now, when I run fetchmail from user ian i get 
> 
> 
> POP# connection to imail.imaginet.co.za failed: temporary name
> server error fetchmail: Query status=2 (SOCKET) 

Ah, name resolution errors.  A whole other topic.

Files that will be interesting at this stage are:
/etc/resolv.conf   see resolv.conf(5)
/etc/nsswitch.conf see nsswitch.conf(5)
/etc/host.conf     you guessed it:  host.conf(5)

My /etc/resolv.conf says: (these are _my_ isp's nameservers)

nameserver 209.151.0.10
nameserver 209.151.0.12



My /etc/host.conf says:
order hosts,bind
multi on

My /etc/nsswitch.conf is the default one, except maybe
the line "hosts" has files and dns reversed:

hosts:          files dns

Or maybe its not reversed and this _is_ the default, I don't
remember.  Anyway as a dialup user you want "files" first.

See the networking howtos:  /usr/share/doc/HOWTO/
NET-3-HOWTO.txt.gz
NET3-4-HOWTO.txt.gz
Net-HOWTO.txt.gz
Networking-Overview-HOWTO.txt.gz
Unix-and-Internet-Fundamentals-HOWTO.txt.gz


To view:
zless NET3-4-HOWTO.txt.gz

I got the above list of files with:
locate HOWTO
to remember where the HOWTO files are

ls -la /usr/share/doc/HOWTO/en-txt/*[nN][eE][tT]*

So, the above is the list of all files with net in the name
(with any capitalisation of "net") in the directory
/usr/share/doc/HOWTO

This misses the stuff in the subdirectory mini:

ls -lad /usr/share/doc/HOWTO/en-txt/* | grep "^d"
                                         ^^^^^^^^
Looking for lines that start with d (directory lines in
long-format listings start with d, eg:
drwxr-xr-x    2 root     root         3072 Nov 14  2000 ../mini

Then same ls -la command as above in this directory.  Turns
up files:
Home-Network-mini-HOWTO.txt.gz
IP-Subnetworking.txt.gz
Netrom-Node.txt.gz
Netstation.txt.gz

Anyway, get name resolution going.  You'll know it's
working when you can lookup your isp's dotted quad.
(do this while dialed up to your isp and can access
its nameservers)
ie when
dig imaginet.co.za
returns an ANSWER section:

;; ANSWER SECTION:
imaginet.co.za.         10M IN A        196.15.145.5
imaginet.co.za.         10M IN A        196.15.145.8


Don't try this with your own machine name, it won't work
(dig tests the domain name server, but not the local name
resolver that uses the file "/etc/hosts").

Once you've got all that going, you'll want to make sure
your routes are correct.

type netstat -r to see the entries in your routing table.
Mine says (I'm sure it's messed up a bit but I can
get mail in and out so I'm not complaining):

seal:/var/spool/exim/input# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
ottawa4.achille *               255.255.255.255 UH        0 0          0 ppp0
localnet        *               255.255.255.0   U         0 0          0 eth0
loopback        *               255.0.0.0       U         0 0          0 lo
default         *               0.0.0.0         U         0 0          0 ppp0

This says that packets bound for ottawa4.achilles.net go through
interface ppp0 (dialup).
Packets bound for localnet go through interface eth0 (network card).
Packets bound for loopback go through interface lo (loopback).
All other packets go through interface ppp0.

You also want to look at ifconfig(8).  That's how you set up
the ifaces ppp0, eth0, etc.

There must be commands to do these without editing by hand.
I have messed with these things by hand, and I will be doing
a fresh re-install from cd's one day soon to fix it.

These commands netstat and ifconfig are discussed in the above
networking howtos.  Just remember that "ifconfig" tells
your computer you have highways leading out of your
computer, and "route" associates destinations with outgoing
highways.


> OK, so in mutt I can send the mail, but how do I get it.  Does this
> automatically get done at the same time or do I have to run
> fetchmail and dial in a second time to have this done?  How, with
> diald (or wvdial) + mutt + exim + fetchmail do I make the process of
> sending and collecting mail from imaginet a simple one-time
> operation? 

Mutt will hand the mail to exim for delivery, whether you
are connected or not.

If you are connected, exim will immediately try to deliver
to the remote system.  If not, it will queue it up in
/var/spool/exim/input waiting for a chance to deliver.

Look in /etc/ppp/ip-up.d for a place to put scripts that
will execute when your ppp connection is up (such as
calling exim directly to do a mail delivery attempt).
I have a file /etc/ppp/ip-up.d/02exim containing:

#!/bin/sh

# Flush exim queue

if [ -x /usr/sbin/exim ]; then
        /usr/sbin/exim -qf
fi


So exim is a multi-talented beastie, it runs as a daemon
in the background and can also be invoked as a commandline
command for a one-shot mail delivery run (with options above)
exim(8) to see the options.

You probably have the above file in your ip-up.d directory
already.

So much for delivery.

For receiving mail, you should run fetchmail.  All this
can be done with one connection to your isp.  I suppose I
could add a fetchmail command to my ip-up.d directory...
not sure if it has to run per-user or not.  I usually
run it manually, as I connect manually and download
mail manually, and usually disconnect as soon as the mail
has downloaded.

Fetchmail and exim can both be running simultaneously,
no problem.

> > Do you have a login on the server?  My school runs Solaris, so I
> > just log in to that machine and do all my mail there instead of on
> > my debian box. If you use fetchmail, it won't give you the IMAP
> > benefit of server-side folders.  mutt has some support for IMAP,
> > but I've never used it.
> 
> I am not sure that I understand you here.  I log in from the
> computer at home or I carry it home and then do it there.  I am
> going to use one dedicated address on the linux box to start off
> with and get going with just personal email (family around the
> globe). 

Do you have a login on the server means, can you log in
to the server (ie, do you have shell access there?  Another
way to say is, do you have a user account on the server?)
This is different from just getting your mail via pop.
If you can telnet to the isp's machine and get a shell
prompt then you have a user account there.
Some isps provide this.

This guy is saying he dials up to his school, then
actually logs in to the Solaris box at school, and runs
a mailer there.  All this is displayed on his machine
at home, which is acting as a terminal to the telnet
(or whatever) session.

This guy is also saying that fetchmail doesn't support
IMAP:  you have to download the whole mail (header and body)
and every message.  Man fetchmail says it will fetch mail from
IMAP servers, but I don't see any way to get it to fetch
headers only so I guess this guy is right.

This guy also says that mutt has the ability to talk directly
to remote IMAP and POP mail servers, and in that case
you may be able to gain the benefits of the IMAP protocol.


On Tue, Dec 11, 2001 at 10:58:03PM +0200, Ian Balchin wrote:
> dman, Brenda, Karsten, & others, hi, 
> 
> following quite heavy complaints about my long-running Subject 
> line I changed it but have lost all help in the process, so am 
> posting this again under the original offending subject line.

Well I have no problems with your subject line.

> mutt sill says "POP host is not defined" when I try and send the 
> mail. 

Hmm.  Looks like your mutt is configured to do what you are
trying to get your fetchmail to do, that is to pop your mail
off your isp's mail server.

Here's where I have to guess a little (more than before :-),
I'm using procmail to sort my incoming mail and you're not (yet).
You want to point mutt to your mail spool file, where your mail
gets delivered.  I'm guessing that's /var/spool/mail/ian.
In the $HOME/.muttrc, look for:
set spoolfile=
and set it to :
set spoolfile='/var/spool/mail/ian'
and maybe comment out any lines having to do with your isp
or POP, also not sure if you have to comment out
set folder=~/Mail
or not.  Maybe not.

In any case, while in mutt (in the message header view)
you can press F1 to get the mutt user manual.

> PPP session from .......
> --> PPP negotiation detected
> --> Starting pppd at <the date>
> 
> and it stays there, so how do I enter into another program to send 
> or fetch mail.  Cannot be right.

What command did you run?  Did you run it manually or from
a script (eg one in ip-up.d)?  Did this appear on the screen
or in a logfile?  Which logfile?

Happy networking... You're almost there!

> cat news. She has settled in. My maid went to put the freshly-
> ironed towels in the linen cupboard today.  I had a frantic call 
> at the shop that the was "a snake hissing at her" and would I come 
> home and deal with it! Fortunately I quizzed her about the size 
> and colour of the snake, so she bravely went back --- and found 
> the cat!

Furry snake... interesting concept.  Well, if there were poisonous
snakes where I live, I'd run first and look later too!

-- 
bjb@achilles.net
Welcome to the GNU age!   http://www.gnu.org



Reply to: