LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2004, 07:23 AM   #1
ricky_ds
Member
 
Registered: Aug 2004
Location: Bern, Switzerland
Distribution: Kubuntu, FC, RHEL
Posts: 48
Blog Entries: 2

Rep: Reputation: 17
Problems sending mail from one local machine to the other


Hi all,

I have two FC boxes in an intranet, let's call them box1.intranet.com and box2.intranet.com.

I've configured postfix on box1 and sendmail on box2 and can send mail without any problem to an external e-mail address, say joe@example.com. But if I send the mail to root@box1 (from box2, it gets delivered to the mailbox of postfix and not root. Why?

Let me explain how I send the mail, what logs I get in /var/log/maillog and finally what my main.cf configuration file looks like.

I sent the two mails from the command line:
Code:
# mail -s "Test to outside" joe@example.com
Hello World
Cc:
# mail -s "Test to intranet" root@box1
Hello World
Cc:
Here is the maillog on box 2
Code:
Nov 11 13:04:38 box2 sendmail[6524]: iABD4cBA006524: from=root, size=71, class=0, nrcpts=1, msgid=<200411111304.iABD4cBA006524@localhost.localdomain>, relay=root@localhost
Nov 11 13:04:38 box2 sendmail[6526]: iABD4cJ4006526: from=<root@localhost.localdomain>, size=381, class=0, nrcpts=1, msgid=<200411111304.iABD4cBA006524@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=box2 [127.0.0.1]
Nov 11 13:04:38 box2 sendmail[6524]: iABD4cBA006524: to=joe@example.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30071, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (iABD4cJ4006526 Message accepted for delivery)
Nov 11 13:04:39 box2 sendmail[6528]: iABD4cJ4006526: to=<joe@example.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30381, relay=mail.example.com. [xxx.xxx.xxx.xxx], dsn=2.0.0, stat=Sent (OK)
Nov 11 13:10:40 box2 sendmail[6536]: iABAGQUO008543: to=<root@box2.intranet.com>, delay=02:54:14, xdelay=00:00:00, mailer=esmtp, pri=301418, relay=box2.intranet.com. [yyy.yyy.yyy.8], dsn=4.0.0, stat=Deferred: Connection refused by box2.intranet.com.
Nov 11 13:10:40 box2 sendmail[6536]: iAAAeu81008055: to=<root@box2.intranet.com>, delay=1+02:27:28, xdelay=00:00:00, mailer=esmtp, pri=930043, relay=box2.intranet.com., dsn=4.0.0, stat=Deferred: Connection refused by box2.intranet.com.
Nov 11 13:12:00 box2 sendmail[6539]: iABDC0hY006539: from=root, size=54, class=0, nrcpts=1, msgid=<200411111312.iABDC0hY006539@localhost.localdomain>, relay=root@localhost
Nov 11 13:12:00 box2 sendmail[6541]: iABDC0TG006541: from=<root@localhost.localdomain>, size=363, class=0, nrcpts=1, msgid=<200411111312.iABDC0hY006539@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=box2 [127.0.0.1]
Nov 11 13:12:00 box2 sendmail[6539]: iABDC0hY006539: to=root@box1, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30054, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (iABDC0TG006541 Message accepted for delivery)
Nov 11 13:12:00 box2 sendmail[6543]: iABDC0TG006541: to=<root@box1.intranet.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30363, relay=box1.intranet.com. [yyy.yyy.yyy.11], dsn=2.0.0, stat=Sent (Ok: queued as 41CD7717BC)
(Note the stat=Sent (Ok: queued as 41CD7717BC) at the end of the last line above, and how it reappears on box1)

and on box 1
Code:
Nov 11 13:10:40 box1 postfix/smtpd[8048]: connect from box2.intranet.com[yyy.yyy.yyy.8]
Nov 11 13:10:40 box1 postfix/smtpd[8048]: 41CD7717BC: client=box2.intranet.com[yyy.yyy.yyy.8]
Nov 11 13:10:40 box1 postfix/cleanup[8050]: 41CD7717BC: message-id=<200411111312.iABDC0hY006539@localhost.localdomain>
Nov 11 13:10:40 box1 postfix/nqmgr[7775]: 41CD7717BC: from=<root@localhost.localdomain>, size=791, nrcpt=1 (queue active) Nov 11 13:10:40 box1 postfix/smtpd[8048]: disconnect from box2.intranet.com[yyy.yyy.yyy.8]
Nov 11 13:10:40 box1 postfix/local[8053]: 41CD7717BC: to=<postfix@box1.intranet.com>, orig_to=<root@box1.intranet.com>, relay=local, delay=0, status=sent (mailbox)
Finally, here is my main.cf configuration file on box1.

Code:
# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = intranet.com
myhostname = box1.intranet.com
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.0.16/README_FILES
sample_directory = /usr/share/doc/postfix-2.0.16/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 450
Is there a problem with my configuration? or do you have hints on where else to look?

Greetings and thanks in advance.

Last edited by ricky_ds; 11-11-2004 at 07:53 AM.
 
Old 11-11-2004, 07:43 AM   #2
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Box 2 is configured to use sendmail, not postfix. You might want to fix that problem first. i.e. system-switch-mail
 
Old 11-11-2004, 07:57 AM   #3
ricky_ds
Member
 
Registered: Aug 2004
Location: Bern, Switzerland
Distribution: Kubuntu, FC, RHEL
Posts: 48

Original Poster
Blog Entries: 2

Rep: Reputation: 17
scowles, I've just noticed that box2 was _again_ configured with sendmail. Thanks for your hint of system-switch-mail.

So anyways, it doesn't matter with which MTA the mail gets sent. The problem is obviously on box1 which doesn't correctly route the mail...
 
Old 11-11-2004, 08:17 AM   #4
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
So what happens when you send an e-mail to: mail -s "Test to intranet" root@box1.intranet.com

Note the use of the FQDN in the e-mail address.
 
Old 11-11-2004, 08:26 AM   #5
ricky_ds
Member
 
Registered: Aug 2004
Location: Bern, Switzerland
Distribution: Kubuntu, FC, RHEL
Posts: 48

Original Poster
Blog Entries: 2

Rep: Reputation: 17
No big change. Note that I sync-ed the clocks of both computers. My initial post had a difference of about 2 minutes between both machines. In the mean time I've also switched the MTA to postfix on both computers and rebooted them for checking that the right service was started. I've also emptied the queues so that no other mail is polluting the logs. Here they are:

box2 logs:
Code:
Nov 11 15:17:42 box2 postfix/pickup[6179]: E4BB831FB2: uid=0 from=<root>
Nov 11 15:17:42 box2 postfix/cleanup[6510]: E4BB831FB2: message-id=<20041111141742.E4BB831FB2@box2.intranet.com>
Nov 11 15:17:42 box2 postfix/nqmgr[6180]: E4BB831FB2: from=<root@box2.intranet.com>, size=343, nrcpt=1 (queue active)
Nov 11 15:17:43 box2 postfix/smtp[6512]: E4BB831FB2: to=<root@box1.intranet.com>, relay=box1.intranet.com[10.218.226.11], delay=1, status=sent (250 Ok: queued as ED4DC717B1)
box1 logs:
Code:
Nov 11 15:17:43 box1 postfix/smtpd[3040]: connect from box2.intranet.com[10.218.226.8]
Nov 11 15:17:43 box1 postfix/smtpd[3040]: ED4DC717B1: client=box2.intranet.com[10.218.226.8]
Nov 11 15:17:44 box1 postfix/cleanup[3042]: ED4DC717B1: message-id=<20041111141742.E4BB831FB2@box2.intranet.com>
Nov 11 15:17:44 box1 postfix/smtpd[3040]: disconnect from box2.intranet.com[10.218.226.8]
Nov 11 15:17:44 box1 postfix/nqmgr[2016]: ED4DC717B1: from=<root@box2.intranet.com>, size=560, nrcpt=1 (queue active)
Nov 11 15:17:44 box1 postfix/local[3045]: ED4DC717B1: to=<postfix@box1.intranet.com>, orig_to=<root@box1.intranet.com>, relay=local, delay=1, status=sent (mailbox)
 
Old 11-11-2004, 08:37 AM   #6
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
Check /etc/aliases or /etc/postfix/aliases
In most postfix installations on most systems, root is an alias for some other user, root's e-mail is delivered to this other user, not /var/spool/mail/root
 
Old 11-11-2004, 08:48 AM   #7
ricky_ds
Member
 
Registered: Aug 2004
Location: Bern, Switzerland
Distribution: Kubuntu, FC, RHEL
Posts: 48

Original Poster
Blog Entries: 2

Rep: Reputation: 17
r0b0, thanks, you hit the nail.

I had the following in /etc/postfix/aliases:

Code:
# Person who should get root's mail.  This alias
# must exist.
# CHANGE THIS LINE to an account of a HUMAN
root:           postfix

# Note to the user: You must create the alias above!
# The root alias *must* exist under postfix because
# postfix runs as a non-privileged user and cannot
# touch a spool file which is UID/GID root
# The mapping to the postfix user is to ensure that root's mail
# doesn't get lost on a system installed out of the box.
# mailman aliases
I changed it accordingly.
 
  


Reply



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
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
local mail on a 2 machine network tireseas Linux - Networking 4 01-25-2005 07:57 AM
Sending mail with PHP on linux machine through exchange on Windows server 2003 TVScoundrel Linux - Networking 2 06-18-2004 12:02 PM
Fetching mail from remote POP and sending it to local SMTP leshka_uk Linux - Software 1 02-27-2004 07:38 AM
postfix : sending local mail without domain iainr Linux - Software 2 12-10-2003 03:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:00 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
Open Source Consulting | Domain Registration