LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-22-2012, 05:45 AM   #1
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Rep: Reputation: Disabled
how to send mails on local network from one computer to another computer


Hi,

How to send mail's in local network from one computer to another computer.

I have configured sendmail and dovecot in both computers,
both are in same domain,

my access(/etc/mail/access.cof) file configuration is same in both computer's i.e
Connect:suresh.com RELAY

Computer one :-
Hostname : admin.suresh.com
username : shiva

Computer two :-
Hostname : desktop4.suresh.com
Username : ramesh

Here I can send mail's in both computer's for their respective user's only, but I am unable to send mail from 1st computer to user of second computer.


Example's of how I am sending mail to different computer's
[root@suresh] mail -s "test" shiva@admin.suresh.com ----- working fine
[shiva@suresh] mail -s "test" root@admin.suresh.com ------ working fine

[root@suresh] mail -s "test" ramesh@desktop4.suresh.com ----- not working


Thanks
Suresh

Last edited by suresh.k; 11-22-2012 at 05:46 AM.
 
Old 11-22-2012, 05:56 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
So what does /var/log/maillog or equivalent say?
 
Old 11-22-2012, 06:37 AM   #3
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
[root@admin log]# tailf /var/log/maillog

Nov 22 18:06:34 admin sendmail[11361]: qAMCaY9j011361: from=root, size=67, class=0, nrcpts=1, msgid=<201211221236.qAMCaY9j011361@admin.suresh.com>, relay=root@localhost
Nov 22 18:06:34 admin sendmail[11362]: qAMCaYmw011362: from=<root@admin.suresh.com>, size=358, class=0, nrcpts=1, msgid=<201211221236.qAMCaY9j011361@admin.suresh.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Nov 22 18:06:34 admin sendmail[11361]: qAMCaY9j011361: to=rajesh@desktop4.suresh.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30067, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (qAMCaYmw011362 Message accepted for delivery)
Nov 22 18:06:34 admin sendmail[11364]: qAMCaYmw011362: to=<rajesh@desktop4.suresh.com>, ctladdr=<root@admin.suresh.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120358, relay=desktop4.suresh.com. [192.168.10.201], dsn=4.0.0, stat=Deferred: Connection refused by desktop4.suresh.com.
 
Old 11-22-2012, 06:51 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by suresh.k View Post
Nov 22 18:06:34 admin sendmail[11361]: qAMCaY9j011361: to=rajesh@desktop4.suresh.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30067, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (qAMCaYmw011362 Message accepted for delivery)
Nov 22 18:06:34 admin sendmail[11364]: qAMCaYmw011362: to=<rajesh@desktop4.suresh.com>, ctladdr=<root@admin.suresh.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120358, relay=desktop4.suresh.com. [192.168.10.201], dsn=4.0.0, stat=Deferred: Connection refused by desktop4.suresh.com.
So what does maillog say on desktop4.suresh.com?
 
Old 11-22-2012, 06:58 AM   #5
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
So what does maillog say on desktop4.suresh.com?
Nothing,
Not generating any log's on /var/log/maillog of desktop4.suresh.com
 
Old 11-22-2012, 07:26 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Can you telnet to 192.168.10.201 and make it accept a message from the command line?
 
Old 11-22-2012, 08:27 AM   #7
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Can you telnet to 192.168.10.201 and make it accept a message from the command line?
[root@admin ~]# telnet 192.168.10.201
Trying 192.168.10.201...
telnet: connect to address 192.168.10.201: Connection refused
 
Old 11-22-2012, 08:35 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Is the MTA running?
Else check the firewall?
 
Old 11-22-2012, 08:38 AM   #9
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Sorry..
at that time telnet server was not installed on desktop4.suresh.com.. so i installed it now
it was working now


[root@admin ~]# telnet 192.168.10.201
Trying 192.168.10.201...
Connected to 192.168.10.201.
Escape character is '^]'.
CentOS release 5.5 (Final)
Kernel 2.6.18-194.el5 on an i686
login: ramesh
Password:
Last login: Thu Nov 22 21:20:01 from admin.suresh.com
[ramesh@desktop4 ~]$
 
Old 11-22-2012, 08:41 AM   #10
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Is the MTA running?
Else check the firewall?
MTA is running fine
and firewall is disabled on both computers
 
Old 11-22-2012, 09:07 AM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by suresh.k View Post
at that time telnet server was not installed on desktop4.suresh.com.. so i installed it now
OK, please remove the telnet server package. I should have spelled out you telnet from admin.suresh.com to desktop4.suresh.com on port TCP/25 to test if the MTA can be contacted and if it accepts a message:
Code:
]$ telnet desktop4.suresh.com 25
EHLO jilaiya
MAIL FROM: ravana@admin.suresh.com
RCPT TO: kali@desktop4.suresh.com
DATA
SUBJECT: I am son of Comander of Army [ NOT SPAM] of former Presdent of Countyr, who crashed with car, and have busenes oppertuneteh for yous! Makeh Moneys now!!!!
.
QUIT
 
Old 11-22-2012, 09:25 AM   #12
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
OK, please remove the telnet server package. I should have spelled out you telnet from admin.suresh.com to desktop4.suresh.com on port TCP/25 to test if the MTA can be contacted and if it accepts a message:
Code:
]$ telnet desktop4.suresh.com 25
EHLO jilaiya
MAIL FROM: ravana@admin.suresh.com
RCPT TO: kali@desktop4.suresh.com
DATA
SUBJECT: I am son of Comander of Army [ NOT SPAM] of former Presdent of Countyr, who crashed with car, and have busenes oppertuneteh for yous! Makeh Moneys now!!!!
.
QUIT
Ok
Removed telnet-server from both admin.suresh.com and desktop4.suresh.com and then tried to connect telnet from admin.suresh.com to desktop4.suresh.com with port 25

[root@admin ~]# telnet desktop4.suresh.com 25
Trying 192.168.10.201...
telnet: connect to address 192.168.10.201: Connection refused

Last edited by suresh.k; 11-22-2012 at 09:27 AM.
 
Old 11-22-2012, 09:44 AM   #13
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by suresh.k View Post
telnet: connect to address 192.168.10.201: Connection refused
Is that the only line it returns or does it also say "telnet: Unable to connect to remote host: Connection refused" after that?

Now log in to desktop4.suresh.com, be root and post the output of:
Code:
pgrep -lf sendmail
pgrep sendmail|while read P; do lsof -Pwlnp $P -ai; done 
# or: netstat -antlpe|grep sendmail
grep ^O.*Addr= /etc/mail/submit.cf /etc/mail/sendmail.cf
 
Old 11-26-2012, 12:18 AM   #14
suresh.k
Member
 
Registered: Aug 2011
Location: Hyderabad, AP, India
Distribution: centos, Ubuntu
Posts: 163
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Is that the only line it returns or does it also say "telnet: Unable to connect to remote host: Connection refused" after that?
When i am trying to connect telnet to desktop4.suresh.com from admin.suresh.com it is showing only
Trying 192.168.10.201...
telnet: connect to address 192.168.10.201: Connection refused,
But when trying to connect telnet from desktop4.suresh.com to admin.suresh.com it is showing
telnet: connect to address 192.168.10.53: Connection refused
telnet: Unable to connect to remote host: Connection refused

Quote:
Now log in to desktop4.suresh.com, be root and post the output of:
Code:
pgrep -lf sendmail
pgrep sendmail|while read P; do lsof -Pwlnp $P -ai; done 
# or: netstat -antlpe|grep sendmail
grep ^O.*Addr= /etc/mail/submit.cf /etc/mail/sendmail.cf
[root@desktop4 ~]# pgrep -lf sendmail
2282 sendmail: accepting connections
2290 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue

[root@desktop4 ~]# pgrep sendmail|while read P; do lsof -Pwlnp $P -ai; done
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sendmail 2282 0 4u IPv4 7446 TCP 127.0.0.1:25 (LISTEN)

[root@desktop4 ~]# netstat -antlpe|grep sendmail
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 0 7446 2282/sendmail: acce

[root@desktop4 ~]# grep ^O.*Addr= /etc/mail/submit.cf /etc/mail/sendmail.cf
/etc/mail/submit.cf:O DaemonPortOptions=Name=NoMTA, Addr=127.0.0.1, M=E
/etc/mail/sendmail.cf:O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

Thanks
Suresh
 
Old 11-27-2012, 05:58 AM   #15
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,988
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by suresh.k View Post
Code:
[root@desktop4 ~]# pgrep -lf sendmail
2282 sendmail: accepting connections
2290 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
So sendmail processes are running, except...


Quote:
Originally Posted by suresh.k View Post
Code:
[root@desktop4 ~]# pgrep sendmail|while read P; do lsof -Pwlnp $P -ai; done 
COMMAND   PID     USER   FD   TYPE DEVICE SIZE NODE NAME
sendmail 2282        0    4u  IPv4   7446       TCP 127.0.0.1:25 (LISTEN)

[root@desktop4 ~]# netstat -antlpe|grep sendmail
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      0          7446       2282/sendmail: acce
only the Mail Transport Agent (MTA) listens and not the Mail Submission Agent (MSA), plus the MTA has a default configuration because it only listens on the loopback device...


Quote:
Originally Posted by suresh.k View Post
Code:
[root@desktop4 ~]# grep ^O.*Addr= /etc/mail/submit.cf /etc/mail/sendmail.cf
/etc/mail/submit.cf:O DaemonPortOptions=Name=NoMTA, Addr=127.0.0.1, M=E
/etc/mail/sendmail.cf:O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
...which its configuration confirms. Sorry for the late reply but you need to add two lines to /etc/mail/sendmail.cf: one for the MTA to listen on the LAN IP plus one for the MSA (DaemonPortOptions=Port=submission).
 
  


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
Finding active computer in local network. greyblake Linux - Networking 2 10-10-2011 05:12 PM
Postfix - send mail from one local computer to another local computer Runge_Kutta Linux - Software 3 01-09-2010 07:08 AM
How do addresses get associated with computer names on a local network? SwissHeritage Slackware 5 03-27-2009 08:02 PM
How to setup computer to computer network between Mandriva and Mac? ssass21 Mandriva 3 01-18-2007 03:46 AM
Updating Computers from a local Network computer jrott32 Linux - Networking 7 09-28-2005 08:42 PM


All times are GMT -5. The time now is 01:10 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration