LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2003, 03:44 AM   #1
sarathmohan
LQ Newbie
 
Registered: Sep 2003
Location: India
Distribution: Red Hat Linux 6.0
Posts: 9

Rep: Reputation: 0
Where do I find the mail server name in Linux


Dear Friends,

I hosted a web application in Linux server. Now I want to know how to find out the mail server name (SMTP, POP) to send and receive mails

Please Let me know where I can find the server name/

Thanks in advance
 
Old 09-16-2003, 05:54 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
what server name? it will be the name of the computer it is running on.... please exaplin what you mean a little better.
 
Old 09-16-2003, 06:11 AM   #3
sarathmohan
LQ Newbie
 
Registered: Sep 2003
Location: India
Distribution: Red Hat Linux 6.0
Posts: 9

Original Poster
Rep: Reputation: 0
Sure....

I want to give the SMTP server name (for eg. smtp.yahoo.com) in my JSP file to send mail from our site.

We have a dedicated server for our web application which is running on Linux and I have complete access to this remote server.

I think mail configuration files will tell me the SMTP server name.

Is it same as the machine name? I tried but no mails have been sent.

How can I check the sendmail functionality thru telnet ( I access the remote server thru a Win 2000 Machine)

Please spend a few minutes of your valuable time to help me.

I am newbie to Linux.
 
Old 09-16-2003, 09:31 AM   #4
soob
Member
 
Registered: May 2003
Location: A country town, Australia
Distribution: Debian
Posts: 72

Rep: Reputation: 15
Does this server run an MTA, and if so does it even listen for incoming SMTP? A dedicated web host may not. You can find if it listens easily enough by telneting to port 25: I think this should work from a W2K command line too:

telnet your.server.name 25

If it responds with a server banner, then it's listening. It may tell you what MTA software it runs (= SMTP server). "Connection refused" and "no route" mean it's not. If you want, you can forge an email and see if it comes to you... read RFC 821. But I think that may not be what you need.

Do you want your web application to send mail to you? If so, perhaps you don't need to know what you asked - you just need to know how to pass a message to the MTA. I've configured several CGIs that just want to know how to call sendmail, usually something like "/usr/lib/sendmail -b .." Maybe you need to ask whoever setup the webhost.
 
Old 09-16-2003, 10:10 AM   #5
sarathmohan
LQ Newbie
 
Registered: Sep 2003
Location: India
Distribution: Red Hat Linux 6.0
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you very much soob... for your quick response

I tested the telnet stuff. worked fine... I could be able to go further too.

Now this is the error I am getting...

Mail has not been send successfully sent Error: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 ... relay attempt failed


i changed two files:

/etc/mail/local-host-names
# added my domain name and localhost

/etc/mail/virtusertable
myname@mydomain.com
Restarted the sendmail

# /usr/sbin/sendmail stop
# /usr/sbin/sendmail start

Still the above error comes....
Please help.

Could you please help me to set up sendmail to

send mail in such a way that either sender address or recipient address should be mydomain.com

Thanks in Advance
 
Old 09-16-2003, 09:52 PM   #6
joseph
Member
 
Registered: Jul 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Rep: Reputation: 30
From what i see in your error messages, i guest you didn't do any relay in your server.

Try to do this :

Edit file /etc/mail/access and put your IP there, or maybe yur domain and your hostname too, i mean your network IP.
Shown like this:
xxx.xxx.xxx.xxx RELAY
myhostname.domain.com RELAY
domain.com RELAY

(put a space between your IP and RELAY, myhostname and RELAY, and so on)

save it and making a copy of the access file, cp access relay-domains

Restart your sendmail service and try to mail again and see what is the error messages.
 
Old 09-16-2003, 10:01 PM   #7
joseph
Member
 
Registered: Jul 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Rep: Reputation: 30
Quote:
Originally posted by sarathmohan
Sure....

I want to give the SMTP server name (for eg. smtp.yahoo.com) in my JSP file to send mail from our site.

We have a dedicated server for our web application which is running on Linux and I have complete access to this remote server.

I think mail configuration files will tell me the SMTP server name.

Is it same as the machine name? I tried but no mails have been sent.

How can I check the sendmail functionality thru telnet ( I access the remote server thru a Win 2000 Machine)

Please spend a few minutes of your valuable time to help me.

I am newbie to Linux.

no, mail configuration file will not tell you what is your SMTP server name, if you want to having a name like smtp.yahoo.com, or smtp.yourdomain.com and pop.yourdomain.com, you must have a little bit knowlegde about DNS server coz this stuff must be done in DNS.


You try to telnet xxx.xxx.xxx.xxx 25 where xxx.xxx.xxx.xxx is your machine's IP, if you get a response "OK yourhostname.yourdomain.com sendmail version bla bla" it means your sendmail is working properly.
 
Old 09-17-2003, 01:20 AM   #8
sarathmohan
LQ Newbie
 
Registered: Sep 2003
Location: India
Distribution: Red Hat Linux 6.0
Posts: 9

Original Poster
Rep: Reputation: 0
Dear Friends,

I did exactly as Joseph suggested me to do.

SMTP is working fine. I tested with telnet. I could be able to send messages to webmaster@ip address from my outlook express and could be able to read the same.

Thank you Joseph.

But still I get the same error message when I tried to send from a jsp file.

Could anybody give some resources which explains the complete setup of sendmail in Linux

Regards
Binu
 
Old 09-17-2003, 03:17 AM   #9
joseph
Member
 
Registered: Jul 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Rep: Reputation: 30
Quote:
Originally posted by sarathmohan
Dear Friends,

But still I get the same error message when I tried to send from a jsp file.

Regards
Binu
Can you tell me your meaning above?
 
Old 09-17-2003, 03:33 AM   #10
soob
Member
 
Registered: May 2003
Location: A country town, Australia
Distribution: Debian
Posts: 72

Rep: Reputation: 15
"complete setup of sendmail... " err, slow down, the O'Reilly sendmail book is about 5cm thick. You could start at sendmail.org or the HOWTO on tldp.org.

Before you dive into sendmail (big topic) - here's a quick test you can do from the server's shell prompt: (put in your address, not the one in capitals )

$ ls | mail -s "Test message" YOUR@NORMAL.EMAIL.ADDRESS

If you receive this message (just a list of files) at your normal address, then a program on the box can send email, and sendmail is doing enough.

If relaying is now allowed by sendmail, maybe set the mailserver in your program as 127.0.0.1, or the server's address?

Sory, I don't understand what this JSP is, can't help you with Java...
 
Old 09-17-2003, 04:10 AM   #11
sarathmohan
LQ Newbie
 
Registered: Sep 2003
Location: India
Distribution: Red Hat Linux 6.0
Posts: 9

Original Poster
Rep: Reputation: 0
Dear Joseph,

This is the error message... I still getting when I tried to send a simple mail in a jsp page using javax.mail package



Mail has not been send successfully sent Error: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 ... relay attempt failed

This is the jsp code

<%@ page language="java" import="javax.mail.*,javax.mail.Session,javax.activation.DataSource,javax.activation.FileDataSource, javax.activation.DataHandler,javax.mail.internet.*" %>
<jsp:useBean class='com.indiademocracy.mail.SendMail' id='mail' />
<%
try
{

java.util.Properties properties = System.getProperties();
properties.put("mail.smtp.host","69.xxx.xxx.xxx");//actual IP address here

Session mailSession = Session.getInstance(properties,null);
mailSession.setDebug(false);

MimeMessage mimeMessage = new MimeMessage(mailSession);
mimeMessage.setSubject("Test Message");
mimeMessage.setContent("This is a test message","text/html");

Address fromAddress = new InternetAddress("webmaster@69.xxx.xxx.xxx","webmaster@69.xxx.xxx.xxx");
mimeMessage.setFrom(fromAddress);//actual IP address here...

Address[] toAddress = InternetAddress.parse("webmaster@69.xxx.xxx.xxx");
mimeMessage.setRecipients(Message.RecipientType.TO,toAddress);



Transport.send(mimeMessage);


}//try
catch(Exception e)
{
out.println("Mail has not been send sent");
out.println("Error: "+e.toString());
e.printStackTrace();

}


Thanks for your quick response
 
Old 09-17-2003, 04:32 AM   #12
joseph
Member
 
Registered: Jul 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Rep: Reputation: 30
i think i get your meaning now, but sorry i am not familiar with jsp (java server page) right?

sorry, i cannot help you
but you can do some searching in google.com also in tldp.org, maybe it will help you to solve your problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configure & Connect a Linux mail server from a windows mail clients digihall7 Linux - Networking 4 10-23-2006 01:21 PM
How to have limited mail on a linux server that support unlimited e-mail account mmh Linux - General 3 03-15-2006 07:52 AM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 07:21 AM
Setup a linux server, DNS, WEB, FTP, and Mail Server Help watermelon_lee Linux - Networking 1 08-26-2003 04:09 AM
Linux Mail Server and Exchange Mail vvandam Linux - Networking 10 07-11-2003 05:42 PM


All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration