Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31838 - mail-mta/exim: Gecos field problems
Summary: mail-mta/exim: Gecos field problems
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-23 10:45 UTC by Philipp Kern
Modified: 2005-01-19 23:03 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
strace output of mail (debug,7.21 KB, text/plain)
2004-06-15 11:32 UTC, Philipp Kern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Kern 2003-10-23 10:45:30 UTC
It seems that the gentoo mail doesn't parse the passwd field correctly when used in conjunction with a gecos field. It does but my phone number into the realname on sending mail which looks awful.
Comment 1 Donny Davies (RETIRED) gentoo-dev 2003-10-28 18:21:15 UTC
I dont understand.  What is "gentoo mail" ?
Comment 2 Philipp Kern 2003-11-01 03:39:51 UTC
The mail binary found in net-mail/mailx
./net-mail/mailx-8.1.2.20021129-r2/CONTENTS:obj /bin/mail 55c3f0b0685ef6b5238a5ba050d3e45d
1058980570
./net-mail/mailx-8.1.2.20021129-r2/CONTENTS:sym /bin/mailx -> mail (41471,
824188L, 770L, 1, 0, 0, 4L, 1058980570, 1058980570, 1058980570)

Sorry, my mistake.
Comment 3 Donny Davies (RETIRED) gentoo-dev 2003-11-01 08:22:18 UTC
Az; This is probably a net-mail herd thing...
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-01 14:35:00 UTC
Maybe, but I am not so sure mailx supports this ?  I cannot see anything
in 'man mail' ...  Why not use mutt or pine ?  mailx is really just a very
simple mail client used primarily in scripts (or these days at least).
Comment 5 Philipp Kern 2003-11-02 01:11:25 UTC
Where I use it, so...
Probably I am wrong and I should use sendmail (from exim) as mail-replacement
but I'm used to this on other distributions.
The problem is that it already reads the realname from /etc/passwd, but it
should exclude the remaining things (,,,,,) when a gecos field is used, because
realnames like Some person,,,,+49 ... result which is strange.
Debian mail does work correctly and as expected with a gecos field.
Comment 6 Cory Visi (RETIRED) gentoo-dev 2004-06-14 12:56:12 UTC
Philipp, I cannot reproduce this using mailx-8.1.2.20021129-r2. I tried sending mail using /bin/mail with a full GECOS field and it seemed to parse the From address fine. I tried simply sending an e-mail from the command line, in addition to replying to an e-mail in interactive mode. Can you double check on this bug and post some instructions to reproduce it?

Thanks!
Comment 7 Philipp Kern 2004-06-15 08:10:27 UTC
phil@thrall ~ $ type mail
mail is /bin/mail
phil@thrall ~ $ echo "test"|mail phil
#=> From: Philipp Kern,,,+497807955441 <phil@thrall.its-toasted.org>

My entry in /etc/passwd - set with `chfn':
phil:x:1000:10:Philipp Kern,,,+497807955441:/home/phil:/bin/bash

The version:
[ebuild   R   ] mail-client/mailx-8.1.2.20021129-r3  

So it's still a problem |:
Comment 8 Cory Visi (RETIRED) gentoo-dev 2004-06-15 10:05:58 UTC
Phil, I still cannot reproduce this. I do not doubt you're experiencing the error, I just cannot debug it without being able to reproduce it. If you don't mind, can you get me the following info:

- output of: which mail
- output of: ls -l /bin/mail
- output of: qpkg -f /bin/mail
- first line of output from: mail (no arguments)
- contents of ~/.mailrc
- contents of /etc/mail.rc

Thanks again!
Comment 9 Philipp Kern 2004-06-15 10:10:38 UTC
No problem of course.

phil@thrall ~ $ which mail
/bin/mail
phil@thrall ~ $ ls -l /bin/mail
-rwxr-xr-x  1 root root 106204 Jun 10 11:01 /bin/mail
phil@thrall ~ $ qpkg -f /bin/mail
mail-client/mailx *

phil@thrall ~ $ mail
/var/mail/phil: Is a directory
(I use maildir -- this is not the reason as the bug already happend when there were UNIX spool files)

/home/phil/.mailrc: No such file or directory

phil@thrall ~ $ cat /etc/mail.rc
set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
Comment 10 Cory Visi (RETIRED) gentoo-dev 2004-06-15 11:26:40 UTC
It's becoming amusing how difficult it is to track this bug down. Phil, I did an strace on mail and it appears that "mail" isn't even responsible for adding or interpreting the From field. The MTA appears to be putting this in.

What I was looking for before, was the version line of mail. If you create a temporary spool file, send yourself an e-mail (make a .procmailrc that overrides the system one), and run mail, you should get:

$ mail
Mail version 8.1 6/6/93.  Type ? for help.

That's what I wanted to see.
Also, this will probably be more useful... please submit the output from:

echo "test" | strace mail phil
Comment 11 Cory Visi (RETIRED) gentoo-dev 2004-06-15 11:27:34 UTC
Oh yeah, and which MTA are you using?
Comment 12 Philipp Kern 2004-06-15 11:32:58 UTC
Created attachment 33333 [details]
strace output of mail

I use exim-4*. On Debian Gecos is no problem, neither on a (I guess
self-compiled) installation on FC1.
strace output is attached, hope to help |:
Comment 13 Philipp Kern 2004-06-15 11:33:54 UTC
Perhaps you're right and this should be reassigned to exim as it doesn't seem to get it from /etc/passwd.
Comment 14 Cory Visi (RETIRED) gentoo-dev 2004-06-20 14:10:15 UTC
Colin, can you have a glance at this?
Comment 15 Colin Morey (RETIRED) gentoo-dev 2004-07-01 12:54:53 UTC
happy to look, can't promise a speedy resolution, but i'll do me best.
Comment 16 Christian Loitsch 2004-09-10 07:19:09 UTC
Easy fix:
put

      gecos_pattern = ([^,]*)
      gecos_name = $1

into /etc/exim/exim.conf

(search for gecos_pattern in /usr/share/doc/exim*/spec.*)
Comment 17 Philipp Kern 2004-09-10 08:22:50 UTC
Damn me... now you say it...

Debian uses the following block in the configuration file:
# Some operating systems use the "gecos" field in the system password file
# to hold other information in addition to users' real names. Exim looks up
# this field when it is creating "sender" and "from" headers. If these options
# are set, exim uses "gecos_pattern" to parse the gecos field, and then
# expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
# by the pattern.

gecos_pattern = ^([^,:]*)
gecos_name = $1
Comment 18 Philipp Kern 2005-01-19 23:03:27 UTC
Works with the specified change.