OK, now I'm really confused! According to the sendmail documentation, at
http://www.sendmail.org/m4/tweaking_config.html , confDOMAIN_NAME is supposed to provide the fully-qualified domain name for my machine, e.g. $w.FOO.com , where $w is the short domain name. But this would mean changing sendmail.mc, remaking sendmail.cf and restarting sendmail every time my machine gets a new dynamic IP!
Anyway, assuming this is what you meant, I tried adding the line
define(`confDOMAIN_NAME',
`xxx-xxx-xxx-xxx.mart-bsr1.chi-mart.il.cable.rcn.com')dnl
with my current real IP in place of the x's, and
define(`SMART_HOST', `smtp.rcn.com')dnl
MASQUERADE_AS(`my_real_email_domain.com')dnl
to send all outgoing mail via the ISP's SMTP server with ford@my_real_email_domain.com instead of ford@gluon.local on the envelope.
I telnetted to localhost on port 25, and sendmail correctly claims to be xxx-xxx-xxx-xxx.mart-bsr1.chi-mart.il.cable.rcn.com. However, then I created a simple mail, containing the following:
---
From: ford@my_real_email_domain.com
To: me@another_real_email_address.com
Subject: Hello
Testing...
---
I sent the mail using "sendmail -v -t < message", and got the following output (with addresses substituted throughout, apart from gluon.local):
-----
me@another_real_email_address.com... Connecting to localhost.local. via relay...
220 xxx-xxx-xxx-xxx.mart-bsr1.chi-mart.il.cable.rcn.com ESMTP Sendmail 8.12.9/8.12.9; Mon, 24 Jan 2005 17:54:21 -0600
>>> EHLO gluon.local
xxx-xxx-xxx-xxx-xxx.mart-bsr1.chi-mart.il.cable.rcn.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<ford@gluon.local> SIZE=78
250 2.1.0 <ford@gluon.local>... Sender ok
>>> RCPT To:<me@another_real_email_address.com>
>>> DATA
553 5.1.8 <me@another_real_email_address.com>... Domain of sender address ford@gluon.local does not exist
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
/home/ford/dead.letter... Saved message in /home/ford/dead.letter
Closing connection to localhost.local.
>>> QUIT
221 2.0.0 xxx-xxx-xxx-xxx.mart-bsr1.chi-mart.il.cable.rcn.com closing connection
-----
The corresponding entries in /var/log/mail/info are:
-----
Jan 24 17:54:17 gluon sendmail[24242]: j0ONsGgd024242: from=ford, size=78, class=0, nrcpts=1, msgid=<200501242354.j0ONsGgd024242@gluon.local>, relay=ford@localhost
Jan 24 17:54:26 gluon sendmail[24246]: j0ONsLBo024246: ruleset=check_rcpt, arg1=<me@another_real_email_address.com>, relay=localhost [127.0.0.1], reject=553 5.1.8 <me@another_real_email_address.com>... Domain of sender address ford@gluon.local does not exist
Jan 24 17:54:26 gluon sendmail[24242]: j0ONsGgd024242: to=me@another_real_email_address.com, ctladdr=ford (501/501), delay=00:00:10, xdelay=00:00:09, mailer=relay, pri=30067, relay=localhost.local. [127.0.0.1], dsn=5.1.8, stat=User unknown
Jan 24 17:54:26 gluon sendmail[24246]: j0ONsLBo024246: from=<ford@gluon.local>, size=78, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
-----
So, two things appear to be wrong. Firstly, the mail is being sent from ford@gluon.local, instead of from ford@my_real_email_domain.com. Secondly, I have relay=localhost, instead of relay=smtp.rcn.com, which suggests that the mail is being transmitted directly from my machine to the destination, instead of via smtp.rcn.com. Why are the MASQUERADE_AS and SMART_HOST not having any effect?