How to integrate with different mail server ?
Different mailing servers have different steps to integrate Netcore Email API.
Exchange 2010
Ssmtp
Sendmail
Qmail
Postfix
Exim
IIS 7.5
Exchange 2010
Follow below-listed steps to configure a send connector in the Exchange Management Console to use Netcore Email API for SMTP.
- Log into your Exchange server.
- Go to Start > All Programs > Microsoft Exchange Server 2010 and click the Exchange Management Console item.
- Open the Organization Configuration list and select Hub Transport.
- Click New Send Connector in the Actions sidebar.
- Provide a name to the Send Connector and select Internet for the Intended Use pull-down. It allows for the integration with an authenticated SmartHost and adds the default send permissions required by Exchange 2010 to route messages through an external host that is not a part of the domain forest.
- Click Next.
- Click Add.
- Provide the allowed address to which connector can send mails. If you want to:
1- Send to anyone on the internet, then insert ‘*’ (asterisk) in the Address box.
2- Send only to a specific domain, enter the domain.
3- Allow all sub-domains, then check the box. - Click Next.
- Go to Network Settings page. Select Route mail through the following smart hosts item.
- Click Add.
- Select Fully qualified domain name (FQDN), and enter: smpt.netcorecloud.net
- Click Next.
- In the Configure smart host authentication settings page, select the Basic Authentication option and check the Basic Authentication over TLS checkbox. Enter the Netcore Email API username and password here.
- Click Next.
- If you have one Exchange server, it is displayed. If you want to add more server(s) in your domain, click Add to locate the servers you want to allocate to this connector.
- Click Next.
- Verify the settings, and if everything is correct, click New.
- If the configuration is correct, a message is displayed. Click Finish to exit.
Ssmtp
You need to edit the etc/ssmtp/ssmtp.conf file and add the following code in it:
mailhub=smtp.netcorecloud.net:587
AuthUser=NetcoreEmailAPIusername
AuthPass=NetcoreEmailAPIpassword
UseSTARTTLS=YES
Restart
Ssmtp
. You are ready to go!
Sendmail
Sendmail needs libsasl to send authentication requests to Netcore Email API servers. The saslauthd server daemon is not required unless you plan to receive authentication requests to the same server. To learn more about configuring sendmail for SASL support, click here
a. Provide the authorization credentials in /etc/mail/access
- AuthInfo:smtp.netcorecloud.net “U:yourUserName” “P:yourPassword” “M:PLAIN”
b. Define the Smart Host in /etc/mail/sendmail.mc Add these lines right below the commented “#dnl define(‘SMART_HOST’, ‘smtp.your.provider’)dnl” line in the file - define(
SMART_HOST’,
smtp.netcorecloud.net’)dnl - FEATURE(`access_db’)dnl
- define(
RELAY_MAILER_ARGS’,
TCP $h 587′)dnl - define(
ESMTP_MAILER_ARGS’,
TCP $h 587′)dnl
c. Update sendmail.cf and access.db files. You need to run these commands as ‘su’ or ‘root’) - $ cd /etc/mail
- $ m4 sendmail.mc >sendmail.cf
- $ makemap hash access < access
d. On older distros, you can run restart sendmail as below: - $ /etc/init.d/sendmail restart
e. If you are using a newer version of sendmail, do the following to restart: - $ service sendmail restart
Qmail
In Qmail, SMTP authentication is not installed by default. Follow one of the following:
a. Add the netqmail TLS+SMTPauth patch
b. Fehcom’s complete description of authentication on mail servers
c. Configuring SMTPAUTH for qmail.
The general step is to add the following code to /var/qmail/control/smtproutes. However, you should verify the actual path and file you need to update.
- smtp.netcorecloud.net:587|username|password
After the configuration changes are done, restart Qmail.
Postfix
It is quite simple to configure Postfix to use Netcore Email API as a relay host. Sometimes, Postfix allows only alphanumeric passwords. In such cases, ensure that your Netcore Email API password is alphanumeric. For configuration, do the following:
a. Locate the Postfix config file, which usually is Find your Postfix /etc/postfix/main.cf , and add the following:
- smtp_sasl_auth_enable = yes
- smtp_sasl_password_maps = static:yourNetcoreEmailAPIUsername:yourNetcoreEmailAPIPassword
- smtp_sasl_security_options = noanonymous
- smtp_tls_security_level = encrypt
- header_size_limit = 4096000
- relayhost = [smtp.netcorecloud.net]:587
b. Restart Postfix.
-
$ /etc/init.d/postfix restart
Note: If you get “No mechanism available” error message, then you might be missing SASL authentication libraries. Go ahead and install them using apt-get (i.e., Debian, Ubuntu): -
$ apt-get install libsasl2-modules
You can also use a yum (i.e., RedHat, Fedora, CentOS): -
$ yum install cyrus-sasl-plain
If port 587 does not work, you can try 2525 in your postfix config. You may also need to edit /etc/postfix/master.cf to remove # from #tlsmgr unix – – n 1000? 1 tlsmgr.
IIS 7.5
The configuration instructions given below are written using Windows Server 2008 R2 running IIS version 7.5 and ASP.NET scripting technology for sending email. This document supports only basic authentication. If you require SSL/TLS, you need to configure those elements separately.
Before you begin the configuration, set up IIS in order to support Netcore Email API integration. The instructions below are given after assuming that you have set up a working site and that the root directory tests as valid.
- Open IIS 7.0/7.5 Manager in Windows.
- Click on your site. (see image below, noting ) that your configuration will look different), and the main configuration options page appears on the right.
- Double-click “SMTP E-mail” under the ASP.NET section. (to get the below screen)
- In the email address field: type the email address of the “sender”.
- Click “Deliver e-mail to SMTP server” radio button if not already enabled
- In the SMTP Server field, type localhost.
- In the Port field: type 25.
- In Authentication Settings click “Not required”.
- On the right side “Actions” pane, click Apply.
Note: If you want to configure additional security to the localhost IIS 6.0 server, set it here and match the same authentication in the IIS 6.0 GUI.
Enable SMTP Service:
Go to Start > All Programs > Administrative Tools > Server Manager.
Click Features in the navigation pane.
Click Add Features link to start the wizard.
Scroll down the list to the SMTP Server, and check the box. The Required Role Services dialog box appears, listing all of the dependencies on which SMTP depends to function. Click Add Require Role Services.
Click Next twice.
Review the list of available IIS Role Services and check the ones you want to add.
Click Next.
Click Install.
After the SMTP Server is installed, the IIS 6.0 virtual server technology is activated, and the IIS 6.0 administration snap-in becomes active.
Configure IIS 6.0 to Relay Outbound Email to Netcore Email API:
Go to Start > All Programs > Administrative Tools > IIS 6.0 Manager.
Right click the SMTP Virtual Server #1 and select Properties.
Click the box to enable logging section to assist you in configuring the server.
Click Properties and check the box to activate Use Local Time For File Naming And Rollover option.
Click Advanced tab and check the following items: Date, Time, Client IP Address, User Name, Service Name, Server Name, Server IP Address, Server Port, Method, Protocol Status, Bytes Sent, Protocol Version, and Host.
Click OK.
Click Access tab, and then click Relay button in the Relay Restrictions section.
Click Add, enter 127.0.0.1, and click OK. The IP appears in the list with Access Grante
Click OK Only The List Below radio button and enter 127.0.0.1 in the IP address field.
Click OK to return to the Access tab as shown in the previous screenshots.
Select the Delivery tab and click the Outbound Security button.
Click on Basic Authentication where the Username is your Pepipost.com username and the password is your Pepipost.com password.
Click OK.
Click Advanced button.
In the Smart host field, enter smtp.netcorecloud.net.
Click OK twice and you can close the IIS 6.0 admin MMC.
Configure Domains
At this point you need to configure an SMTP domain that relays messages to Netcore Email API. Please follow Microsoft’s instructions.
At this point you need to configure an SMTP domain that relays messages to Netcore Email API. Please follow Microsoft’s instructions.
Testing Your New Configuration
You can test the new configuration if it is working. Here, it is explained using telnet.
Open telnet client within Windows by entering the following command in the command prompt.
telnet localhost 25
When telnet starts running, enter the following commands, pressing ENTER for each new line (if configured correctly, the server won’t do anything until you enter the period):
- EHLO yourdomain.com
- MAIL FROM: [email protected]
- RCPT TO: [email protected]
- DATA
- This is a test email for Netcore Email API operations.
The EHLO command with your domain inserted tells the mail server from which domain it send mails. The MAIL FROM: command is a standard MIME entry for that inserts the email address of the sender. The RCPT TO: command tells the server to which address to send the message. The DATA command tells the server that the next incoming information is the body of the message. Finally, after the data is entered, the period (.) tells the server you are done. When you press Enter, it will send the message. It’s quite nice to have servers to handle all this mess, isn’t it!
If these manually entered commands work, then you should have the following success code returned.
- 250….Queued mail for delivery
You can also test the configuration using the logging feature. You can view the logs by navigating to and opening the IIS 6.0 7.5 log files with a text editor. It is usually located at C:\Windows\System32\LogFiles directory unless you chang the log file location during installation.
Finally, you can confirm that your configuration is working by logging into our site. Login into our web portal using your Netcore Email API credentials. You can see a list of messages on the dashboard that were recently sent through our service. This number should increase by one each time you either use telnet to send an email or you use a ASP.NET test script.
Updated over 3 years ago