Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: SMTP sending private IP Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 2:28am | IP Logged Quote Neil_Knight

Why is MailBee.Net SMTP sending my servers private IP address when I send an email?

How can I stop this from happening?
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 2:49am | IP Logged Quote Alex

Do you mean EHLO command argument? If so, you can change it with SmtpServer.HelloDomain property.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 3:06am | IP Logged Quote Neil_Knight

I current pass in my full server name as the SmtpServer.HelloDomain property e.g. mx1.company.com.

I'm not passing in any other details.
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 3:21am | IP Logged Quote Alex

If you already set SmtpServer.HelloDomain right, I don't understand what you meant then.

Please enable logging with Smtp.Log property and point us where your private IP is passed to the relay server.

regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 3:30am | IP Logged Quote Neil_Knight

Well, I actually set the HelloDomain of the smtpContext but it completely ignores it and still passes a null to Hello() method.
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 3:37am | IP Logged Quote Alex

Which code are you using? By the way, there is also another DirectSendServerConfig.HelloDomain property which is used for direct-send mode (while SmtpServer.HelloDomain is for relay servers).

In direct send mode, SmtpServer.HelloDomain is ignored (and cannot be even set because no SmtpServer object exists as the Smtp.SmtpServers collection is empty).

DirectSendServerConfig.HelloDomain is ignored when you send through relay server but the property itself is always available (via Smtp.DirectSendDefaults.HelloDomain syntax).

regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 3:53am | IP Logged Quote Neil_Knight

Hi Alex,
Thanks for confirming this. This is exactly what was happening.
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 4:11am | IP Logged Quote Neil_Knight

The problem I'm having now is the fact that I have multiple IPs on the server. I run the ConnectToServer method, and then it does the Hello method with my domain, but it is returning the wrong IP address when viewing the "Received From" in the message header e.g.

Received: from mx113.company.com (mx111.company.com [11.11.11.11])

Any ideas how I can get the 2 to marry up?
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 8:21am | IP Logged Quote Alex

You may try using LocalEndPoint property (again, it's available in two classes, for relay and for direct-send, just the same way HelloDomain).

It may help you specify your remote IP as client's address.

regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Neil_Knight
Newbie
Newbie


Joined: 06 December 2011
Location: United Kingdom
Online Status: Offline
Posts: 30
Posted: 06 December 2011 at 8:23am | IP Logged Quote Neil_Knight

I have found the answer to this. I wasn't assigning the value of the LocalEndPoint. Once I done this, it works as expected.
Back to Top View Neil_Knight's Profile Search for other posts by Neil_Knight
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 8:26am | IP Logged Quote Alex

I.e. somewhat like:
Code:

IPEndPoint ep = new IPEndPoint(IPAddress.Parse("1.2.3.4"), 5678);
server.LocalEndPoint = ep; // server is SmtpServer instance


You can usually set port to 0 to let the system set the local port automatically (as only IP address matters for you).

regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 December 2011 at 8:27am | IP Logged Quote Alex

Oh, you're quick :-)

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide