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 ‘’ 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 '' 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 '', he or she will get a result that host '' is MX for that said domain and responsible to receive deliver incoming email for domain ‘’ 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 '' but to my other email gateway which host name is '' having IP address ‘’. Host '' 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 []’. 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 '' contains:

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

# "Smart" relay host (may be null)

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

This configuration indicates that mail will be relay in host with IP address regardless of any MX or DNS settings. IP: 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 = []

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 = []
relayhost =
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 / Category

2013 (1) 3G (4) Adsense (2) AKTEL (2) Amateur Radio (3) APNIC (5) Bajaj Discovery (1) Bajaj Pulsar (1) Bangla News (5) Bangladesh (29) Bangladesh Computer Market (1) Bangladesh Cricket (2) Bangladesh earthquake (3) Bangladesh Educational Board (1) Bangladesh Energy (4) Bangladesh ICT (15) Bangladesh Internet Service (15) Bangladeshi Credit Card (3) Bangladeshi News Site (3) Bank in Bangladesh (7) Bank of Bangladesh (10) Banking in Bangladesh (10) BGMEA Bulding (1) Big File Download (3) blackhat (1) BLOG (6) Bogon (3) bot (2) BTCL (3) BTRC (14) BTTB Internet (10) BTTB Submarine Cable (9) Byke Hijack (1) Cacti (1) Call Block (1) Carbon Credit (1) CentOs (2) CentOs Bangladesh (2) Charity (2) Chrome (2) Computer Booting (1) Credit Card (10) Credit Card in Bangladesh (8) Crime (3) CyberCrime (11) Cyclon (1) DDoS (8) Dengue (1) Denmark (1) Dhaka earthquake (5) DNS (3) DNSSEC (2) Domain (9) DoS (4) dot bd domain (3) Dot CO.CC (2) Download (4) Drive not opening on click (1) DV Lottery 2010 (2) E-Learning (1) earthquake (5) EARTHQUAKE BANGLADESH (2) EARTHQUAKE DHAKA (2) earthquake in Bangladesh (5) earthquake in Dhaka (5) Email (7) Email Full Header (3) Email Sender Identify (4) Entertainment (2) Fake Email Sender (5) Firefox (8) FTP (1) Funny (4) GMail (4) Google (18) GPRS Settings (1) GrameenPhone (1) HAM (4) Health (3) Hobby (1) IGW (3) IIG (3) India (1) Indian ICT (1) Indian IT (1) Internet (19) Internet Mail (1) Internet Security (9) iPhone (3) iPhone Bangla (2) iPhone Bangladesh (2) iPhone in Dhaka (2) iPod (1) IPv4 Allocation (8) ipv6 (10) islam (4) ISOC (3) Linux Articles (6) Metal News (1) Microsoft (4) Microsoft buy Yahoo (1) Mirror Server (1) Mobile Phone (3) Mobile Phone Internet (1) Mobile Phone News (3) Mobile Phone Operator (6) Mobile Phone User (3) Mozilla (8) Mozilla Firefox (8) Myself (1) Mystery (1) Netcraft (4) Network Monitoring (4) neverBot (2) News Site (1) Nokia (3) Oil Price (2) Online Security (7) Paypal in Bangladesh (6) Personal View (1) Phishing (2) Pigeons (1) Postfix (7) PSTN (2) RANGS Bulding (1) Relay Host (2) robot.txt (1) robots.txt (2) Scour (2) (2) Second submarine cable (3) Sendmail (4) Share Market (4) Smart Relay (3) SSC Result (1) SSC Result 2008 (1) Stock Market (3) Technology (1) Ubuntu (4) UCB (5) UCBL (5) URL Redirect (2) Virus (3) Virus Infected Windows (3) Virus Information (3) Warid (2) Web Spider (3) Webhosting (6) Wimax (4) Windows (1) Windows Problems (1) Wireless Internet in Bangladesh (5) Yahoo (4) Yahoo Sold (1)

Share it