Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all 3874 articles
Browse latest View live

Answered: "Invalid FTP response (A)" error without visible problems in the log

$
0
0

Hello,

the log is created using old logging approach. Unfortunatelly, the error occurred before it was logged. In the current version Ftp object has the LogWriter property, which improves logging a lot.

However, the issue is not caused by the logger, but the unexpected response from the server. Can you please try the latest version to ensure the problem is not fixed already.

You can either download current version in your project or use the FtpWinFormClient sample against your FTP server.

If the problem still exists in the current version, please post here the Debug log of the communication (or send it to support@rebex.net).


Is it possible to filter emails based on Subject using POP3?

$
0
0

Hi,

Almost decided to purchase Rebex SecureMail. I read your documentations which says POP3 searching capabilities are limited. Wanted to be absolute sure that this feature is possible even through an alternate way.

Our requirement is to build an email client into our CRM. It means we need to support all of protocols IMAP, POP3 OR EWS.

The filtering of emails would be based on ticket numbers in the subject line. So, when a particular case is opened in our CRM, all emails (IN/OUT) pertaining to that ticket number to be listed.

I know, this is possible in IMAP and EWS. Please let me know if it is possible in POP3 as well.

Thanks in advance.

-Sachin

Answered: Working with shared/other mailboxes

$
0
0

Hello,

your previous code was correct. To access a folder in other mailbox, use that constructor:

new EwsFolderId(EwsSpecialFolder.Inbox, sSharedMailbox)

You can see in a Debug log, whether the request is targeting your shared mailbox or not. You can create a log as described at https://www.rebex.net/kb/logging/.

Ews.GetMessageList results in FindItem SOAP request
(you can see it under this line:

Invoking 'FindItem' action

and see whether DistinguishedFolderId element has Mailbox childe element with correct value or not. Few lines later you can see the response.

If an error occured on the server (like you wrote in your comment), the response looks very similar to this

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo ... />
</s:Header>
<s:Body ... >
<m:FindItemResponse ... >
<m:ResponseMessages>
<m:FindItemResponseMessage ResponseClass="Error">
<m:MessageText>The specified object was not found in the store.</m:MessageText>
<m:ResponseCode>ErrorItemNotFound</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
</m:FindItemResponseMessage>
</m:ResponseMessages>
</m:FindItemResponse>
</s:Body>
</s:Envelope>

If you cannot locate the request and response in the log, please send it back to us at support@rebex.net for analysis. For now, I can only tell that the user have not sufficient rights to see emails in that other mailbox.

FileServer: mixed authentication methods possible?

$
0
0

how can I mix authenticationmethods in FileServer componenent for users? and how can I change the order of Authentication methods?

here is the Authentication codesnipped:

        private static void Sshd_Authentication(object sender, AuthenticationEventArgs e)
    {
        // make sure the user exists
        FileServerUser user = sshd.Users[e.UserName];
        if (user != null)
        {
            // if it's a 'public key' user, check the key
            var userWithKey = user as SshUsers;
            if (userWithKey != null && userWithKey.Key.Equals(e.Key)) // userWithKey.key is populated correct but: e.Key is empty!
            {
                e.Accept(userWithKey);
                return;
            }
            // otherwise, check the password
            if (user.CheckPassword(e.Password))
            {
                e.Accept(user);
                return;
            }
        }

here is my FileServer instantiating:

        const string sshdPpkFilename = "sshd.ppk";
        const string sshdPpkPass = "pass";
        const string sshdRootPath = "root";
        sshd = new FileServer();
        sshd.LogWriter = new ConsoleLogWriter(LogLevel.Debug);

        sshd.Bind(FileServerProtocol.Tunneling);
        sshd.Bind(FileServerProtocol.Shell);
        sshd.Bind(FileServerProtocol.Sftp);
        sshd.Settings.UseNativeFilesystem = false;
        sshd.Settings.ShellEncoding = Encoding.UTF8;
        sshd.Settings.MaxAuthenticationAttempts = 3;
        sshd.Settings.SshParameters.EncryptionAlgorithms = SshEncryptionAlgorithm.AES;
        sshd.Settings.SshParameters.AuthenticationMethods = SshAuthenticationMethod.Any;
        sshd.Settings.SshParameters.Compression = true;
        sshd.Settings.SshParameters.KeyExchangeAlgorithms = SshKeyExchangeAlgorithm.DiffieHellmanGroupExchangeSHA256 | SshKeyExchangeAlgorithm.DiffieHellmanGroupExchangeSHA1;

        sshd.Keys.Add(new SshPrivateKey(sshdPpkFilename, sshdPpkPass));

        // user with name/password:
        sshd.Users.Add("admin", "gg", Path.GetFullPath(sshdRootPath), ShellType.Default);
        // http://www.rebex.net/file-server/features/authentication.aspx - User with Public Key Auth.
        sshd.Users.Add(new SshUsers("o", new SshPublicKey(Path.GetFullPath(@"test.pub")), Path.GetFullPath(sshdRootPath), ShellType.Default));

        sshd.Authentication += Sshd_Authentication;
        sshd.Start();

the user "admin" authenticates with password.
User "o" should authenticate by public key (Key is loaded, Fingerprint verified within Visual Studio Debugger), but the password prompt appear.
he last lines from log when user "o" is prompted for Password:

2016-07-28 18:20:04.993 DEBUG FileServer(1)[12] SSH: Session 1: Current encryptor is aes256-ctr/hmac-sha2-256.
2016-07-28 18:20:05.111 DEBUG FileServer(1)[12] SSH: Session 1: Current decryptor is aes256-ctr/hmac-sha2-256.
2016-07-28 18:20:05.112 DEBUG FileServer(1)[12] SSH: Session 1: Key exchange finished.
2016-07-28 18:20:05.113 DEBUG FileServer(1)[11] SSH: Session 1: Performing authentication.
2016-07-28 18:20:09.183 DEBUG FileServer(1)[11] SSH: Session 1: Starting authentication as 'o' for 'ssh-connection'.

Performace with Imap Proxy

$
0
0

I have noticed a big difference in performance when using Proxy or not. I have a big Imap mailbox, when I try to find all messages between two dates the response time varies so much.
In both scenaries the message count is always the same: 800 messages.

  • Without Proxy: 120 seconds
  • With Proxy: 22 seconds

Should I have to use proxy for improving the response time? What can I do in environments where I can not set a Proxy?

Thanks in advance.

Answered: FileServer: mixed authentication methods possible?

$
0
0

You can use PreAuthentication event to specify authentication methods allowed for each user. The event handler might look like this:

private static void Sshd_PreAuthentication(object sender, PreAuthenticationEventArgs e)
{
    // make sure the user exists
    FileServerUser user = sshd.Users[e.UserName];
    if (user != null)
    {
        // if it's a 'public key' user, ask for public key authentication
        var userWithKey = user as SshUsers;
        if (userWithKey != null && userWithKey.Key.Equals(e.Key)) // userWithKey.key is populated correct but: e.Key is empty!
        {
            // only allow public key authentication for key-only users
            e.Accept(AuthenticationMethods.PublicKey);
            return;
        }
    }

    // otherwise, ask for password authentication
    // (if the user doesn't exist, pretend it does)
    e.Accept(AuthenticationMethods.Password);
}

It's currently not possible to change the order of authentication methods. However, this would be of limited use because the list of supported authentication methods is not supposed to be sorted by preference.

Which antivirus is best for ftp scanner?

$
0
0

We need a antivirus to scan all files to move on the FTP server or if it has a function in Rebex for scanning viruses.

Thank

Answered: What does this error mean and how do I address it? Unable to Acquire Private Key (0x80090014)

$
0
0

This error occurred during an attempt to perform client certificate authentication, which failed because the specified client certificate's private key could not be accessed. The error was reported by Windows CryptoAPI's CryptAcquireCertificatePrivateKey function and the error code means that an invalid provider type was specified.

We can't tell for sure what caused this without further investigation, but a common cause is a certificate associated with a CNG key stored by a key storage provider (KSP) instead of CryptoAPI CSP provider. See this blog post at MSDN if you are interested in details.

Please download this hotfix build and let us know whether it solves the issue. Thanks for bringing this to our attention.


EWS: The SMTP address has no mailbox associated with it.

$
0
0

Hi,

When I check for existence of a folder in a shared mailbox at an Exchange 2013 server by using the following method:

    private void CreateEwsFolder(string sMailFolder, EwsFolderId oEwsSharedFolderId)
    {
        bool bRootFolder = true;
        EwsFolderInfo oEwsFolderInfo = null;
        EwsFolderId oEwsFolderId = null;

        try
        {
            foreach (string sFolder in sMailFolder.Split('/'))
            {
                if (bRootFolder == true)
                {
                    bRootFolder = false;

                    if (oEws.FolderExists((oEwsSharedFolderId == null ? EwsFolderId.Root : oEwsSharedFolderId), sFolder) == false)
                    {
                        oEws.CreateFolder((oEwsSharedFolderId == null ? EwsFolderId.Root : oEwsSharedFolderId), sFolder);
                    }

                    oEwsFolderInfo = oEws.FindFolder((oEwsSharedFolderId == null ? EwsFolderId.Root : oEwsSharedFolderId), sFolder);
                    oEwsFolderId = oEwsFolderInfo.Id;
                }
                else
                {
                    if (oEws.FolderExists(oEwsFolderId, sFolder) == false)
                    {
                        oEws.CreateFolder(oEwsFolderId, sFolder);
                    }

                    oEwsFolderInfo = oEws.FindFolder(oEwsFolderId, sFolder);
                    oEwsFolderId = oEwsFolderInfo.Id;
                }
            }
        }
        catch (Exception ex)
        {
            oLog.Write(oResourceManager.GetString("ErrorCreateEwsFolder") + sMailFolder + Environment.NewLine + ex.Message, Log.Type.Warning, true);
        }
    }

I get the following error in the log:

Ews(45)[4] EWS: FolderExists failed: Rebex.Net.EwsException: The SMTP address has no mailbox associated with it. (ErrorNonExistentMailbox).

Is there a possible solution for this?

The version of RebEx I use is 2016R2.1.

Regards,
Chris Witterholt.

Error parsing email with signature

$
0
0

When i received mail from pop3 then i received this exception:

Invalid time node encountered.
Exception Type:
System.Security.Cryptography.CryptographicException
Source: Rebex.Common
StackTrace:
v Rebex.Security.Cryptography.Pkcs.HC.WI()
v Rebex.Security.Cryptography.Pkcs.SignerInfo.DO()
v Rebex.Security.Cryptography.Pkcs.SignerInfo.ZH()
v Rebex.Security.Cryptography.Pkcs.BC.W()
v Rebex.Security.Cryptography.Pkcs.BC.Write(Byte[] buffer, Int32 offset, Int32 count)
v Rebex.Security.Cryptography.Pkcs.PkcsBase.NK(Stream A, Stream B)
v Rebex.Security.Cryptography.Pkcs.SignedData.Load(Stream input)
v Rebex.Mime.MimeEntity.GG()
v Rebex.Mime.MimeEntity.VG(Stream A, Boolean B)
v Rebex.Mime.MimeEntity.Load(Stream input)
v Rebex.Net.Pop3.TV(Int32 A)
v Rebex.Net.Pop3.GetMimeMessage(Int32 sequenceNumber)
v Rebex.Net.Pop3.UV(Int32 A)
v Rebex.Net.Pop3.GetMailMessage(Int32 sequenceNumber)
TargetSite:
System.DateTime WI()

when i use GetMessage, then the message is downloaded correctly.
Then i try load message from file and the same error

MailMessage msg = new MailMessage();
msg.Load(filename);

Email I have, but I can not here publish. (Private message)

Answered: EWS: The SMTP address has no mailbox associated with it.

Password less FTP

$
0
0

I want to know whether Rebex support Password less ftp through dot net.We want to grab files from a ftp server. Currently we are connecting to ftp server through command prompt by giving Username and password.This cmd file is triggered by an SSIS job. The new requirement suggests we have to connect ftp server with common shared key means we should not use any user specific password to connect ftp server.

Answered: Server certificate was rejected by the verifier because it has expired.

$
0
0

The "Server certificate was rejected by the verifier because it has expired" error occurs when the validity period of the server certificate is over. When a certificate expires, the proper thing to do is to renew it (or replace it with a new certificate) - this has to be done at the server.

In rare cases when this can’t be done (if you don’t have control over the server and its administrators are refusing to solve the problem), it's possible to work around this issue by writing a custom certificate handler.

How can we use auth2.0 for Yahoo or Hotmail ?

$
0
0

Hi ,

I have tried the Gmail auth2.0 sample code using Rebex and it is perfectly working.

Is there any sample code available for Yahoo or hotmail or Ofict Outlook 365?
Is there any generic auth mechanism avaliable for all the mentioned webmail provider ?

Thank you,
Satarupa

SFTP component: SSH Error "Negotiation failed."

$
0
0

I'm trying to implement your SFTP .NET library on a Windows Mobile 2003 rugged device with compact framework 2.0 (Intermec 761)
and i keep getting the error 'Negotiation failed.' when trying to connect.

I already searched along your forum for similar questions but i couldn't reach a solution.

I can confirm that:
* The device has compact framework 2.0 (2.0.7045.0).
* I'm using your very simple sample to get a list of files from the SFTP server (SftpFileListCFCS).
* The server i'm using is your REBEX tiny SFTP Server.
* The OS image installed on this device has a "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider" CSP provider implementation
(Checked registry key "HKEY
LOCAL_MACHINE\Comm\Security\Crypto\Defaults\Provider").

Below is the FileLogWriter generated on the device:

2016-05-16 12:27:56 Opening log file.
2016-05-16 12:27:56 Using FileLogWriter version 2.0.5885.0.
2016-05-16 12:27:57 INFO Sftp(1)[-1756489614] Info: Connecting to XXX.XXX.XXX.XXX:22 using Sftp 3.0.5885.0.
2016-05-16 12:27:58 DEBUG Sftp(1)[-1756489614] SSH: Server is 'SSH-2.0-RebexSSH_1.0.0.30631'.
2016-05-16 12:27:58 INFO Sftp(1)[-1756489614] SSH: Negotiation started.
2016-05-16 12:27:58 ERROR Sftp(1)[-1756489614] SSH: Negotiation failed. Unable to acquire RSA_AES CSP context (-2146893799).
2016-05-16 12:27:59 ERROR Sftp(1)[-1756489614] Info: Rebex.Net.SshException: Negotiation failed. ---> System.Security.Cryptography.CryptographicException: Unable to acquire RSA_AES CSP context (-2146893799).
em Rebex.Security.Cryptography.OC.JP()
em Rebex.Security.Cryptography.ZR.get_VP()
em Rebex.Security.Cryptography.HashingAlgorithm.IsSupported()
em Rebex.Net.LXG..ctor()
em Rebex.Net.SshSession.VN()
em Rebex.Net.SshSession.Negotiate()
at YGV.VN()
em Rebex.Net.Sftp.ND()
em Rebex.Net.Sftp.CU()
em Rebex.Net.Sftp.Connect()
em Rebex.Samples.Screen.GetFtpList()
em Rebex.Samples.Screen.listBtn_Click()
em System.Windows.Forms.Control.OnClick()
em System.Windows.Forms.Button.OnClick()
em System.Windows.Forms.ButtonBase.WnProc()
em System.Windows.Forms.Control._InternalWnProc()
em Microsoft.AGL.Forms.EVL.EnterMainLoop()
em System.Windows.Forms.Application.Run()
em Rebex.Samples.Screen.Main()

em Rebex.Net.SshSession.VN()
em Rebex.Net.SshSession.Negotiate()
at YGV.VN()
em Rebex.Net.Sftp.ND()
em Rebex.Net.Sftp.CU()
em Rebex.Net.Sftp.Connect()
em Rebex.Samples.Screen.GetFtpList()
em Rebex.Samples.Screen.listBtn_Click()
em System.Windows.Forms.Control.OnClick()
em System.Windows.Forms.Button.OnClick()
em System.Windows.Forms.ButtonBase.WnProc()
em System.Windows.Forms.Control._InternalWnProc()
em Microsoft.AGL.Forms.EVL.EnterMainLoop()
em System.Windows.Forms.Application.Run()
em Rebex.Samples.Screen.Main()

Send Mail to [FAX:123456789]

$
0
0

Hi,
i want to send an Mail to a SMTP-Server that automatically sends Mails, where the Recipient is coded like [FAX:] as Fax to the specified Number.

I tried the following:

message.To.Add(new MailAddress("<[FAX:" + number + "]>", number);

But Rebex, always convert it to the following Header: "[FAX:123456]"<123456]>

I also tried to set the Header directly:

message.Headers["To"] = new MimeHeader("To", new Unparsed("\"" + number + "\"<[FAX:" + number + "]>"));

In that Case i got a "No recipients found in the message."-Exception

Thanks for your Help!

Answered: Why I am getting below error on connecting to sftp server via Rebex?

$
0
0

The private key authentication is not accepted by your SFTP server because your SFTP server is configured to only accept password authentication. You'll neeed to enable private/public key authentication at your server first. An exact way to do this depends on the server type. Please consult your SFTP server vendor.

Answered: How can we use auth2.0 for Yahoo or Hotmail ?

$
0
0

Hi,

there is no generic OAuth mechanism available for all mentioned webmail provider. It is not possible due to the fact how you "enable" OAuth authentication in your application. Basically, you need to register your application at your webmail provider and this is provider depended.

That said, I have checked IMAP servers of mentioned providers and all of them supports OAuth2 authentication, so if you register your application at each of those providers and get the OAuth2 token based on theirs "howto's", you should be able to login to theirs IMAP servers. Here is a link to Microsoft's blog where you can read what you need to make OAuth2 authentication possible in your application.

Answered: Why use Rebex SMTP instead of standard .NET classes?

$
0
0

The main advantages of Rebex SMTP against .NET SMTP client that I can think of are:

  • with Rebex SMTP you get the same API that behaves the same on all supported platforms (supported platforms include .NET, Mono, .NET CF, Xamarin.iOS and Android, plus we have experimental support for UWP and Xamarin.Mac)
  • Rebex SMTP is able to send emails loaded from file (System SMTP can't do this)
  • better serialization support
  • Rebex SMTP has nice API that fits with other Rebex email client classes (such as IMAP, POP3 and EWS clients). Not a big deal if you only need SMTP, but if you also need to access your email accounts via IMAP/POP3/EWS protocols this is good as you don't have to learn a different API.

You can check other Rebex SMTP features at

Why does EWS GetMessageList fail with hexadecimal value 0x01, is an invalid character in R2016 R1.1

$
0
0

An email has been received in a client inbox with a subject that contains an SOH character (character 0x01).

When trying to read the contents of the inbox using Rebex Exchange Web Services GetMessageList, the call fails with the error message;

{"'\u0001', hexadecimal value 0x01, is an invalid character. Line 1, position 1218."}

Is there a workaround or fix for this?

Incidentally - Rebex IMAP reads it just fine.

Thanks
John

Viewing all 3874 articles
Browse latest View live