1833848 Members
2252 Online
110063 Solutions
New Discussion

Re: sendmail

 
Maurizio Fulli
Advisor

sendmail

i try to send an e-mail from my hp host, but i can't.
I've configured the resolv.conf and nsswitch file, if i discover my dns server, it is up, but when i send an e-mail i've the following message:
To: root@hostname.mydomainname.it
Subject: Returned mail: Host unknown (Name server: mydomainname.it.: no data known)
Auto-Submitted: auto-generated (failure)

How can i masquerade root and my hostname when i send the mail? In what thing do i make mistake? Is sendmail configured right?

regards
Maurizio
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: sendmail

You have a few options.

The Dj opttion.

In sendmail
# Dj$foo.com

DJyourdomain.it

You can also change the hostname in /etc/rc.config.d/netconf to host.yourdomain.it

Thats a radical step.

Diagnostic:

sendmail -v -d8.99 -d38.99 target@yourdomain.it

Type a message

.

thats type a period(dot) and hit enter.

You'll get specific diagnostics that you can act on.

You indicate that nslookup works for the target domain, thats important, your system needs to get the mx record.


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mark Greene_1
Honored Contributor

Re: sendmail

You need to edit the sendmail.cf file and set the DM option to your primary domain. This has the effect of removing the hostname portion of the from address. Be sure to stop and restart the sendmail daemon process after making the config change.

HTH
mark
the future will be a lot like now, only later
Steven E. Protter
Exalted Contributor

Re: sendmail

Though I've just recommended it, with the increasing need to add spam protection and other directives, it might be better to edit the sendmail.mc file and then generate hash databases.

Attached is a rough script for hp-ux

Same basic directives, but all the prior recommendations, including my own will have to be hand edited every time you rebuild the hash databases.

See attachement.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kevin Wright
Honored Contributor

Re: sendmail

To masquerade, you can set the DM and CE macros, if available in you sendmail.cf file. Here is an example sendmail.mc file to generate a new sendmail.cf file to relay and masquerade.

OSTYPE(`solaris8')
DOMAIN(generic)dnl
FEATURE(smrsh)dnl
FEATURE(use_ct_file)dnl
FEATURE(use_cw_file)
FEATURE(`relay_entire_domain')
MASQUERADE_AS(domain.net)
FEATURE(allmasquerade)
FEATURE(masquerade_envelope)
FEATURE(`relay_entire_domain')
define(`SMART_HOST', `relayserver')
define(`confTO_CONNECT', `1m')dnl
define(`confTO_IDENT', `0s')dnl
define(`confDONT_EXPAND_CNAMES', `True')dnl
define(`confMAX_MESSAGE_SIZE', `1000000')
EXPOSED_USER(`root')
MAILER(smtp)
MAILER(local)
(`confDEF_USER_ID',``smmsp:smmsp'')
Maurizio Fulli
Advisor

Re: sendmail

I've changed Dj variable, in this way:
Dj$w.mydomain.it

but when i run this command sendmail -v -d8.99 -d38.99 usermail@domain.it

i sent the mail as root@mydomain.it, i can't masquerade root, if i change the DM variables i sent the mail as root@$DM....?

How can i do?
Please help me

Regards
Steven E. Protter
Exalted Contributor

Re: sendmail

in sendmail.cf

Change
Dj$w.mydomain.it

to

Djmydomain.it

save the file

/sbin/inti.d/sendmail stop
/sbin/inti.d/sendmail start

Re-run the mail diagnostic and post the out put if you get bad results.

Please consider assigning points if we have been helpful.

thanks.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Maurizio Fulli
Advisor

Re: sendmail

Steven
what is the mx record?
This record need only if i want to send and receive mail?
If i want only send mail?
If its needed, where do i ask for it?

Thanks
Kevin Wright
Honored Contributor

Re: sendmail

As I mentioned, you masquerade with the DM macros, not DJ. CE is a list of usernames the are NOT masqueraded, usually set to root, but can be left empty is you so wish.