{"id":3574,"date":"2014-09-21T23:41:44","date_gmt":"2014-09-21T15:41:44","guid":{"rendered":"http:\/\/rmohan.com\/?p=3574"},"modified":"2014-09-21T23:41:44","modified_gmt":"2014-09-21T15:41:44","slug":"relay-host-in-mail-server","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3574","title":{"rendered":"Relay host in mail server"},"content":{"rendered":"<h1 class=\"entry-title\">How to setup Relay host in mail server<\/h1>\n<div class=\"post-info\">POSTED ON <span class=\"date published time\" title=\"2013-09-12T17:08:03+00:00\">SEPTEMBER 12, 2013<\/span> \/\/<\/div>\n<div class=\"entry-content\">\n<p>Please refer to the following information to assist in configuring various of the common mail servers:<\/p>\n<p><strong>Microsoft Exchange 2003<\/strong><\/p>\n<p>Important: If you are using Exchange with smtp-proxy.tm.net.my, you must configure your server to reject invalid recipients during the SMTP session, rather than generating NDRs and sending them out later. In the Message Delivery Properties dialog box in Global Settings, find the Recipient Filtering tab. Make sure that \u201cFilter recipients who are not in the Directory\u201d is checked, and Apply the settings.<\/p>\n<ol>\n<li>Go to \u201cStart\/All Programs\/Microsoft Exchange\u201d and click on \u201cSystem Manager\u201d.<\/li>\n<li>Expand the \u201cConnectors\u201d item.<\/li>\n<li>By default, Exchange uses SMTP for outbound connections, so you should find an \u201cInternet Mail SMTP Connector\u201d already there. Right click on it and select \u201cProperties\u201d.<\/li>\n<li>On the \u201cGeneral\u201d tab, select \u201cForward all mail through this connector to the following smart hosts\u201d and enter \u201csmtp-proxy.tm.net.my\u201d in the field below.<\/li>\n<li>On the \u201cAdvanced\u201d tab, click on the \u201cOutbound Security\u201d button to get to \u201cOutbound Security\u201d dialog box.<\/li>\n<li>By default, exchange sets up security to use \u201cAnonymous Access\u201d. Change this to \u201cBasic authentication (password is sent in clear text)\u201d then click the \u201cModify\u201d button, enter your domain username and password, and click \u201cOK\u201d.<\/li>\n<li>Back at the \u201cOutbound Security\u201d dialog box, enable \u201cTLS Encryption\u201d and click \u201cOK\u201d.<\/li>\n<\/ol>\n<p><strong>Microsoft Exchange 2000<\/strong><\/p>\n<p>Exchange\u2019s SMTP virtual server does not support authentication. In order to use smtp-proxy, you must add an SMTP connector.<br \/>\nImportant: If you are using Exchange with smtp-proxy, you must configure your server to reject invalid recipients during the SMTP session, rather than generating NDRs and sending them out later. In the Message Delivery Properties dialog box in Global Settings, find the Recipient Filtering tab. Make sure that \u201cFilter recipients who are not in the Directory\u201d is checked, and Apply the settings.<\/p>\n<ol>\n<li>Click on Routing Groups -&gt; First routing group -&gt; Connectors.<\/li>\n<li>Add an SMTP connector by right clicking on Connectors.<\/li>\n<li>In the properties, select \u201cForward all mail through this connector to the following smart hosts\u201d and enter smtp-proxy.tm.net.my in the field below.<\/li>\n<li>Add a local bridgehead. If you have only one server, this is your server.<\/li>\n<li>Select Properties: Deactivate \u201cSend HELO instead of EHLO\u201d.<\/li>\n<li>Activate \u201cDo not send ETRN\/TURN\u201d.<\/li>\n<li>On the Delivery Options page, select \u201cSpecify when messages are sent through this connector\u201d and specify \u201cAlways Run\u201d (or whatever you desire).<\/li>\n<li>Under the Advanced tab, click \u201cOutbound Security\u2026\u201d then \u201cBasic authentication\u201d then click Modify. Enter your domain username and password here.<\/li>\n<li>Under Address Space, click Add then SMTP. Domain should be * and cost 1.<\/li>\n<li>Connector Scope is probably \u201cEntire organization\u201d.<\/li>\n<li>It is not necessary to click \u201cAllow messages to be relayed through this domain\u201d (and this option probably should not be selected).<\/li>\n<\/ol>\n<p><strong>Postfix<\/strong><\/p>\n<p>These instructions is for Mac OS X 10.3 that running postfix 2.0.10. It is expected that other versions of postfix running on various flavors of UNIX\/Linux should be similarly configured.<\/p>\n<p>These instructions assume the postfix config files live in \/etc\/postfix.<\/p>\n<p>In \/etc\/postfix\/main.cf add the lines:<br \/>\nrelayhost = smtp-proxy.tm.net.my:25<br \/>\nsmtp_sasl_auth_enable=yes<br \/>\nsmtp_sasl_password_maps=hash:\/etc\/postfix\/sasl_passwd<br \/>\nsmtp_sasl_security_options=<\/p>\n<p>Optionally, also add the lines:<br \/>\nsmtp_use_tls = yes<br \/>\nsmtp_tls_CAfile = \/etc\/postfix\/cert.pem<br \/>\nsmtp_tls_session_cache_database = btree:\/var\/run\/smtp_tls_session_cache<\/p>\n<p>to enable SSL\/TLS when sending outgoing mail. Note that the path info in the second command may be different depending on your system and where you have installed your certificates. The last line may be omitted, but should help reduce CPU cycles verifying the certificate chain when sending outgoing E-Mail.<\/p>\n<p>Create a file \/etc\/postfix\/sasl_passwd with the contents:<br \/>\nsmtp-proxy.tm.net.my userid:password<\/p>\n<p>where userid and password are your domain username and password.<br \/>\nNext, change the ownership and permissions on the sasl_passwd file to protect it from unauthorized access.<br \/>\nchown root:root \/etc\/postfix\/sasl_passwd<br \/>\nchmod 600 \/etc\/postfix\/sasl_passwd<\/p>\n<p>Finally, create a database file from the contents of the sasl_passwd file:<br \/>\npostmap hash:\/etc\/postfix\/sasl_passwd<\/p>\n<p>OPTIONAL: If you wish to relay only specific domains via smtp-proxy, You will need to do the following:<br \/>\nRemove the relayhost = smtp-proxy.tm.net.my entry in main.cf, if one exists.<\/p>\n<p>Add the following line to your main.cf file: transport_maps = hash:\/etc\/postfix\/transport<\/p>\n<p>Edit \/etc\/postfix\/transport and update it with something similar to the following:<br \/>\n# Syntax: .domain transport:relay_host<br \/>\n# Specifies specific domains for local delivery<br \/>\nmy.domain.com :<\/p>\n<p># Specify all subdomains for local delivery<br \/>\n.my.domain :<\/p>\n<p># Specify domains that need to be relayed through smtp-proxy.tm.net.my<br \/>\naol.com relay:smtp-proxy.tm.net.my<br \/>\nhotmail.com relay:smtp-proxy.tm.net.my<\/p>\n<p>Create a database file from the contents of the transport file: postmap hash:\/etc\/postfix\/transport<br \/>\nLastly, reload postfix: postfix reload<\/p>\n<p>If you want to change the port that Postfix uses to send outgoing mail, we have been told that you may need to change the definition of the SMTP port in \/etc\/services. We do not have comprehensive instructions for making this change, but some reasonable searching should get you the information you need \u2013 when changing \/etc\/services, though, you should be very careful, as this file controls a large part of the UNIX system\u2019s TCP\/IP interactions.<\/p>\n<p><strong>Sendmail<\/strong><\/p>\n<p>These instructions assume that you already have an appropriate .mc file prepared for your Sendmail configuration, and have the appropriate commands\/tools prepared to compile that into a sendmail.cf file and install it in the appropriate location. On some BSD-based systems, this is as simple as typing \u201cmake\u201d in \/etc\/mail and editing $hostname.mc. On other systems, it can be considerably more difficult. Consult the manual for your system or Sendmail for more information.<\/p>\n<p>Add the following lines to your .mc file:<br \/>\nFEATURE(authinfo, `hash -o \/etc\/mail\/authinfo\u2019)<br \/>\ndefine(`SMART_HOST\u2019, `smtp-proxy.tm.net.my\u2019)<\/p>\n<p>If you need to use an alternate port (other than 25) for smtp-proxy, also add the following line:<\/p>\n<p>define(RELAY_MAILER_ARGS, `TCP $h 2525?)<\/p>\n<p>Create or edit the file \/etc\/mail\/authinfo, and add a line that looks like this:<br \/>\nAuthInfo:smtp-proxy.tm.net.my \u201cU:username\u201d \u201cP:password\u201d \u201cM:LOGIN\u201d<\/p>\n<p>Replacing \u201cusername\u201d and \u201cpassword\u201d with your domain username and password, respectively. Be sure to include the rest of the line exactly as it is shown above, quotes and all. You should make sure that this file is not readable by unpriviledged users, as it contains your login information.<\/p>\n<p>Build the authinfo file into the Sendmail hash database format with the following command:<br \/>\nmakemap hash \/etc\/mail\/authinfo &lt; \/etc\/mail\/authinfo<br \/>\nThis will create an \/etc\/mail\/authinfo.db file, which Sendmail will use to read the authentication information. You will need to re-run the above command any time you change \/etc\/mail\/authinfo.<\/p>\n<p>Finally, compile your .mc file to a .cf file, install it as sendmail.cf, and re-start Sendmail. Your server should now send all mail via the smtp-proxy.tm.net.my server<\/p>\n<p><strong>Exim<\/strong><\/p>\n<p>These instructions assume Exim 4.x and have been vetted by our support staff running Exim version 4.20 on FreeBSD 4.8:<\/p>\n<p>In the \u201cMAIN CONFIGURATION SETTINGS\u201d make sure that your primary_hostname and local_domains variables are configured correctly. Otherwise you\u2019ll likely generate nasty loops. Unfortunately we can\u2019t tell you precisely how to configure these as they depend on too many local variables. Consult the Exim documentation for more details on configuring these items.<\/p>\n<p>In the \u201cROUTERS CONFIGURATION\u201d section, before any other routers, add the following:<br \/>\nsend_to_gateway:<br \/>\ndriver = manualroute<br \/>\ndomains = !+local_domains<br \/>\ntransport = remote_smtp<br \/>\nroute_list = * smtp-proxy.tm.net.my<\/p>\n<p>In the \u201cTRANSPORTS CONFIGURATION\u201d section, locate the remote_smtp directive and edit it to include:<br \/>\nremote_smtp:<br \/>\ndriver = smtp<br \/>\nhosts_require_auth = smtp-proxy.tm.net.my<\/p>\n<p>If you have Exim compiled to use SSL, add the following line as well:<br \/>\nhosts_require_tls = smtp-proxy.tm.net.my<\/p>\n<p>Near the bottom of your configure file, in the \u201cAUTHENTICATION CONFIGURATION\u201d, enter:<br \/>\nlogin:<br \/>\ndriver = plaintext<br \/>\npublic_name = LOGIN<br \/>\nclient_send = \u201c: username : password\u201d<\/p>\n<p>The username and password should of course be your domain credentials.<\/p>\n<p><strong>Communigate Pro<\/strong><\/p>\n<p>These instructions is for Communigate Pro version 4.1.7 on Mac OS X 10.3. However, the basic interface for this in Communigate Pro hasn\u2019t changed since 3.0 or earlier. As such, these instructions should work with most versions of Communigate Pro currently in service.<\/p>\n<ol>\n<li>Using the basic Web interface to administer Communigate Pro, access the SMTP section and select the option \u201cForward to\u201d.<\/li>\n<li>Enter smtp-proxy.tm.net.my in the text field to the right of this option.<\/li>\n<li>In the \u201cSend AUTH\u201d field enter your domain username.<\/li>\n<li>In the \u201cPassword\u201d field enter your domain password.<\/li>\n<li>Optionally, in the \u201cSend Encrypted (SSL\/TLS)\u201d enter smtp-proxy.tm.net.my in the \u201cTo Domains\u201d field to engage SSL based encryption for communications between you and our relay server.<\/li>\n<\/ol>\n<p><strong>qmail<\/strong><\/p>\n<p>Relaying to a smart host<br \/>\nSetting qmail to route all outgoing SMTP traffic through that server by doing:<\/p>\n<p>echo \u201c:smtp-proxy.tm.net.my\u201d &gt; \/var\/qmail\/control\/smtproutes<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to setup Relay host in mail server POSTED ON SEPTEMBER 12, 2013 \/\/ <\/p>\n<p>Please refer to the following information to assist in configuring various of the common mail servers:<\/p>\n<p>Microsoft Exchange 2003<\/p>\n<p>Important: If you are using Exchange with smtp-proxy.tm.net.my, you must configure your server to reject invalid recipients during the SMTP session, rather [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3574"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3574"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions"}],"predecessor-version":[{"id":3575,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions\/3575"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}