Operating System - HP-UX
1748214 Members
3262 Online
108759 Solutions
New Discussion юеВ

Re: I want send mails form command line

 
Rogelio Cabrera
Frequent Advisor

Re: I want send mails form command line

Thanks Rita for your help, but still the same. :-(
Tim Nelson
Honored Contributor

Re: I want send mails form command line

As mentioned fix all the errors spurned by sendmail first.


###>Thanks Bill.
I did as you indicated and got the following:
/#>/usr/sbin/sendmail -v rcabrera@ggp.com.mx < /etc/issue
/etc/mail/sendmail.cf: line 0: WARNING: writable directory /etc
/etc/mail/sendmail.cf: line 662: WARNING: writable directory /etc
/etc/mail/sendmail.cf: line 665: WARNING: writable directory /etc
WARNING: writable directory /var
WARNING: writable directory /etc
rcabrera@ggp.com.mx... ggp.com.mx: Name server timeout
rcabrera@ggp.com.mx... Transient parse error -- message queued for future delivery
rcabrera@ggp.com.mx... queued
WARNING: writable directory /etc


AND...
Then the basics. lookup the IP and the mx record for this ggp.com.mx ( this is a really weird domain name)

If you cannot even lookup the name how is it expect to do anything further ?

Do you have permission to forward/relay to this server, if it exists ? If the mail admin has not added you to their allowed list then how do you expect to relay through this host ?


Rogelio Cabrera
Frequent Advisor

Re: I want send mails form command line

Hello Tim.
Only the file /etc/mail/sendmail.cf must be edited?
if I do:
#nslookup mail.ggp.com.mx
Using /etc/hosts on: Apolo
looking up FILES
Name: mail.ggp.com.mx
Address: 192.168.7.15
Aliases: .
#
I do not know if anything more to add some file!!!!!
for eaxample, from linux, i have no problems to send mails.
Bill Hassell
Honored Contributor

Re: I want send mails form command line

> WARNING: writable directory /var
> WARNING: writable directory /etc

These are very serious security problems that should be fixed. Someone with root capability has modified the directory permissions for /etc and /var. The correct permission should be 555, owned by bin:bin. If I saw this on a system, I would immediately run the command:

# swverify

then look at the number of problems reported by swverify. If /usr permissions are also compromised, I would pull the system off the network to protect any important data. I would then try to find out why these changes were made. If these were experiments to fix application problems, I would return all the permissions and ownerships (and missing directories, etc) back to normal with the command:

# swverify -F

Note that this may cause some non-HP programs to have problems and these should be resolved with the owner of the programs. Setting directories and files to 777 or files to 666 is a serious security error.

sendmail errors:
> rcabrera@ggp.com.mx... ggp.com.mx: Name server timeout

This means that your computer does not know how to resolve this hostname (ggp.com.mx). Until these commands return a valid IP address, your system cannot send email to this address directly. Run these commands to find the IP address:

# nsquery hosts ggp.com.mx
# nslookup ggp.com.mx

If no address can be found, your /etc/resolv.conf file and /etc/nsswitch.conf files need fixing.

> from linux, i have no problems to send mails

I am very sure your Linux system has a number of configuration differences that allow email to be sent. Run the same sendmail command I mentioned above:


sendmail -v rcabrera@ggp.com.mx < /etc/issue

Compare that to the HP-UX output.


Bill Hassell, sysadmin
Rogelio Cabrera
Frequent Advisor

Re: I want send mails form command line

hi Bill again, the files /etc/resolv.conf and /etc/nsswitch.con not exist on my server.
My mail server is: 192.168.7.15 and my dns server is 192.168.7.59.
Where should I put these values?
The 2 servers are on my LAN.
I think my case is complicated :-(
Thanks for your patience!!!
Bill Hassell
Honored Contributor

Re: I want send mails form command line

> files /etc/resolv.conf and /etc/nsswitch.con not exist on my server.

That is part of your problem. You have no DNS server configured.

My mail server is: 192.168.7.15 and my dns server is 192.168.7.59.
Where should I put these values?

Someone did not setup your system correctly. Your Linux box will have these values configured correctly. Ask your network administrator to tell you what your domain should be. Then create the DNS file /etc/resolv.conf with this entry:

domain whatever.com
nameserver 192.168.7.59

Then create /etc/nsswitch.conf with these entries:

passwd: files
group: files
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
services: files

Now you should be able to resolve the hostname for your email address:

nslookup gpp.com.mx
nsquery hosts gpp.com.mx

Now fix /etc/sendmail.cf with the mail relay:

DS192.168.7.59

> I think my case is complicated :-(

Not really. You have several configurations that are missing. email depends on proper networking and that isn't correct right now. Once these step are done, run the sendmail -v again and paste the results for us to see.


Bill Hassell, sysadmin
Rogelio Cabrera
Frequent Advisor

Re: I want send mails form command line

I'll think of another option to meet this need.
I have seven years with this server, and until now we have this need to send mail.

Thanks for everything Bill and Good luck.
:-)
Steven E. Protter
Exalted Contributor

Re: I want send mails form command line

Shalom,

sendmail -v -a

This runs the sendmail queue runner, which can provide you diagnostics.

If you are relaying to an Exchange server, do not forget to set up relay for the HP-UX system. this is normally done 1 system at a time, explicitly by IP address.

As far as your original command mailx -s is the equivalent of your original post request.

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