Doug

on 13.06.2011 21:21, Doug Sampson wrote:
>> - source on line 6 is bogus, just comment it out and insert a `.`
>> where it is used
>>
> I'm not sure exactly which line is the sixth line you are referring
> here. Is it the "CR='.' line? When counting lines, are the first three
> commented lines at the beginning of the file counted? Empty lines also?
> 
> Please elaborate. I would love to use the mail command!

OK I'll try, I just found out there are multiple versions in my various
deployed systems and as they don't have a version stamp I cannot know
what you have.

My home system looks like the latest in Bering 4 and works indeed. One
system at a remote location had a line starting with 'source' and this
is a wrong keyword for that specific version of busybox. So if you have
that version

Anyway I tested with my home gateway and here is the first result

gatekeeper# mail -s foo -h 194.124.158.51 erich.t...@think.ch
hostname: gatekeeper: Unknown host

Debugging shell scripts is pretty easy....

gatekeeper# which mail
/usr/sbin/mail
gatekeeper# sh -x /usr/sbin/mail -s foo -h 194.124.158.51
erich.t...@think.ch
+ prog=mail
+ OIFS=

+ CR=
+ LF=

+ MASTCONF=/etc/POSIXness.conf
+ [ -f /etc/POSIXness.conf ]
+ . /etc/POSIXness.conf
+ TIMEOUT=60
+ date +%s
+ ContentBoundry=11733--1307998981
+ ptx=/tmp/smtp.tx.11733
+ prx=/tmp/smtp.rx.11733
+ fdata=/tmp/smtp.data.11733
+ fbody=/tmp/smtp.body.11733
+ [ -e /tmp/smtp.rx.11733 ]
+ [ -e /tmp/smtp.tx.11733 ]
+ [ -e /tmp/smtp.data.11733 ]
+ [ -e /tmp/smtp.body.11733 ]
+ mknod /tmp/smtp.tx.11733 p
+ mknod /tmp/smtp.rx.11733 p
+ :
+ :
+ chmod 600 /tmp/smtp.tx.11733 /tmp/smtp.rx.11733 /tmp/smtp.data.11733
/tmp/smtp.body.11733
+ hostname -f
hostname: gatekeeper: Unknown host

So this looks like the hostname call is wrong......

gatekeeper# which hostname
/bin/hostname
gatekeeper# ls -l /bin/hostname
lrwxrwxrwx    1 root     root           12 May 18 18:33 /bin/hostname ->
/bin/busybox

Fine, so how should hostname look like

gatekeeper# hostname --help
BusyBox v1.8.2 (2008-01-05 01:22:22 UTC) multi-call binary

Usage: hostname [OPTION] {hostname | -F FILE}

Not much information, but maybe busybox's website can tell more

hostname

    hostname [OPTIONS] [HOSTNAME | -F FILE]

    Get or set hostname or DNS domain name

    Options:

            -s      Short
            -i      Addresses for the hostname
            -d      DNS domain name
            -f      Fully qualified domain name
            -F FILE Use FILE's content as hostname

OK, so -f should yield the FQDN 

gatekeeper# hostname -f
hostname: gatekeeper: Unknown host

Looks like a busybox bug to me. Now as hostname should just take what is
set on the system, where could it get the domain from? One bet is
/etc/resolv.conf, and there is no domain defined in my case, so I set a
domain entry in /etc/resolv.conf, just for fun.

gatekeeper# hostname
gatekeeper
gatekeeper# hostname -f
gatekeeper.think.ch

Hey, all of a sudden there is no error in the mail program anymore. Not
really sophisticated as a solution, but as long as it works....

My example here does not need any settings in /etc/POSIXness, but
setting reasonable values there help even with the hostname -f problem

#This is the master config file for the POSIXness.mail scripts

# Host SMTP server for the 'mail' command. If blank the host 'mail' is used.
MAIL_SERVER="194.124.158.51"

# From: domain to send to mail server.  If blank, `hostname -f` is used.
MAIL_DOMAIN="mydomain.net"

# Return-Path will be USER@MAIL_DOMAIN
USER="foodle"

Now one more try...
gatekeeper# mail -s foobar erich.t...@think.ch
scoobly oobly doobab

And here is the mail

>From foo...@mydomain.net  Mon Jun 13 23:35:01 2011
Return-Path: <foo...@mydomain.net>
Received: from mydomain.net (gatekeeper.think.ch [194.124.158.99])
        by luna.think.ch (8.14.3/8.14.3) with SMTP id p5DLZ0UL030723
        for <erich.t...@think.ch>; Mon, 13 Jun 2011 23:35:01 +0200
Message-Id: <201106132135.p5dlz0ul030...@luna.think.ch>
Date: Mon, 13 Jun 2011 21:34:54 +0000
From: foo...@mydomain.net
Subject: foobar
To: erich.t...@think.ch
X-Mailer: POSIXness Mail
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3
(luna.think.ch [194.124.158.51]); Mon, 13 Jun 2011 23:35:01 +0200 (CEST)

scoobly oobly doobab


Hope this helps, if you run into another problem due to a different
script/busybox match let me know.

cheers

Erich

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Reply via email to