[Pkg-exim4-users] mailname for outgoing mail
Marc Haber
mh+pkg-exim4-devel at zugschlus.de
Sat Jul 1 21:11:23 UTC 2006
Hi,
On Fri, Jun 30, 2006 at 09:06:09PM -0700, Ross Boylan wrote:
> Perhaps this dicussion should move to -dev?
> Redirect as you see fit.
Agreed, done. -devel, this is a discussion from -users regarding the
debconf templates. Please see the -users archives for the beginning.
> On Fri, 2006-06-30 at 11:28 +0200, Marc Haber wrote:
> > On Thu, Jun 29, 2006 at 01:08:19PM -0700, Ross Boylan wrote:
> > > On Wed, 2006-06-28 at 11:09 +0200, Marc Haber wrote:
> > > > Hmmm. Any idea how to explain this better?
> > > Without having the templates in front of me, this is hard.
> >
> > http://svn.debian.org/wsvn/pkg-exim4/exim/trunk/debian/exim4-config.templates?op=file&rev=0&sc=0
> > links to the templates file of current exim4 mainline svn HEAD. Does
> > that help?
> Yes. And there's actually more in there on the first question than I
> remembered.
"More in there"? Is that good or bad?
> > > It's also
> > > hard because it's hard to think of brief ways to say this. Perhaps
> > > after the second question add (/etc/mailname only affects unqualified
> > > addresses, while this setting affects all adresses).
> > >
> > > But the bigger thing that's puzzling is that there there are two
> > > questions that seem to be addressing the same issue, even if they differ
> > > in detail.
> >
> > You mean the templates exim4/mailname and exim4/hide_mailname?
> Yes.
Yes, we need to pay special attention to that in the re-work. I hope
that we can get rid of at least one of these questions.
> > > Perhaps since /etc/mailname is the province of the whole system it
> > > should be the responsibility of the Debian installer to set it up, not
> > > the particular packages (mail, news, ....).
> >
> > Maybe, but that would set a precendent. The common way to achive this
> > is in the packages using the file, but that's error prone and
> > duplicates efforts.
> A precedent that avoids error prone duplication might have some good
> points :)
Yes, but not at this time of Debian release.
One possible solution would be a package "etc-mailname" which all
packages using /etc/mailname could depend on. That way, we wouldn't
put any more burden on the installer people.
> And the question doesn't seem that different from "what is
> the name of your system" which I think is part of the installer's setup.
There are situations where one might want to have messages qualified
with some other domain part, for example in a pool of workstation
machines.
> Anyway, here's the current setup:
> -----------------------------------------------------------------
> Template: exim4/mailname
> Type: string
> _Description: System mail name:
> Your "mail name" is the hostname portion of the address to be shown on
> outgoing news and mail messages (following the username and @ sign)
> unless hidden with rewriting. . This name will also be used by other
> programs; it should be the single, full domain name (FQDN) from which
> mail will appear to originate. . This name won't appear on From: lines
> of outgoing mails if you enable rewriting.
>
>
> Template: exim4/hide_mailname
> Type: boolean
> _Description: Hide local mail name in outgoing mail?
> The headers of outgoing mail can be rewritten to make it appear to have
> been generated on a different system, replacing "${mailname}"
> "localhost" and "${dc_other_hostnames}" in From, Reply-To, Sender and
> Return-Path.
> ------------------------------------------------------------
> I believe the questions are asked in that order.
Yes, and not immediately after each other. exim4/mailname is step 8,
exim4/hide_mailname is step 25 in
/var/lib/dpkg/info/exim4-config.config.
> *If* the 2 questions are preserved, this might be a little clearer:
> ----------------------------------------------------------------
> Template: exim4/mailname
> Type: string
> _Description: System mail name:
> Email addresses ordinarily look like name at example.com, where the part
> after the @ sign is called the "domain."
Extra points for getting rid of the "host name" string, as RFC2821 and
2822 say "Domain" as well.
> Mail and news programs, or
> their users, sometimes generate addresses without the @ and the domain;
> exim and other programs use the system mail name (the response to this
> question) to provide a complete address.
To "create" or "generate" a complete address?
> Ordinarily you should enter
> the domain you wish to present to the internet at large.
> [Is that really true? If the user's ISP is earthlink.net, should they
> enter earthlink.net as their mailname?
No, that is going to create all kinds of strange issues.
> An empty response implies
> what--use exim's primary hostname and its attendant fall-backs? another
> interpretation would be "do not permit unqualified addresses".]
The answer to the mailname question is intialized with the following
code:
if [ "x${dc_mailname}" = "x" ] ; then
dc_mailname=hostname --fqdn || dc_mailname=hostname && \
dc_mailname=printf '%s\n' "${dc_mailname}" | stripwhitespace && \
db_set exim4/mailname "${dc_mailname}"
fi
If the user decides to delete the mailname, this ends up verbatim in
the configuration file, and I am not sure how exim reacts to this. It
could treat the empty string as "undefined", falling back to
primary_hostname, or it could take the empty string verbatim,
creating illegal mail adresses.
> ---------------------------------------------------
> Template: exim4/hide_mailname
> Type: boolean
> _Description: Hide local mail name in outgoing mail?
> -----------------------------------------------------
> Oops; I'm not sure what this does. Also, is this always asked, or only
> in some configurations? I suspect (quoting update-exim4.conf)
> 1) this corresponds to
> dc_hide_mailname
> Boolean option that controls whether the local mailname in the
> headers of outgoing mail should be hidden. (Only effective for
> "smarthost" and "satellite".
>From what I reckon from exim4-config.config, I suspect that is is only
asked in a smarthost config and always assumed "yes" in a satellite
config.
> 2) if that is set it in turn alters
> DEBCONFheaders_rewriteDEBCONF
> If the system is configured to hide the system mail name, this
> is replaced with a headers_rewrite directive rewriting sender
> addresses from local domains to the visible mail name for use on
> the transport that sends outgoing mail to the smarthost.
Yes, if hide_mailname true, we have
DEBCONFheaders_rewriteDEBCONF='headers_rewrite = *@+local_domains $1 at DCreadhost frs : *@'"$mailname"' $1 at DCreadhost frs'
DEBCONFreturn_pathDEBCONF='return_path = ${if match_domain{$sender_address_domain}{+local_domains}{${sender_address_local_part}@DCreadhost}{${if match_domain{$sender_address_domain}{'"$mailname"'}{${sender_address_local_part}@DCreadhost}fail}}}'
> This one might be relevant, but I think it's insensitive to
> dc_hide_mailname
> DEBCONFrewriteemailaddresses_mailnameDEBCONF
> is replaced with this rewriting rule:
> *@mailname ${lookup {${local_part}} lsearch {/etc/email-
> addresses} {$value} fail } Ffrs
> with mailname being replaced by the contents of /etc/mailname.
>
>
> So if you answer yes to this question, it means most addresses that
> match +local_domains get rewritten to /etc/mailname.
>
> Now I see why the reference to rewriting was in the first question:
> there are two kinds of rewriting going on. The second question touches
> on the rule in the previous paragraph, while the /etc/mailname is only
> obscured by the DEBCONFrewriteemailaddresses_mailname snippet.....
>
>
> Having muddied that issue, I'll turn to the topic of how my system was
> handling mail.
> >
> > > > Very interesting. Can you explain exactly what happened? Did you have
> > > > betterworld.us in local_domains at this time?
> > > No. Did I leave anything else out of the explanation below?
> >
> > I don't know. In fact, I have not yet fully understood your setup and
> > how you have configured your exims. Maybe it's too complicated to
> > investigate any more, but if you want me to I'll spend some time in
> > trying to reproduce your issue. (mental note: Need to get vmware
> > installed).
> That's very kind of you to offer. I don't think it's necessary, since I
> don't think there's a problem--just something that surprised me a bit at
> first, but now seems reasonable.
Good.
> > > > Actually, this setup doesn't seem odd at all to me. I don't see any
> > > > problems, but since you had problems, things are weird and unclear to
> > > > me.
> > > Well, I was surprised that mail from corn ended up on wheat,
> >
> > I am surprised about that as well. I suspect that you inadvertently
> > modified the list of local domains which made corn suddenly think that
> > your betterworld.us was not a local domain.
> I did that deliberately, since I didn't want to be stealing messages
> meant for my primary mail server.
This might have been the cause for your exims behavior.
> > > but once it
> > > happened I decided it was exactly the behavior I wanted. I think part
> > > of the reason it happened was that scripts that generated system mail
> > > (e.g., logcheck) used /etc/mailname in places,
> >
> > These scripts usually use unqualified addresses and deliver mail via
> > /usr/bin/mail or /usr/lib/sendmail. Yes, in this case, you're going to
> > have the addresses qualified with the contents of /etc/mailname.
> >
> > I have modified the README accordingly and hope that the new text is
> > better understandable. See
> > http://pkg-exim4.alioth.debian.org/README/README.Debian.html, chapter
> > 2.1.1.3.
> >
> That looks good.
Thanks.
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
More information about the Pkg-exim4-users
mailing list