<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm not very familiar with postfix. I think you have to set "relayhost
= ip or host name of  CentOS relayin server" parameter in 5 Linux
servers which are relaying there's mails via CentOS server.<br>
<br>
Try this.<br>
<br>
Thanks<br>
<br>
Joshua Gimer wrote:
<blockquote
 cite="mid:cf939bff0901011404u63919a9w47cea7907f828705@mail.gmail.com"
 type="cite">
  <pre wrap="">On Thu, Jan 1, 2009 at 4:26 AM, ankush grover <a class="moz-txt-link-rfc2396E" href="mailto:ankushcentos@gmail.com"><ankushcentos@gmail.com></a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Friends,

I have configured Postfix mail server on Centos  for relaying mails
from 5 linux servers (including itself) within the same LAN. The
postfix mail server should relay mails from these 5 linux servers for
specific domains only. For example hosts 192.168.0.23/24/25/26/27 and
the postfix mail server should only be able to receive and send mails
from and to example.com,example2.com and example3.com domains only.
Below is the configuration of the postfix mail server

myhostname = test.example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks_style = subnet
mynetworks = 192.168.0.23/32,192.168.0.24/32,192.168.0.25/32,127.0.0.1/32,192.168.0.26/32,192.168.0.27/32
,relay_domains = $mydestination,example.com,example2.com,example3.com
smtpd_recipient_restrictions =
reject_unauth_destination,permit_mynetworks,reject


The issue I am facing is that whenever things are working fine when I
check the things through telnet but when I do testing through command
line through "mail" command I am able to send mails to any domain from
these 5 servers.

bash-2.05$ telnet test.example.com 25
Trying 192.168.0.27...
Connected to test.
Escape character is '^]'.
220 test.example.com ESMTP Postfix (2.2.5)
mail <a class="moz-txt-link-abbreviated" href="mailto:from:ankush.grover@example.com">from:ankush.grover@example.com</a>
250 Ok
501 Syntax: RCPT TO: <address>
rcpt <a class="moz-txt-link-abbreviated" href="mailto:to:ankush@gmail.com">to:ankush@gmail.com</a>
554 <a class="moz-txt-link-rfc2396E" href="mailto:ankush@gmail.com"><ankush@gmail.com></a>: Relay access denied


How can I restrict mails even going through "mail" command from these
5 servers to specific domains only. These 5 servers are running some
cronjobs and these cronjobs output it mailed through "mail" command.


Regards

Ankush
_______________________________________________
CentOS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CentOS@centos.org">CentOS@centos.org</a>
<a class="moz-txt-link-freetext" href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a>

    </pre>
  </blockquote>
  <pre wrap=""><!---->
If you are using sendmail as the local MTA on these 5 systems
(default) did you change your smarthost configuration to forward mail
through your postfix mail relay?

  </pre>
</blockquote>
</body>
</html>