1752716 Members
5775 Online
108789 Solutions
New Discussion юеВ

Re: Sendmail

 
SOLVED
Go to solution
CLUTIER
Advisor

Sendmail

I have a HP9000 in 11.0
I would like to create a script which send a mail to my Windows account.I have a workstation in Win2000 and the HP servers have no domain.
7 REPLIES 7
Ian Dennison_1
Honored Contributor

Re: Sendmail

If you have already configured the Sendmail system to talk to your Windows Mail Server, the command to send a mail is,...

sendmail bob@bob.com
where /tmp/textfile is the text to be sent. Alternatively you can specify a "To:" address in the first line of the textfile, and use the '-f' option of sendmail.

if you have not yet set up mail relaying, here are some starter posts,...

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1d93107d277ad611abdb0090277a778c,00.html

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xfefda12d6d27d5118fef0090279cd0f9,00.html


http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa8b014a24fd1d4118fef0090279cd0f9,00.html

This is a very big area to look at.

Share and Enjoy! Ian
Building a dumber user
David_246
Trusted Contributor

Re: Sendmail

Hi,

If you installed unix, I think in all variants sendmail gets installed as well. The important thing to do is to set your mailserver.

Just change in the /etc/mail/sendmail.cf you mailhost :
# "Smart" relay host (may be null)
DS...
So f.e.:
DSsmtp.intern.company.nl

If you use your Windows machine here (must be a smart relay !!) There is another way to use some more advantage of sendmail :

----------------------
echo "From: $sender" > $TMP/file.$$
echo "To: $recepient" | /usr/bin/tr -cd '[\040-\176]' >> $TMP/file.$$
echo "" >> $TMP/start-mail.$$
echo "Subject: $subject" | /usr/bin/tr -cd '[\040-\176]' >> $TMP/file.$$
echo "" >> $TMP/start-mail.$$
echo "$message" | /usr/bin/tr -cd '[\040-\176]' >>/$TMP/file.$$
echo "\n." >>/$TMP/file.$$

cat $TMP/file.$$ - | /usr/lib/sendmail -odq -t
/bin/rm -f $TMP/start-mail.$$
-------------------------

This script allowes you to set your own sender adres, To adres, subject and message. Make sure you use the 'echo "\n."' This means it is the end of the message, but must start at the beginning of the new line. It works very nice.

If you need any more help, please let us know.

Regs David
@yourservice
David_246
Trusted Contributor

Re: Sendmail

Hhhmm,

Made a couple mistakes here :

1) TMP=/tmp
2) $$ is a standard for current process, so should not be defined. Leave it as it is.
3) the tr command converts bad characters
4) /bin/rm -f $TMP/start-mail.$$ should be :
/bin/rm -f $TMP/file.$$

5) I think it is clear that you must add your windows machine behind the DS, or your smart relay server. I didn't finish my sentence before I started a new subject.

Must be monday morning :)

Regs David
@yourservice
CLUTIER
Advisor

Re: Sendmail

The mail server is running. if i want to send a mail to me, i have :
NIS map mail.aliases specified,but NIS not running:Socket operation on non socket.
I don't want to use NIS.
My user is on a winNT domain perhaps should i notice the DNS server addrs.

Michael Knaup
Advisor
Solution

Re: Sendmail

You should change your aliases entry in the /etc/nsswitch.conf from:

aliases files nis

to:

aliases files


If you don't have an /etc/nsswitch.conf, create one out of the examples within the /etc directory or see "man nsswitch.conf".
Steven E. Protter
Exalted Contributor

Re: Sendmail

This one can even include attachements.

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
Michael Knaup
Advisor

Re: Sendmail

Thanks for the hint. I'm a newbie to this forum and didn't notice.

So here is an example of a nsswitch.conf for files only, which could help hopefully.