Solved

send mail to to my address

Posted on 2010-08-18
9
554 Views
Last Modified: 2013-12-21
Hi All

I need to send mail to my email @my Company Mail Server
the server I want to send from is Solaris 10, we have Exchange mail server.

what are the steps to do that ??


Thank you
0
Comment
Question by:omar2010
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 1

Accepted Solution

by:
dendob earned 400 total points
ID: 33463679
Establish the machine that you are/will be using as your email 'gateway'.

Is it a machine under your control, or is it at your ISP ?
2) 'equate' that machine's IP address (in your DNS or /etc/hosts) with the machine name 'mailhost' (and/or 'mailhost.domain.com'). If you are using /etc/hosts, then the line should look like this:

    "10.4.5.6 mailhost.domain.com mailhost"

3) You could also 'grep' for the word 'mailhost' in your sendmail.cf file and replace the line that looks like
"DSmailhost.$w" with "DSISP-mailhost.ISP.com"

The first problem you are having is that while sending this email, your local sendmail is looking to connect to port 25 on the host 'mailhost' (this is a 'Sun-ism').
Since you have no host defined as 'mailhost' you cannot connect, and the mail fails.

So you either have to change the name of the host that sendmail is looking for (in the sendmail.cf file), or DEFINE a host named 'mailhost' for the local sendmail to
connect to (in DNS, or the /etc/hosts file).

The PROPER way to do this is to have an MX record in DNS that points to the "mail exchanger' that your domain is supposed to be using.
This will either be a 'Mail hub' that you maintain, or the 'Mail hub' that your ISP told you to use to send mail.

There may yet be other problems, but you cannot discover them until you correct this one.

The following link will help you with the mailx command:

http://aplawrence.com/SCOFAQ/FAQ_scotec6mailxmutt.html

Regards
0
 
LVL 9

Assisted Solution

by:amolg
amolg earned 100 total points
ID: 33463875
mailx "your email id"
enter the subjet
enter the body text
<cntrl - d>

Check if you get the mail, if not you have to follow the steps what dendob has suggested.
0
 
LVL 9

Expert Comment

by:Barry Gill
ID: 33463916
do you want to do this for a user, from the command line, as part of a scripted process or provide details to an application that sends mail reports?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 78

Expert Comment

by:arnold
ID: 33464217
Could you provide a more detailed explanation on what it is you want to do?
echo "From: <youremailaddress>
To: <recipientaddress.
Subject: <suject of the message>

<the message>
" | /usr/lib/sendmail -oi -t

0
 
LVL 1

Author Comment

by:omar2010
ID: 33490755
dendob your steps not clear to me, the Solaris machine I am talking about is under my control, when I execute "grep mailhost /etc/mail/sendmail.cf"
I get this output:
O FallbackSmartHost=mailhost$?m.$m$.

amolg I try your step doesn't work as you said I should go with dendob steps first
barrulus yes I want to this as part of a scripted process.

arnold what I need to do is how to send mail from shell to my company mail address, I want to use this laster to send me alert to my email.

Thank you
0
 
LVL 9

Expert Comment

by:Barry Gill
ID: 33490871
find in your sendmail.cf file the line that starts with "DS"
this line should read: DShostnameofyourcompanymailserver.com

The hostname should be one that the soalris box can resolve internally.

Your mailserver should be available on port 25 as the DS line creates a smarthost and all mail not handled by the local machine will be delivered there.
0
 
LVL 2

Expert Comment

by:Mohan Shivaiah
ID: 33547543
To send a mail from solaris to your company mail server
mailx -s "sujbect" <yourmailid@yourcompany_domain>
enter the body text
<cntrl - d>
OR
mailx -s "sujbect" <yourmailid@yourcompany_domain>  < body_of_the_text
OR
cat <body_of_the_text>  | mailx -s "sujbect" <yourmailid@yourcompany_domain>

body_of_the_text=create a file and put the content in this file.

0
 
LVL 2

Expert Comment

by:Mohan Shivaiah
ID: 33547553
Make sure your solaris server  sendmail.cf has DS entry with the relay server details.
0
 
LVL 1

Author Closing Comment

by:omar2010
ID: 33552168
Thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ORA-00972: identifier is too long from Unix but not from Windows in SQLPLUS 17 108
Handling abuse of email address 7 49
Delayed Email Deliveries 5 42
Exchange 2016 OWA 3 50
Automapping, a wonderful feature with Exchange 2010 (SP2 onwards I believe), allows additional/Shared mailboxes that a user has access to be automatically mapped on Outlook client, simplifying the process by adding them while Outlook launches. Ho…
Easy CSR creation in Exchange 2007,2010 and 2013
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question