LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sendmail--changing domain from localhost.localdomain (https://www.linuxquestions.org/questions/linux-software-2/sendmail-changing-domain-from-localhost-localdomain-409714/)

andrewstr 01-30-2006 03:19 PM

Sendmail--changing domain from localhost.localdomain
 
I have been running Sendmail (8.12.8-9.90) on Red Hat 9 for quite some time but have begun having trouble with my mail not being accepted because it is from an "unknown host" (localhost.localdomain). I have adjusted several parameters (rebuilding the sendmail.cf and restarting sendmail each time) in sendmail.mc but it continues to report itself as localhost.localdomain. Note that I have this PC running as an SMTP mail server for an office network and it is running behind a firewall so relaying spam is not an issue.

How can I change the host and domain name that sendmail reports when relaying email?

Here is my sendmail.mc:

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTRUSTED_USER', `smmsp')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`myhost.mydomain.com')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

gilead 01-30-2006 04:56 PM

Sendmail usually gets its host information from the OS via variables. What do you get as your out from sendmail -d0.1 -bv root?

Code:

root@QH112173:~# sendmail -d0.1 -bv root
Version 8.13.5
 Compiled with: DNSMAP LOG MATCHGECOS MILTER MIME7TO8 MIME8TO7
                NAMED_BIND NETINET NETUNIX NEWDB PIPELINING SASLv2 SCANF
                STARTTLS USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = QH112173
  (canonical domain name) $j = QH112173.somedomain.au
        (subdomain name) $m = somedomain.au
              (node name) $k = QH112173
========================================================

Try running these commands hostname and hostname -d to see what your system is set up as. If you have the localhost stuff returned, you can use the hostname command to modify your hostname.

andrewstr 01-30-2006 05:14 PM

"sendmail -d0.1 -bv root" gives me:

Code:

Version 8.12.8
 Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
                MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
                NETUNIX NEWDB NIS PIPELINING SASL SCANF STARTTLS TCPWRAPPERS
                USERDB USE_LDAP_INIT

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = localhost
  (canonical domain name) $j = localhost.localdomain
        (subdomain name) $m = localdomain
              (node name) $k = mail
========================================================

hostname returns "mail"
hostname -d returns nothing

andrewstr 02-21-2006 01:19 PM

fixed!
 
I found the solution. I got the info at:

http://cbl.abuseat.org/sendmailhelp.html


All times are GMT -5. The time now is 06:26 AM.