Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2000 00:05:06 -0500
From:      Jeffrey Dunitz <orpheus@lemieux.hockey.net>
To:        Erik Trulsson <ertr1013@student.csd.uu.se>
Cc:        Duke Normandin <dnormandin@freewwweb.com>, "'freebsd-questions@FreeBSD.org'" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Help! ppp/fetchmail/sendmail
Message-ID:  <20000517000505.B18330@lemieux.condolan.asn>
In-Reply-To: <20000516210351.A1904@student.csd.uu.se>
References:  <00bc01bfbee5$3f753f60$63dba7d1@dnormandinfreewwweb.com> <20000516210351.A1904@student.csd.uu.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Vers Tue, May 16, 2000 at 09:03:51PM +0200, Erik Trulsson disait quelque chose comme:
> On Mon, May 15, 2000 at 09:15:45PM -0600, Duke Normandin wrote:
> > help......! I've got one hell of a hair-ball mess!

Nothing compared to the hugeness of this message. Ugh. Sorry, I 
didn't trim much, for fear of screwing up context hints.

> > 
> > I'm running 3.3R on a standalone box - no X
> > 
> > I want to do the following using user ppp:
> > 1. Have ppp sit in the bg waiting for some process to wake it up
> > 2. Retrieve my mail from 2 ISPs -- each POP3 accts

fetchmail does this more or less by default. And it kinda sounds like you 
have this part figured out. In case you don't, make your .fetchmailrc
file look like mine:

----------
poll pop.isp1.com with proto POP3
user "orpheus" there with password "sn4gg|epu55" is orpheus here with flush

poll pop.isp2.net with proto POP3
user "orpheus" there with password "m0_$H" is orpheus here with flush

----------

And no, those aren't my real passwords, so don't even waste your time. :)


> > 3. Send mail to my 2 ISPs

Does it have to be two? Can it be just one? I mean, can you send mail
to isp1 from isp2?

> > 4. For the time being, have 2. & 3. happen ONLY when *I* decide

You can run fetchmail either from cron or by hand. No big deal.
You can configure sendmail to queue only, and then you can run
sendmail -q when you want to send out your mail. To do so, in /etc/rc.conf
or wherever it is that sendmail gets started on boot, give it the 
-odq flag. Normally you run sendmail -bdf, which tries to deliver things
immediately. I've never done the queue-only thing before.


> > 
> > Well I've gotten ppp to work -- as well as fetchmail. Couldn't find a
> > single message on my bloody system after fetchmail finished. Turns
> > out that sendmail sent the whole freaking mess *back* to my 2 ISPs.
> 
> I guess that one of two things happened:
> 1) sendmail wasn't configured to accept mail for your machine so it bounced
>    it back to your ISP.
> 2) sendmail was configured to send all mail via your ISP so it did that.

Make sure in your sendmail.cf file you have Cwlocalhost enabled:

-----------

##################
#   local info   #
##################

Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/sendmail.cw

-----------


Then, in your /etc/sendmail.cw file, have this:

-----------
# sendmail.cw - include all aliases for your machine here.
yourbox
yourbox.yourlocal.net
yourbox.isp1.com
yourbox.isp2.net
#
-----------
 
Also include a couple lines to force some stuff to be true:
---
Djyourbox.isp1.com  # force your domain name to be your isp
DSsmtp.isp1.com     # force smarthosting; use smtp.isp1.com as a relay
                    # for all outgoing mail
DMisp1.com          # masquerade as your isp
---

I like this one, which goes wayyyy down in the sendmail.cf:
# dialup line delay on connection failure -- Mon May  8 21:01:06 orpheus
O DialDelay=60s

There's also some stuff you can do to make sendmail _not_ do a DNS lookup
when you try to send outgoing mail. That and the queue-only stuff would
do what you want. I know there's something you can do that will make
sendmail hold off on doing the DNS lookup until you run the queue.
Sorry I'm not able to look all that stuff up for you, but I can tell you 
with some certainty that it's in the O'Reilly Sendmail book, which is a 
must-have if you expect to find yourself administering unix boxes other 
than at home. If you don't want to learn sendmail and expect to only need 
to do this stuff at home, I can't blame you. And I've never used anything 
_but_ sendmail, and so can't be much help for anything else. 

I think I solved everything for you except the DNS lookup thing, though.

> 
> 
> > 
> > How do I get fetchmail to drop the 2 POP3 accounts to user:dnormandin
> Just run fetchmail as that user. It works for me at least.

Fetchmail also has a multidrop capability, but I'm told that it's 
disrecommended. I'd stick with running it from two different accounts
if you want it to show up in two different mailboxes. It wasn't clear
from how you asked your question if you were trying to get mail
for _just you_ from two different ISP's (which is how I'm set up) or
if you had two local users on your system who need to get mail from
separate ISPs (the old classic my-girlfriend-uses-a-different-isp
situation).


> 
> > on my system? Anybody have ideas on how I hosed sendmail.cf - or
> > what I didn't do. BTW, at the end of the sendmail manpages, they
> > suggest reading, "SENDMAIL Configuration and Settup" or something
> > like that. No joy -- can't find the bloody thing. Any ideas where it is?
> > As well, my `hostname` is odie.rockingd.calgary.ab.ca. Is this screwing
> > things up with regards to fetchmail/sendmail?

Having a long hostname shouldn't cause a problem, and, as far as I know, 
sendmail is not canadian-aware, so it's not like it's recognizing you
as an evil canadian and trashing your mail. :) (*just kidding*)

> If that hostname is correct (meaning the domain actually exists etc) there
> shouldn't be any problems.
Even if your domain doesn't exist, you can do the masquerading and 
Dj trick I showed above and it should work. My local hostname and
domain on my box that handles mail uses a fictitious domain and a
non-legitimate top-level domain, but I fudge it with the masquerading.

> 
> 
> 
> I think that sendmail is primarily meant to be used on machines that are
> connected all the time and with a working DNS setup.
> It can probably be made to work in your case too, but don't ask *me* how :-)

That's almost a true statement. Sendmail got its start back in the
days when UUCP was common, and you'd have to dial up to some ungodly
piece of crap box somewhere over a 300-baud modem. However, back in
those days, you typically weren't changing your IP address every time
you dialed in (because  UUCP doesn't work that way). But sendmail can
definitely handle non-fulltime connections. It's just extra work. 
Sendmail works out of the box with little or no dinking if you have
a "real" connection to the net (static IP dialup, DSL, T1, whatever).
If you dink with the config a bit, you can make it work with nearly
anything.

> 
> > 
> > Thanks for any & all help. PLEASE - don't *anybody* pop off with RTFM.
> > I might just take the next plane, look you up and shove TFM where the
> > sun never shines --- cuz that's ALL I've been doing is reading!
> 

Well, can I politely suggest that you might have better luck with the
sendmail book and also some pages at sendmail.org? 

You might also consider asking this question on one of the sendmail
newsgroups--chances are you'll get a very quick response from someone
like Claus Assmann, who is a stupendous badass when it comes to solving
weird problems.

> 
> 

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jeffrey Dunitz                 | *** ENRGi.com ***   | orpheus@avalon.net
BOFH Emeritus, Avalon Networks | Network Engineer    | (651) 686-9974 /
http://www.avalon.net/~orpheus | Net/Sec/Dev/Arch    | Eagan, MN  _ /


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000517000505.B18330>