Subject: Re: re-writing From: header with pine/sendmail/userdb

From: [email-masked] (Jerry Lynch)
Date: 30 Apr 1996 12:26:44 GMT

========= 
Here is my attempt at writing a "FAQ-like" description of how I got
the USERDB to work with pine.  This is now in the Sendmail FAQ (Maybe
this should go in PINE FAQ also?).  I encourage you to post a request
to comp.mail.sendmail for the USERDB to handle FQDNs.
BTW.  I'm using sendmail 8.6.12.

-------------------------------------------------------------------
  * How do I get the user database (userdb) to work with Pine.

        The basic incompatibility with Pine and the user database option
        is in how Pine writes From addresses in the header.  Most MUAs 
        write the From address as "From: user", while Pine, for reasons
        given in its documentation, write the From address as 
        "From: user@FQDN" (FQDN=fully qualified domain name).  Because of
        this difference, the user database does not rewrite pine headers.

        One solution to this problem is to make the following change in
        /etc/sendmail.cf after you have the user database option installed
        and working with other MUAs:

        In the "local info" section, add the following:

                # Define our userdb file for pine rewrites
                Kuserdb btree -o /etc/userdb.db

        After ruleset 0, add the following as ruleset 1:

   ##################################################
   ### Ruleset 1, rewrite sender header & envelope ##
   ##################################################
   #Thanks to Bjart Kvarme <[email-masked]>
   S1
   R$- < @ $=w . > $*   $: $1 < @ $2 . > $3 ?? $1       username@localhost ?
   R$+ ?? $+            $: $1 ?? $(userdb $2 : mailname $: @ $)
   R$+ ?? @             $@ $1                           Not found
   R$+ ?? $+            $>3 $2                          Found, rewrite
   #NOTE      ^^^^^^^^^^       ^^^^^^^^^^^^^^^^^^^^^^^^^
   #          Use Tab Characters  Use Tab Characters in these regions
   # to make three columns (the line with "mailname" only has 2 columns).

        Now the user database should re-write messages sent with Pine.

        If this still does not work for you, try adding the following
        to either the system wide pine.conf, pine.conf.fixed, or your 
        personal .pinerc:

                user-domain=localhost

        This has been known to help solve the problem for some people.
        ** The drawback of setting the user-domain is Pine 3.92 gives
           you error messages since localhost is not a FQDN...but if
           you just ignore the warnings, things should work.

-------------------------------------------------------------------
Any thanks for the above should be sent to: Bjart Kvarme
<[email-masked]> who was kind enough to post this solution
to comp.mail.sendmail a while back.  
===========

On 25 Apr 1996 16:29:43 GMT, Simon Greaves <[email-masked]> wrote:
>I 'm running sendmail 8.7.5 with userdb compiled in,
>with pine 3.9[12] and mh-6.8.4.
>
>We have a campus mailname policy of the form:
>
>  [email-masked]
>
>I configured sendmail to masquerade as the mail
>domain (hw.ac.uk) and created a userdb file with
>mappings to and from my login id and my mailname.
>
>Using 'Mail' things looked good, but got messier
>when I tried other MUA's.
>
>Looks like as long as I don't have a from field,
>or the from field only has my local login id
>(ie no '@' or '@domain') then the userdb stuff
>works. If I use an MUA that tries to be clever
>about the from header I'm stuffed.
>
>Is this correct behaviour from sendmail, or am I
>missing something fundamental here?
>
>Can I work around it easily? Do I need extra rules
>in my sendmail.cf file?
>
>Any help welcome, email preferred:
>
>Thanks, 
>
>Simon
>[email-masked]		(one day...)

-- 
Jerry	<[email-masked]>