Author |
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 2:28am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 2:49am | IP Logged
|
|
|
Do you mean EHLO command argument? If so, you can change it with SmtpServer.HelloDomain property.
Regards,
Alex
|
Back to Top |
|
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 3:06am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 3:21am | IP Logged
|
|
|
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 |
|
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 3:30am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 3:37am | IP Logged
|
|
|
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 |
|
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 3:53am | IP Logged
|
|
|
Hi Alex,
Thanks for confirming this. This is exactly what was happening.
|
Back to Top |
|
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 4:11am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 8:21am | IP Logged
|
|
|
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 |
|
|
Neil_Knight Newbie
Joined: 06 December 2011 Location: United Kingdom
Online Status: Offline Posts: 30
|
Posted: 06 December 2011 at 8:23am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 8:26am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 06 December 2011 at 8:27am | IP Logged
|
|
|
Oh, you're quick :-)
Regards,
Alex
|
Back to Top |
|
|