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

Re: exim getting the from addresses right



On Sun, Mar 17, 2002 at 01:13:37PM -0800, Harry Putnam wrote:
> "Sean 'Shaleh' Perry" <shalehperry@attbi.com> writes:
> >> 
> >> Apparently I've given exim bad info, but not at all clear how to
> >> tell exim to address my mail with newsguy but I'm not really
> >> it... hehe.
> >> 
> >
> > exim uses address rewriting.  You can either do this directly in the
> > exim file (look at the last section) or use /etc/email-addresses.
> >
> > harry@host.local -> harry@newsreader.com
> > daughter@herhost.local -> daughter@dslextreme.com
> 
> [ ... snip ... ]
> 
> Taking your clue and adding to this existing entry:
> 
>    # This rewriting rule is particularly useful for dialup users who
>    # don't have their own domain, but could be useful for anyone.
>    # It looks up the real address of all local users in a file
>    
>    *@newsguy.com    ${lookup{$1}lsearch{/etc/email-addresses}\
>                      {$value}fail} frFs
>    
> [My addition below]
> 
>     dh@localhost dh@dslextreme.com
> 
> With this in place, dh is no longer able to download mail from the isp
> pop server.  Remove it and downloading works.
> 
> What I did to test this was, first have pop3 server working on the
> debian mail hub.  I already have successfully sent mail from a windows
> machine on the lan, thru the smtp outgoing debian box, to ISP smtp
> machine and successfully reteived it from that same windows machine,
> again thru the debian box.

It works with windows, of course, because the mail reader sets the From:
header itself, instead of using your user name. You can do the same with
your linux mail program, except when you just use 'mail'.

One thing you might look into is not writing dh@localhost in the
rwriting rule, but instead dh@something.local.lan. Your mail program
will put that in the From: header, whereas fetchmail will put
dh@localhost, avoiding the rewrite (see below). *Note:* This is just a
guess. I have never tried this, I just told mutt and balsa what my real
e-mail address is.

> So the basics are in place and working.  I didn't like the way headers
> came out, not sure if it really matters, but I think it isn't rfc
> compliant this way.  (I'll show and example below).

They're great. And useful for examining your problem.

> So trying the rewrite thing to correct it, seems to have thrown  a
> monkey wrench into retrieval, although sending still works.
> 
> With the rewrite entry in place, running fetchmail from dh account on
> deb mail machine, with fetchmail -v shows mail being downloaded but in
> fact it is not.  The verbose output goes by, but no actual mail
> arrives.

It *is* downloaded. It's just sent away again. See below.

> Remove the added rewrite line and fetchmail downloads the mail fine.
> 
> Here are some sample headers, that I think are possibly wrong.  Making
> no claims to rfc knowledge but I down't think hidden local machine
> addresses should be showing up here.
> 
> Stats:
>  1) This message was sent from a windows machine
>     (satwin.local.lan 192.168.0.7)
> 
>  2) Routed thru the debian box (expi.local.lan 192.168.0.8)
>     to mail.dslextreme.com (ISP smtp machine)
> 
>  3) Retrieved via fetchmail on expi 192.168.0.8 (debian machine)
>     to /var/mail/dh from mail.dslextreme.com (pop server)
> 
>  4) Retrieved from there by the windows machine mail client on 
>     satwin (192.168.0.7)   
> 
> dslextreme.com is my ISPs' domain
> 
> Starting with the Received header furtherest down in the message 
> as 1.  I see seven places where my local private network addresses are
> shown.
> 
> I'm no rfc expert or even apprentice, but I don't think my local lan
> addresses should be present on internet mail.  These are not legal
> addresses, in the sense they can be tracerouted or pinged.
> 
> Far as I have heard, those addresses should not leak out onto the
> internet, where they may be taken for legal (domain owned) addresses.

They're just as they should be. The recieved headers don't care about
whether the adresses are private or not. Every server that the mail goes
through just puts its part in there. It should never touch the others.
Of course, this means that a human has to look at them to get them to
make sense, but that's just what we're doing. From the headers you can
see that the mail is just being sent back and forth between your box and
your ISP (note that fetchmail is mentioned twice). If your servers were
smart enough to remove all local info, it would be impossible to track
down what happened.

> Return-path: <dh@dslextreme.com>
> Envelope-to: dh@localhost
> 
> [Note: 7 local address shown]
> Received: from localhost ([127.0.0.1] ident=dh)
>         by expi.local.lan with esmtp (Exim 3.34 #1 (Debian))
>         id 16mgNO-0000y4-02
>         for <dh@localhost>; Sun, 17 Mar 2002 11:31:30 -0800
> 
> Received: from mail.dslextreme.com [66.51.205.14]
>         by localhost with POP3 (fetchmail-5.9.8)
>         for dh@localhost (single-drop); Sun, 17 Mar 2002 11:31:30 -0800 (PST)
> 
> [Note: 6 local address shown]
> Received: from expi.local.lan (adsl-66.51.210.228.dslextreme.com [66.51.210.228])
>         by mail.dslextreme.com (8.12.2/8.12.2) with ESMTP id g2HJTGCj015065
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:29:17 -0800
> 
> [Note: 5 local address shown]
> Received: from localhost ([127.0.0.1] ident=dh)
>         by expi.local.lan with esmtp (Exim 3.34 #1 (Debian))
>         id 16mgKc-0000xM-00
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:28:38 -0800
> 
> Received: from mail.dslextreme.com [66.51.205.14]
>         by localhost with POP3 (fetchmail-5.9.8)
>         for dh@localhost (single-drop); Sun, 17 Mar 2002 11:28:38 -0800 (PST)
> 
> [Note: 4 Local address displayed]
> Received: from expi.local.lan (adsl-66.51.210.228.dslextreme.com [66.51.210.228])
>         by mail.dslextreme.com (8.12.2/8.12.2) with ESMTP id g2HJOVCj013852
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:24:32 -0800
> 
> [ Note: 3 Again, the local address is shown
> Received: from localhost ([127.0.0.1] ident=dh)
>         by expi.local.lan with esmtp (Exim 3.34 #1 (Debian))
>         id 16mgG1-0000wa-00
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:23:53 -0800
> Received: from mail.dslextreme.com [66.51.205.14]
>         by localhost with POP3 (fetchmail-5.9.8)
>         for dh@localhost (single-drop); Sun, 17 Mar 2002 11:23:53 -0800 (PST)
> 
> [Note: 2 More local addresses]
> Received: from expi.local.lan (adsl-66.51.210.228.dslextreme.com [66.51.210.228])
>         by mail.dslextreme.com (8.12.2/8.12.2) with ESMTP id g2HJNeCj013611
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:23:40 -0800
> 
> [Note: 1) My local network addresses are visible here]
> Received: from satwin.local.lan ([192.168.0.7] helo=SATELLITE)
>         by expi.local.lan with smtp (Exim 3.34 #1 (Debian))
>         id 16mgFB-0000wN-00
>         for <dh@dslextreme.com>; Sun, 17 Mar 2002 11:23:01 -0800
> [ ... snip ...]

HTH

-- 
Note that I use Debian version 3.0
Linux mus 2.4.17mvz4 #1 Fri Mar 15 23:30:15 CET 2002 i686 unknown

Matijs



Reply to: