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

Answered: Used Rebex trial to support TLS 1.2 in windows CE and failed.

$
0
0

Hello,

your code should work as expected if:

  1. The PreAuthenticate is set to true - In my test project I realized that the PreAuthenticate is always false.

  2. The Credentials property contains required credentials - In my test project I realized that the Credentials is always null.

Please ensure that line request.Headers.Add("Authorization", ... was executed.

I suggest you to use one particular credential and if it works, then use Credentials.GetCredential() logic.

I also suggest you to do it like this:

request.Credentials = new NetworkCredential(username, password);

This will enables you to use other authentication mechanisms such as Negotiate or Ntlm automatically. However setting Authorization header explicitly works as well.

And the last comment of your code:
You can use either creator.Register(); or creator.Create(uri); Using both together has no meaning. Please note that when you execute creator.Register();all subsequent creations of WebRequest class will create instances of Rebex HttpRequest (not only in DATA_CAPTURE_MANAGEMENT class, but everywhere in project).

So use it like this:

creator = new Rebex.Net.HttpRequestCreator();
creator.Register();
System.Net.WebRequest request = base.GetWebRequest(uri); 

or like this:

creator = new Rebex.Net.HttpRequestCreator();
System.Net.WebRequest request;
switch (uri.Scheme)
{
    case "http":
    case "https":
        // use Rebex HttpRequest to handle HTTP and HTTPS requests
        request = creator.Create(uri);
        break;
    default:
        // use default functionality to handle other requests
        request = base.GetWebRequest(uri);
        break;
}

Object reference not set to an instance of an object.

$
0
0

So I know this is a pretty common problem and but it's showing itself in a very unique way. I have built a program that basically retrieves emails via IMAP and then resends them. I build the program originally in test format under a windows console program. It works perfect. I built a windows service project and have installed it successfully and have it running the code starting fine. The issue is the exact same code in windows service gives me the Object ref not set. I have tried everything that i can think of. Added right, installed the dlls in the GAC, put the files with the EXE. Below is the sample code. Any help would be greatly appreciated. The error code I'm catching is "Object reference not set to an instance of an object"

using imap As New Rebex.Net.Imap()

    Dim mydb As New mySqlDB
        mydb.executeDMLSQL("insert into o365pocdb.poc_log (server, type, data, POC) values ('"& Server & "','Perf-Log','POC Started','"& Username & "')", sresult)

        Try
            mydb.executeDMLSQL("insert into o365pocdb.poc_log (server, type, data, poc) values ('"& Server & "','error','connected fine',' ')", sresult)
            imap.Connect(hostname, SslMode.Implicit)
            imap.Login(Username, Password)
            imap.SelectFolder("Inbox")

        Catch ex As Exception
        'mydb.executeDMLSQL("insert into o365pocdb.poc_log (server, type, data, poc) values ('"& Server & "','error','"& ex.Message & "',' ')", sresult)
        mydb.executeDMLSQL("insert into o365pocdb.poc_log (server, type, data, poc) values ('"& Server & "','error','Going to exit sub - cant connct','"& ex.Message & "')", sresult)
        Exit Sub
    End Try

Smtp.ResolveDomainMx timeout

$
0
0

hello,
after calling Smtp.ResolveDomainMx, is there a way to distinguish between:
- a non existing domain,
- an existing domain for which a timeout occurred during DNS lookup in the upstream DNS server ? assuming a shorter timeout for the upstream DNS server than for the ResolveDomainMx call.

thanks.

Answered: Object reference not set to an instance of an object.

$
0
0

Can you please post here the complete stack trace of the exception?

It can be simple done like this:

    Try
        ' do something
        ' ...
    Catch ex As Exception
        ' get complete details
        Dim details As String = ex.ToString()
        ' store it in file
        File.AppendAllText("c:\data\app.log", details)
    End Try

Remove a few Received headers

$
0
0

Hello,

How would I remove a few receive headers in an email? I can list them out fine but I can't figure out how to strip a few out. I'm a little confused as to how to leverage the removeat method of the HeaderValueCollection. Any help would be welcome.

Dim mail As MailMessage
mail = imap.GetMailMessage(uniqID)

For Each header In mail.Headers

            If header.Name Like "Received" Then
                If InStr(header.value.ToString, "prod.outlook.com") > 0 Then
                    MsgBox("Going to remove the header")
                    header.removeat(header)' This doesn't work
                End If

                MsgBox(header.Value.ToString)

            End If

Fraude De Minera San Xavier S. A. De C. V. En Venta De Automóviles Y

$
0
0
The list of indigenous speakers include Mina Setra of the Indigenous Peoples' Alliance in Indonesia, Joseph Itongwa from the Congo, Candido Mezua, a Cacique chief from Panama and R. Buendia of the Ashanika in Peru and winner of this year's Goldman Environmental Prize. Peru has pledged to protect its forests, which cover some sesenta por ciento of the country and are among the largest and best preserved in the world.

VPS hosting, web hsoting, alojamiento web, hospedaje web, hosting latino, hosting wordpress, hosting gratis, hosting gratuito, hosting para diseñadores, hosting pro, hsoting hostname, hosting cl, eco hosting extra

Compressed files with 7-zip 9.20 64-Bit on Ubuntu 16.04 TLS can not extracted

$
0
0

Hi Rebex-Team,

i have here a ZIP-Archive from a external team, that i must extract automatically to using in another program.

The archive was created with 7-zip 9.20 64-Bit on Ubuntu 16.04 TLS. The command was:

7z a "test_ubuntu.zip""/tmp/test"

It seems that 7-zip does not store the File-Attribute in the Archive to the file (ZipItem.IsFile or ZipItem.ItemType = ArchiveItemType.File).

Extracting of the files with any Zip-Programs (WinRAR, WinZip, 7-zip) is possible without problems.

Is it possible in any way to extract the files? Follwing i have tried:

  • ZipItem.ExtractToFile("C:\test\"& ZipItem.Name, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • ZipItem.ExtractToDirectory("C:\", Rebex.IO.TraversalMode.NonRecursive, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • Extracting the whole Archive with ZipArchive.ExtractAll("C:\test", Rebex.IO.TransferMethod.Copy, Rebex.IO.ActionOnExistingFiles.OverwriteAll)

  • I have nothing found in the options under ZipArchive.Options, especially .UnsupportedFeatureExtractMode

  • Tried several Events of the ZipArchive-Class

Nothing works. Is there any way to force the extraction of the files (for example overwriting the ZipItem.ItemType-Property or additional Options ZipArchive.Options.UnsupportedFeatureExtractMode)?

I have uploaded a sample ZIP-File here.

I have another Library (DevExpress) here, that can handle those Archives. But this Library have no equal PasswordRequired-Event.
In addition, i would realize this only with the Rebex-Librarys, because the Zip-Arichives send via Mail.

Thanks + Regards
Bernhard

SFTP logging and Postsharp

$
0
0

We are using PostSharp.Diagnostics with nlog for logging. How do I integrate PostSharp+nlog with LogWriterBase ?


Answered: Remove a few Received headers

$
0
0

I am not able to compile your code, because header doesn't contain RemoveAt method. You have to call this method on mail.Headers collection, not on a header itself.

You can do what you need like this:

' iterate through all headers
Dim i As Integer = 0
Do While i < (mail.Headers.Count - 1)
    Dim header As Rebex.Mime.MimeHeader = mail.Headers(i)
    If header.Name Like "Received" AndAlso InStr(header.Value.ToString, "prod.outlook.com") > 0 Then
        ' remove header (and keep index, because collection was shortened)
        mail.Headers.RemoveAt(i)
    Else
        ' update index to next header
        i += 1
    End If
Loop

Or, if you cannot do this in one loop, you can do the same in two step process like this:

' find headers to be removed
Dim headersToRemove = New List(Of Rebex.Mime.MimeHeader)
For Each header As Rebex.Mime.MimeHeader In mail.Headers
    If header.Name Like "Received" AndAlso InStr(header.Value.ToString, "prod.outlook.com") > 0 Then
        headersToRemove.Add(header)
    End If
Next

' remove unwanted headers
For Each header In headersToRemove
    mail.Headers.Remove(header)
Next

WaitHandle.WaitOne argument out of range exception

$
0
0

Hello.

I have a problem using the Rebex.TerminalEmulation.Scripting.Timeout property. Our application worked in production mode from november 2016 to april 2017 without any errors. But we get error now.

Here is a code sample which reproduce the error:

try
{
    var ssh = new Ssh();

    ssh.Connect(Settings.Host, Settings.Port);
    ssh.Login(Settings.User, Settings.Password);

    Scripting shell = ssh.StartScripting();

    shell.Timeout = 1000 * 60 * 60; // 1 hour!!!!!!
    shell.Terminal.Options.Encoding = Encoding.UTF8;

    shell.DetectPrompt();

    shell.SendCommand("ls -al");

    shell.Close();

    ssh.Disconnect();
}
catch (Exception e)
{
    /*
    System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
    at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
    at Rebex.Net.SshSession.DGV[C,V](TTG`2 C, Int32 V, ITG Z, V N, C Q, C M)
    at Rebex.Net.SshChannel.ZZ(Int32 C)
    at Rebex.Net.SshChannel.KZ(Int32 C, SocketSelectMode V)
    at Rebex.Net.ZRG.Poll(Int32 microSeconds)
    at Rebex.TerminalEmulation.WAG.GV(Int32 C)
    at Rebex.TerminalEmulation.WAG.TV(Int32 C)
    at Rebex.TerminalEmulation.ICN.ZV(Int32 C)
    at Rebex.TerminalEmulation.Scripting.RV(Int32 C)
    at Rebex.TerminalEmulation.Scripting.LV(ScriptEvent C)
    at Rebex.TerminalEmulation.Scripting.EZ(String C)
    at Rebex.TerminalEmulation.Scripting.SendCommand(String command)
    */
}

If the the timeout value is reduced to about 30 minutes, the sample code works without any errors.

I personally can reproduce the problem on the Debian 7.5 system.
https://cdimage.debian.org/mirror/cdimage/archive/7.5.0-live/amd64/iso-hybrid/debian-live-7.5.0-amd64-standard.iso

But we have information, that the same problem are on Debian 7, SUSE Enterprise Linux Desktop 11 and Oracle Linux 6 systems.

In the production mode we are using the Rebex SSH Pack (Beta Build 6165). The beta build contains the "two step routine" feature.
http://forum.rebex.net/6585/ssh-rsa-keys-authentication-issue

But that the same problem is on the Rebex SSH Pack (2017 R3).

Here is a part of a log file

2017-05-17 14:07:34.185 DEBUG VirtualTerminal(0)[10] Scripting: SendCommand(ls -al)
2017-05-17 14:07:34.186 VERBOSE Ssh(3)[10] SSH: Sending packet SSH_MSG_CHANNEL_DATA (16 bytes).
 0000 |5E-00-00-00-00-00-00-00 07-6C-73-20-2D-61-6C-0D| ^........ls -al.
2017-05-17 14:07:34.186 DEBUG Ssh(3)[10] Info: Sent 7 bytes of data.
2017-05-17 14:07:34.186 VERBOSE Ssh(3)[10] Info: Sent data: 
 0000 |6C-73-20-2D-61-6C-0D                           | ls -al.
2017-05-17 14:07:34.186 DEBUG VirtualTerminal(0)[10] Scripting: WaitFor(Line)
2017-05-17 14:07:34.186 VERBOSE VirtualTerminal(0)[10] Scripting: WaitFor: polling data for max 3600000 ms.
2017-05-17 14:07:34.187 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (17 bytes).
 0000 |5E-00-00-00-00-00-00-00 08-6C-73-20-2D-61-6C-0D| ^........ls -al.
 0010 |0A                                             | .
2017-05-17 14:07:34.188 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (17 bytes).
 0000 |5E-00-00-00-00-00-00-00 08-74-6F-74-61-6C-20-32| ^........total 2
 0010 |30                                             | 0
2017-05-17 14:07:34.188 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
2017-05-17 14:07:34.195 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (52 bytes).
 0000 |5E-00-00-00-00-00-00-00 2B-64-72-77-78-2D-2D-2D| ^.......+drwx---
 0010 |2D-2D-2D-20-20-32-20-72 6F-6F-74-20-72-6F-6F-74| ---  2 root root
 0020 |20-34-30-39-36-20-4D-61 79-20-31-37-20-30-34-3A|  4096 May 17 04:
 0030 |32-30-20-2E                                    | 20 .
2017-05-17 14:07:34.195 ERROR Ssh(3)[10] SSH: 
System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: millisecondsTimeout
at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
at Rebex.Net.SshSession.DGV[C,V](TTG`2 C, Int32 V, ITG Z, V N, C Q, C M)
at Rebex.Net.SshChannel.ZZ(Int32 C)
at Rebex.Net.SshChannel.KZ(Int32 C, SocketSelectMode V)
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (53 bytes).
 0000 |5E-00-00-00-00-00-00-00 2C-64-72-77-78-72-2D-78| ^.......,drwxr-x
 0010 |72-2D-78-20-32-33-20-72 6F-6F-74-20-72-6F-6F-74| r-x 23 root root
 0020 |20-34-30-39-36-20-4D-61 79-20-31-37-20-30-34-3A|  4096 May 17 04:
 0030 |31-35-20-2E-2E                                 | 15 ..
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
 2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (64 bytes).
 0000 |5E-00-00-00-00-00-00-00 37-2D-72-77-2D-2D-2D-2D| ^.......7-rw----
 0010 |2D-2D-2D-20-20-31-20-72 6F-6F-74-20-72-6F-6F-74| ---  1 root root
 0020 |20-20-33-37-31-20-4D-61 79-20-31-37-20-30-37-3A|   371 May 17 07:
 0030 |30-34-20-2E-62-61-73-68 5F-68-69-73-74-6F-72-79| 04 .bash_history
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (58 bytes).
 0000 |5E-00-00-00-00-00-00-00 31-2D-72-77-2D-72-2D-2D| ^.......1-rw-r--
 0010 |72-2D-2D-20-20-31-20-72 6F-6F-74-20-72-6F-6F-74| r--  1 root root
 0020 |20-20-35-37-30-20-4A-61 6E-20-33-31-20-20-32-30|   570 Jan 31  20
 0030 |31-30-20-2E-62-61-73-68 72-63                  | 10 .bashrc
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (59 bytes).
 0000 |5E-00-00-00-00-00-00-00 32-2D-72-77-2D-72-2D-2D| ^.......2-rw-r--
 0010 |72-2D-2D-20-20-31-20-72 6F-6F-74-20-72-6F-6F-74| r--  1 root root
 0020 |20-20-31-34-30-20-4E-6F 76-20-31-39-20-20-32-30|   140 Nov 19  20
 0030 |30-37-20-2E-70-72-6F-66 69-6C-65               | 07 .profile
2017-05-17 14:07:34.196 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (11 bytes).
 0000 |5E-00-00-00-00-00-00-00 02-0D-0A               | ^..........
2017-05-17 14:07:34.211 VERBOSE Ssh(3)[16] SSH: Received packet SSH_MSG_CHANNEL_DATA (24 bytes).
 0000 |5E-00-00-00-00-00-00-00 0F-72-6F-6F-74-40-64-65| ^........root@de
 0010 |62-69-61-6E-3A-7E-23-20                        | bian:~# 

Answered: "Bad message" error

$
0
0

It turned out we were sending requests for just the file name and the server wanted ./filename

Curiously it only gave the error sometimes.

Rebex Http type load exception

$
0
0

Hi,

i'm avaluating your Rebex Http component and get the following exception:

Additional information: Could not load type 'Rebex.HM' from assembly 'Rebex.Common, Version=2.0.6249.0, Culture=neutral, PublicKeyToken=1c4638788972655d'.

at:

var creator = new HttpRequestCreator();

Its a simple WinForms app for WIndows desktop .NET Client 4.0.

Regards
Martin

Answered: WaitHandle.WaitOne argument out of range exception

$
0
0

Hello,

thank you for this report. Although this long timeout is questionable, it is surely a bug on our side. We ware able to trace it and make a hotfix. I will send you full hotfix version of SSHPack 2017 R3 tommorow once it is ready from our support mail. For future users, in the same time I will post a link to trial version of the same build here.

Answered: EML to SMTP fails to retrieve attachments

$
0
0

Hello,

  1. Version 2.5.6291 is not the latest one. You can download current version from https://www.rebex.net/protected

  2. Can you please send us the problematic .eml to support@rebex.net for analysis? Please attach it in ZIP archive to prevent modifications.
    Also please include sample code you are using for creating the .eml file and for sending the file.

Checking back With fantastic Motel

$
0
0
Two together with the Five Wonders related the Ancient World was standing in Bulgaria. They are usually the Brow of Artemis in Ephesus, and often the Mausoleum at just Halicarnassus doing Bodrum.

This is just where wisdom spirit uses fragmentation and buffers to use us for situations as part of which we all will see troubles but that now we can end up swung in place and down until individuals learn exactly who down could be described as followed according to up and therefore up is probably followed by down, perpetually. We enjoy not the fall into dread at some solar new moon because you know your sun will shine again, but what normally if they didn't find out that?

Spaten, including many German made beer companies, has a very very prolonged periods of time history. For Spaten, usually the tradition about brewing is in fact 600 seasons old as well as a at one of them point was initially one with regards to the most breweries within the community. They offer you you only 3 beer mixtures all pointing to which keep been approximately for exactly a while and the majority of which follow the Bavarian Purity Rules that are already established within 1516.

Famed to receive its vent wine resorts (yes, these businesses do market free samples), Porto is without a doubt Portugal's extra city. Another historic Atlantic trading port, its warren of laundry-hung alleys plunges down towards a oceanfront of boats, nets together with fish spots. Sheets of all cod (bacalhau) hang out side grocery online shops with original art nouveau tiled facades; the cathedral of Sao Francisco has a gold coins leaf essential that does make midas kings midas king salivate. Don't miss the entire Bolhau delicacies market or it may be the Torre dos Clerigos, Portugal's high belfry podium. From some top, you cannot help but get effective views all over the cluttered cityscape out of churches, connections and red-roofed houses.

At the first I could hardly place some sort of first song, I assumed I learned it and so loved this particular.then it hit me - Bruno Mars "Dancing Through Another Boy." This is just a picture that helps me weep as I've listen regarding it bringing in generally car, I do can't identify you why-it just generally flows me. With regard to her Sara sing it, making the device her own, from an woman's prospective was typically so moving about and the ex voice was already spot on to perfect.

There really are many truth and lies attached by having gold ever since unknown occasions when. Due within order to its great value, less than too much people have been able on touch it, or grabbed it to obsession. Therefore, they went on creating stories, and content about this is mythical, so magical powers. They midas kings new songs idea that the software has a couple of divine influence that are probably only talented to kings, and a queen. They sometimes believed that experts claim gold is a mending source, additionally those what people have gold, live some longer everyday living.

Growing in mid-air with these products or specific negative text messages will carry ingrained inside of your reality, which when it comes to turn draws in negative feels - when something less than perfect happens individuals believe when you are almost always jinxed or possibly cursed - - midas king throughout reverse, very to say a word.

Thursday, The fall 18, Hot and irresisteble singer Luisa Maita signifies the existing day day spirit linked to Brazilian your favorite music with every live session on Daily Becomes Eclectic at 11:15am.

SFTP logging and Postsharp

$
0
0

We are using PostSharp.Diagnostics with nlog for logging. How do I integrate PostSharp+nlog with LogWriterBase ?

CertificateException : Server certificate was rejected by the verifier because of other problem.

$
0
0

We are using IMAP as an inbound protocol for outlook.office365.com on 993 port.

We are facing issue in ValidateCertificate()

public virtual void ValidateCertificate(object sender, SslCertificateValidationEventArgs e)
        {
            ValidationResult result;

            if (IgnoreCRLCheck)
                result = e.Certificate.Validate(e.ServerName, ValidationOptions.SkipRevocationCheck, CertificateChainEngine.LocalMachine);
            else
                result = e.Certificate.Validate(e.ServerName, ValidationOptions.None, CertificateChainEngine.LocalMachine);

            LogMessage.LogInfoProgress("ValidatingCertificate()", "result.Valid:" + result.Valid.ToString() + " Status:" + result.Status.ToString(), EmailQueue);

            if (result.Valid)
            {
                CertificateStatus = true;
                e.Accept();
            }
            else
            {
                CertificateError = result.Status.ToString();
                CertificateStatus = false;
                e.Reject();
            }
        }

CertificateException : Server certificate was rejected by the verifier because of other problem.

Any pointers on this.

Imap Rebex version: 2.0.6026.0

Rebex.Zip + NGen

$
0
0

Hi,

i bought your Zip component and get lots of warnings when ngenning like:

Warning: System.TypeLoadException: Could not load type 'Rebex.IO.EU' from assembly 'Rebex.Common, Version=2.0.6249.0, Culture=neutral, PublicKeyToken=1c4638788972655d'. while resolving 0x200002c - Rebex.IO.Compression.GNW.

Is this because i have a trial version of some other component of yours parallel installed?

Regards
Martin

Answered: CertificateException : Server certificate was rejected by the verifier because of other problem.

$
0
0

This exception only indicates that your custom certificate validator called e.Reject(). To be able to tell more, we would need to see result.Status. Please note that calling e.Reject(result.Status) instead of just e.Reject() would produce a more meaningful exception message.

header folding

$
0
0

We have a scenario where we send to a customer and they are getting the following error from their SMTP endpoint: SMTP Headers too large (32768 max) (552). Customer has a long recipient list.

It was suggested by them that we look at 'header folding' as a possible way around the limitation. Is header folding implemented or is there a way to take advantage of this. (https://tools.ietf.org/html/rfc5322#section-2.2.3)

Viewing all 3862 articles
Browse latest View live