Can't configure sendmail to send mails to external SMTP Server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can't configure sendmail to send mails to external SMTP Server
# 1  
Old 12-15-2010
Data Can't configure sendmail to send mails to external SMTP Server

Hi all,I know, that this is very common issue, but I can't find where is the problem... I have Solaris 10 installed.I want to send mail to external SMTP server, like:echo "letter body"| mailx -s "subject" test@test.comBut I donno what kind of changes I have to do in /etc/hosts and sendmail.cf or sendmail.mc files...I kindly ask someone to help me to configure the system.Thanks in advance,Roman
# 2  
Old 12-15-2010
/etc/mail/sendmail.cf (depends on sendmail version)
Code:
# Relay all non-local mail to the "Smart" relay host (DS) via smtp:
#      This macro is optional. If you wish to send all non-local mail         
#      to a smart relay via SMTP just set macro S (DS) to the name of the 
#      smart relay.  If this macro is not set, then all mail addresses to     
#      a non-local user will be send to the relay.                             #
 .
 .
 .
# "Smart" relay host (may be null)
DShostname.domain
 .
 .
 .
 .

# 3  
Old 12-15-2010
Further to DGPickett we must ensure that mail server is in /etc/hosts AND the the fully qualified host name of the host server is in /etc/hosts too.
Mentioning the same server twice is deliberate.
It doesn't have to be ".com", this is just an example.

Code:
# Example /etc/hosts with example IP addresses
100.100.100.100 myserver.mydomain.com myserver
101.101.101.101 myemailserver.mydomain.com myemailserver


Hope this helps.
# 4  
Old 12-17-2010
Security bits, I guess!

If all else fails, you can send mail direct to the remote host many different ways. I use a simple script and telnet, but I am pretty sure someone wrote a tool for that. You could slip it in place of mail, mailx and sendmail. All too often, I seem to be on hosts with no easy way to toss a little data out! Of course, if you also need to receive mail, that complicates things a bit.
# 5  
Old 12-21-2010
oh guys, it helped!!!
Thanks so much!!!

But now I have one more question - i can't send mail locally, to root for e.g. Could you please let me know the reason?
Can it be bcz I wrote something wrong in /etc/hosts?

Thanks in advance,
Regards,
Roman
# 6  
Old 12-21-2010
Well, there are a number of sendmail config fields to define when email is for here. Try sending to root@localhost, root@127.0.0.1, other users at localhost. You can test rewrite rules that define when mail is local or not using:
Code:
echo 'mail address' | sendmail -bt

PS: The mnemonic for that option is Become Tester, as opposed to become daemon!

Last edited by DGPickett; 12-21-2010 at 01:08 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Configure sendmail with SMTP

Hello, I'm trying to configure sendmail with SMTP authentication on a SunOS 5.11 operating system. I have been read various documentation / tutorials and unfortunately is not working. I need help from someone who has configured smtp on this operating system. When I try to send a mail, I have... (2 Replies)
Discussion started by: d4rkm4nx99
2 Replies

2. Solaris

Solaris - Sendmail - Adding .com.gr in external senders e-mails

Hello Everybody ! I'm Harry from Athens Greece and i have a problem with my Sendmail 8.13.3 installed on Solaris SunOS ultra 5.10. The problem is that when someone sends to us an e-mail and his e-mail address is like : xxxx@xxxx.com, our e-mail server adds up in the senders address a .com.gr... (2 Replies)
Discussion started by: Mcasim
2 Replies

3. Red Hat

External SMTP server

Hi, We current use an email/hosted exchange server (provided by 3rd party company). Our production DNS (RH5) server has got the MX rec configured for this 3rd party mail relay server. So in order to resolve hostnames to send outbound mails an A record entry is also required on the external... (1 Reply)
Discussion started by: Duffs22
1 Replies

4. Solaris

Unable to send mails to external mailids from solaris 10

Hi, Iam not able to send mails from solaris servers to external mailid (gmail,yahoo).I am able to send mails to internal mailids with in network. Requesting you all to please help me to resolve this issue. Thanks in advance. Venkat (2 Replies)
Discussion started by: venkatasiva85
2 Replies

5. Shell Programming and Scripting

Send email from sendmail on AIX using exchange server as SMTP server

i am new in AIX i am trying to write a script to take a backup for specific files on server to and check error log if backup success send email to administrator , script done except for sending mail , i try to configure sendmail on aix to use our exchange server to send emails but still get error... (0 Replies)
Discussion started by: ahmed_salah
0 Replies

6. UNIX for Dummies Questions & Answers

Steps to configure sendmail to receive e-mails

Hi Unix Gurus, Please help me out here. Please tell me the steps to conigure sendmail to receive emails (same way we configure outlook client in windows)? Thanks in advance. -Dejavu (1 Reply)
Discussion started by: DejaVu
1 Replies

7. SCO

SCO 5.0.7 Sendmail. Need help on how to configure SMTP

Did anyone know or can provide some instructions on how to setup smtp for sendmail. All I need to do is email files from sco thru my ISP smtp provider. please help (3 Replies)
Discussion started by: miles556
3 Replies

8. UNIX for Advanced & Expert Users

Configure SMTP Server for Unix

Hi, We had an upgrade today morning and since then mailx command is not working. I have been told to change the DNS to use host name as smtp.companyname.com instead of the IP address. Can someone please help me out to know where can I change this on a Unix Server. Thanks Aman (5 Replies)
Discussion started by: chawlaaman
5 Replies

9. SuSE

How to configure Suse Enterprise Linux 9.0 for sending mails to smtp server...???

Hi All, I have a system running with Suse Enterprise Linux 9.0. xyz# uname -a Linux xyz 2.4.21-291-smp #1 SMP Tue May 24 14:07:45 UTC 2005 i686 unknown I would like to configure postfix on this system for sending mails as a root user using "mail" command to smtp server (Windows System)... (5 Replies)
Discussion started by: jumadhiya
5 Replies

10. Solaris

how to send mails to users on exchange server from sendmail/solaris(mailx)

Hi, Can anyone pls. tell me how to access Active directory from solaris. I am looking at solution by which I can send mail notification from the logs generated by scripts, to the users on Exchange server. I am trying for a Perl-LDAP module , but don't realy know how to go for it (5 Replies)
Discussion started by: ganeshh
5 Replies
Login or Register to Ask a Question