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.
I dont understand. What is "gentoo mail" ?
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.
Az; This is probably a net-mail herd thing...
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).
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.
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!
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 |:
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!
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
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
Oh yeah, and which MTA are you using?
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 |:
Perhaps you're right and this should be reassigned to exim as it doesn't seem to get it from /etc/passwd.
Colin, can you have a glance at this?
happy to look, can't promise a speedy resolution, but i'll do me best.
Easy fix: put gecos_pattern = ([^,]*) gecos_name = $1 into /etc/exim/exim.conf (search for gecos_pattern in /usr/share/doc/exim*/spec.*)
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
Works with the specified change.