Hello All,
I am new to sendmail, and have been struggling with it to enable proper email settings. CGI scripts from Movable Type software send email using sendmail, but I get this error.

Nov 4 12:01:20 ns sendmail[27921]: hA4C1KU27921: from=apache, size=492, class=0, nrcpts=1, msgid=<200311041201.hA4C1KU27921@ns.laws-project.org.uk>, relay=apache@localhost
Nov 4 12:01:20 ns sendmail[27924]: hA4C1KU27921: to=lee@headshift.com, ctladdr=apache (48/4, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30492, relay=headshift.com. [217.199.183.127], dsn=4.0.0, stat=Deferred: Connection refused by headshift.com.

and the email is put in the queue and not sent.

In order to solve this problem when I add headshift.com to the /etc/mail/local_host_names file I start getting this error

Nov 4 12:08:26 ns sendmail[27950]: hA4C8Q127950: to=lee@headshift.com, delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Nov 4 12:08:26 ns sendmail[27950]: hA4C8Q127950: from=apache, size=492, class=0, nrcpts=1, msgid=<200311041208.hA4C8Q127950@ns.laws-project.org.uk>, relay=apache@localhost
Nov 4 12:08:26 ns sendmail[27950]: hA4C8Q127950: hA4C8Q227950: DSN: User unknown
Nov 4 12:08:27 ns sendmail[27950]: hA4C8Q227950: to=root, delay=00:00:01, xdelay=00:00:00, mailer=local, pri=30592, dsn=2.0.0, stat=Sent

in order to solve this issue , I altered the CGI script to send email from webmaster@headshift.com using the -f flag for calling sendmail, but no use
I still get this error

Nov 4 12:10:18 ns sendmail[27962]: hA4CAIG27962: to=lee@headshift.com, delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Nov 4 12:10:18 ns sendmail[27962]: hA4CAIG27962: from= webmaster@headshift.com, size=492, class=0, nrcpts=1, msgid=<200311041210.hA4CAIG27962@ns.laws-project.org.uk>, relay=apache@localhost
Nov 4 12:10:18 ns sendmail[27962]: hA4CAIG27962: to=webmaster@headshift.com, delay=00:00:00, mailer=local, pri=30492, dsn=5.1.1, stat=User unknown
Nov 4 12:10:18 ns sendmail[27962]: hA4CAIG27962: hA4CAIH27962: postmaster notify: User unknown
Nov 4 12:10:18 ns sendmail[27962]: hA4CAIH27962: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30592, dsn=2.0.0, stat=Sent

can anyone please let me know how I can solve this issue please. I have been stuggling for ages, and sendmail has become a huge pain for me.

Imran.