UNIX mail utility

Hi,
I work on a Middleware application which is installed on Windows, but its file System is on HP UNIX. I am supposed to change the SMTP host address for my application. But I am not able to find the file where the old SMTP host would have been configured/hardcoded. Can anyone assist me on this please? I have checked the mail.jar and MailUtil.java files, but I didnt find my answer. On UNIX I use the mailx Utility to send emails.

It's difficult for us to tell without more information. If you know the host it currently uses, you could search for that.

Under Unix there is a separation of process with different functions. mailx is a mail user agent. It creates a mail from the user and delivers it via sendmail-binary.Look here for an explanation:

linux - Does mailx send mail using an SMTP relay or does it directly connect to the target SMTP server? - Super User

At the linked thread, there is also a possibility howto use mailx with your own preferred smtp-server using command line arguments. Maybe this is an option for you too.

So in short mailx has neither an smtp server configured within itself nor does it even know about that server. There is probably an MTA(Mail Transfer Agent) at your HP-UX Box, which is responsible for sending mails. This MTA(Popular MTAs are postfix and exim, others are courier, sendmail(the above mentioned sendmail-binary and the sendmail-mta are quite different things)). Sometimes there are some simple relay-only-MTAs(like nullmailer), which are just transferring the mail to remote MTA and let that take care of the real mail processing.

Knowing nearly nothing about HP-UX, just assuming that the software-stack is some levels older than under linux, I'm guessing there is some version of the sendmail-mta running. So if available: ask your local sysadmin. :slight_smile: configuring sendmail is fun. Though not the type of fun you are used to.

Configuration files are located standardized within the /etc directory. Somewhere in this directory subtree, the mailserver is configured.

For a start, you may search the /etc directory recursively for your current used mailserver, like this:

grep -r mailserver.domain.tld /etc

You can grep through your application directory too. Of course grep will not find your mailservername if contained inside a compressed file(like a jar).