Bauani's Historical Blog

Opinion on Issue(s) Which I, Ahamed Bauani Think About or Went Through It. Other Then That It Will Have Any Kind of News and Information Which I Think Useful for My Friends and Others in World. Oh, One more thing. I am currently not maintaining this blog anymore. To visit my new Blog, please Click Here -- Ahamed Bauani



Important information to Readars : This Blog is No Longer Maintaining by Bauani


Please Change your Bookmark to http://blog.bauani.org/ to get regular update from Ahamed Bauani Or

Subscribe to This RSS Feed to get Update of Bauani's New Blog

Thursday, February 21, 2008

Smart Relay Config relayhost in PostFix Like DS in Sendmail



Subject: Configuring 'Smart Relay' of Postfix MTA like DS in Sendmail [relayhost]
From: "Khalid Hossain"
To: "Ahamed Bauani"


Hi There

As you are expert of ‘Postfix’ in Bangladesh, would you please give a little solution for me (My Postfix SMTP server)? I am sure I will get the quick solution (copy & paste) from you.

In Sendmail MTA, there is a configuration option, which called "Smart Relay" or “DS” on ‘sendmail.ca’ configuration file. Using this "Smart Relay" configuration option, you can forward all email to another email server without any DNS query for MX. Regardless of MX entry, any outgoing email will be forward to any pre-define host who handle /filter /control /exchange any outgoing email traffic to open Internet

Let me give you an example:

My internal network has a server, running Sendmail as MTA, who acts as an SMTP server for my organization. This server handles both internal and external outgoing email traffic. When this Sendmail SMTP server receive an email from my network user, having recipient to 'user@external-domain.name' which is an 'valid external Internet Email address' (Not Really valid, just to give example) it forward the email to other server. This internal server has no permission to directly communicate to any Internet host for our firewall. If someone run MX query for domain 'external-domain.name', he or she will get a result that host 'mx-01.external-domain.name' is MX for that said domain and responsible to receive deliver incoming email for domain ‘external-domain.name’ to its destination user mailbox. Now I want my internal SMTP server which having 'Smart Relay" option enable using ‘DS’ will not delivery this email directly to 'mx-01.external-domain.name' but to my other email gateway which host name is 'smtp.internal.name' having IP address ‘10.10.4.3’. Host 'smtp.internal.name' is my only host/server, who run ESMTP and deliver email to open Internet depends on the value of MX record of destination domain. My query to you is "what will be the configuration parameter of same system in Postfix"? In my Sendmail, currently I use option called ‘DS’ value is ‘DS [10.10.4.3]’. I am sure that you understand what I want to do. I am going to remove ‘Sendmail’ from my internal SMTP server and replace Postfix on it.


In any standard 'sendmail.cf' contains:


===== sendmail.cf file start ==========
(Just the DS part, Removed other info for easy understand.)

# "Smart" relay host (may be null)
DS[10.10.4.3]

(Just the DS part, Removed other info for easy understand.)
===== Sendmail.cf file end ============



This configuration indicates that mail will be relay in host with IP address 10.10.4.3 regardless of any MX or DNS settings. IP: 10.10.4.3 may be my 'Mail Scanner', 'Content Filter' or ‘any kind of ESMTP Server’ who work as per RFC rules and control outgoing email.

My question is how can I setup ‘Smart Relay’ in Postfix, like the ‘DS’ option of Sendmail?

Thank you in advance from: Khalid Hossain
& Have a nice day…

--------- End of Support Request--------------


Reply from 'Ahamed Bauani':

Subject: Configuring 'Smart Relay' of Postfix MTA like DS in Sendmail (relayhost)
From: "Ahamed Bauani"
To: : "Khalid Hossain"


Hi Khalid

Postfix is the best MTA, Which I have seen in my life of Internet.

In one word: open main.cfg of a running Postfix and add following line to activate the DS option:

relayhost = [10.10.4.3]

WoW, you problem has been solved!! Remember to use the '[' and ']' as same as I wrote when your destination is an IP address. Bellow is a details about relayhost:

As per your requirment, best to use 'relayhost' option for your the problem.
Some Example are:

relayhost = [10.10.4.3]
relayhost = smtp.internal.name
relayhost = uucphost

First Line is used a lot as the outgoing email server IP normally as same as before.
If you write down the hostname (FQDN), no need to add '[' and ']' and the 3rd is for offline mailing. Now a days this 'UUCP' option is rarely used.

Note on Syntax: In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port.

Let me know if you failed to do so...

With a lot of Thanks for your time.

Ahamed Bauani

[This is a DRAFT copy Final version will be here soon. ]

Labels: , , , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home