Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Kerio Connect 7 doesn't send mail through .NET SmtpClient.Send function
  •  
Alex59858

Messages: 2
Karma: 0
Send a private message to this user
I wrote a single console application (just a part of a site code, but it must work apart too, and it has the same fault result as inside the site) (C#):

    MailMessage message = new MailMessage("login@ourDomenInPunycode", "toMail")
    {
    	Subject = "Hello",
    	Body = "Hello world"
    };
    
    SmtpClient client = new SmtpClient();
    client.Host = "ourIP";
    client.Credentials = new System.Net.NetworkCredential("login@ourDomenInPunycode", "ourPassword");
    client.Port = 25;
    client.UseDefaultCredentials = false;
    client.DeliveryMethod = SmtpDeliveryMethod.Network;
    client.Send(message); 


So, isn't to send e-mail should be trivial? But wherever I send mail from local machine through our mail server (just running this console application), the following exception appears:

System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Relaying to <toMail> denied (authentication required)

If I change the "login<_at_>ourDomenInPunycode" data to my own mailbox (at gmail or something else - no matter), all works fine. It also not depend from "toMail" address.

So, what could be wrong with our mail server? Any special settings? We use Windows Server 2008 virtualized inside another Windows Server 2008 and Kerio Connect 7 as mail server at virtual Windows Server 2008. All other mail programs like Outlook works well with sending e-mails from our mail server.

All articles which I read in Internet about SmtpClient's settings have only these (above) trivial settings and code, nothing special.

Here is a part of log of our mail server when I tried to send mail through console application launched from the mail server virtual PC ("mail.ourDomen.local" related to "ourIP" above):

    Task 215 handler BEGIN
    Task 215 handler starting
    SMTP server session begin; client connected from mail.ourDomen.local:49399
    Sent SMTP greeting to mail.ourDomen.local:49399
    Command EHLO OurMailServer
    Sent reply to EHLO: 250 mail.ourDomenInPunycode ...
    Command MAIL FROM:<login@ourDomenInPunycode>
    Sent reply to MAIL: 250 2.1.0 Sender <login@ourDomenInPunycode> ok
    Command RCPT TO:<toMail>
    Sent reply to RCPT: 550 5.7.1 Relaying to <toMail> denied
    Connection to SMTP server mail.ourDomen.local lost: connection closed by remote host.
    SMTP server session end
    Task 215 handler END


"Sent reply to RCPT: 550 5.7.1 Relaying to <toMail> denied" -
Why this happened?

[Updated on: Thu, 17 May 2012 08:26]

  •  
gbrown100

Messages: 175
Karma: 1
Send a private message to this user
I don't see you authenticating to the server anywhere. It won't send unless you authenticate first.

If you are trying to authenticate check the Security log

[Updated on: Thu, 17 May 2012 09:36]

  •  
Waco1

Messages: 89
Karma: 0
Send a private message to this user
gbrown100 wrote on Thu, 17 May 2012 03:34
I don't see you authenticating to the server anywhere. It won't send unless you authenticate first.

If you are trying to authenticate check the Security log


Agreed.

Unless of course you are running a completely open relay, which would be a Very Bad Idea.
  •  
Alex59858

Messages: 2
Karma: 0
Send a private message to this user
Well, we use this description
ht tps://kb.kerio.com/article/550-571-relaying-to-email%40addre sscom-denied-authentication-required-411.ht ml .
Although we know about this settings, but we tangled with our virtual machines. We have a virtual machine for the web server and another one for the mail server. Permissions were configured for the mail server virtual machine only in the Kerio Connect, not for the web server. We just added permission for the virtual machine of the web server and the mail is sent normally.

[Updated on: Fri, 18 May 2012 07:55]

Previous Topic: iOS Devices & Subscribed Calendars
Next Topic: iPhone Calendar
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Fri Nov 24 04:39:37 CET 2017

Total time taken to generate the page: 0.00419 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.