Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test Adapter ioBroker.imap latest/stable

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Test Adapter ioBroker.imap latest/stable

    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Lucky_ESA Developer Most Active @bahnuhr last edited by

      @bahnuhr Dann stimmt was mit deiner Funktion Datei_kopieren nicht. Habe es getestet und es funktioniert. Hier noch an den 2 Stellen die richtige uid eintragen.

      Nimm mal nur diesen Code.

      //var fs = require('fs');
      var i, result, j, json;
      sendTo("imap.0", "getIMAPRequest", {
          name: "github@luckyskills.de",
          max: 20,
          search: '["ALL", ["HEADER", "FROM", "xxx@xxx.de"]]',
          fetch:  JSON.parse('{"fetch": true, "uid": [107]}'),
          bodie: '{bodies: "", markSeen: false}',
          parse: true,
      }, async function (result) {
          if (!result) {
              console.log("No result found!");
              return;
          }
          for (var i_index in result) {
              i = result[i_index];
              var j_list = getAttr(i, 'body.attachments');
              for (var j_index in j_list) {
                  j = j_list[j_index];
                  var test =  getAttr(i, 'attrs.uid');
                  console.log(test);
                  if (test == 107) {
                      json = Buffer.from(getAttr(j, 'content'));
                      // Dein Anhang als Buffer
                      //console.log(JSON.stringify(json));
                      //console.log(getAttr(json, 'data'));
                      console.log(getAttr(j, 'filename'));
                      //fs.writeFile('/opt/iobroker/temp/' + getAttr(j, 'filename'), json, 'binary', function(err) {
                      //    if (err) {
                      //        console.log('Fehler beim Bild speichern: ' + err, 'warn');
                      //    } else {
                      //        console.log('Fehler beim Bild speichern: ', 'warn');
                      //    }
                      //}); 
                      writeFile('vis.0', getAttr(j, 'filename'), json, function (error) {
                          if(error) {
                              console.log('Fehler beim Speichern von Datei ' + getAttr(json, 'filename') +'   Fehler:' + error, 'warn');
                          } else {
                              console. log('Datei ' + getAttr(j, 'filename') +' wurde gespeichert');
                          }
                      });
                  }
              }
          }
      });
      
      bahnuhr 1 Reply Last reply Reply Quote 0
      • bahnuhr
        bahnuhr Forum Testing Most Active @Lucky_ESA last edited by

        @lucky_esa

        So, ich geb auf.
        Habe das Script genommen.
        Dann mir selber eine Mail gesendet (mit Anhang wav Datei die ich dir gesendet habe)

        uid im script geändert
        Script gestartet
        in vis.0 wird Datei "winmail.dat" erzeugt (keine wav oder so ?!)
        Dann die Datei kopiert auf win pc
        Abspielen geht nicht.

        Wenn du magst gerne auch mal per anydesk.
        Ansonsten geb ich jetzt auf.
        Bei mir läuft es nicht.
        Warum auch eine dat erzeugt wird und keine wav weiß ich auch nicht.

        L 1 Reply Last reply Reply Quote 0
        • Thomas Braun
          Thomas Braun Most Active last edited by

          @bahnuhr

          Mal geschaut was winmail.dat ist?

          https://support.mozilla.org/de/kb/anhang-winmaildat

          bahnuhr 1 Reply Last reply Reply Quote 0
          • L
            Lucky_ESA Developer Most Active @bahnuhr last edited by Lucky_ESA

            @bahnuhr

            in vis.0 wird Datei "winmail.dat" erzeugt (keine wav oder so ?!)

            Was hast du denn als Anhang in deiner Mail. Bei welchem Provider bist du?
            Ich benötige mal die komplette Ausgabe von:

                for (var i_index in result) {
                    i = result[i_index];
                    console.log(JSON.stringify(i)); // Das einfügen
                    var j_list = getAttr(i, 'body.attachments');
            

            Achtung! Dein logfile kann dann sofort auf > 20MB anwachsen.

            bahnuhr 1 Reply Last reply Reply Quote 0
            • bahnuhr
              bahnuhr Forum Testing Most Active @Lucky_ESA last edited by bahnuhr

              @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

              Was hast du denn als Anhang in deiner Mail.

              Den Anhang den ich dir gesendet habe (...wav)

              @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

              Bei welchem Provider bist du?

              Strato

              console.log(JSON.stringify(i)); // Das einfügen
              

              Eingefügt, aber sehr groß war der log nicht !

              log kommt per Mail.

              L 1 Reply Last reply Reply Quote 0
              • L
                Lucky_ESA Developer Most Active @bahnuhr last edited by

                @bahnuhr
                So kommt der Anhang von deinem Server:

                "contentType":"application/ms-tnef","partId":"2","release":null,"contentDisposition":"attachment","filename":"winmail.dat"
                

                Und so bei mir:

                "contentType":"audio/wav","partId":"2","release":null,"contentDisposition":"attachment","filename":"02.07.23_09.07_Anruf.01764.wav"
                

                Was siehst du denn in der eMail?

                Gruß//Lucky

                bahnuhr 2 Replies Last reply Reply Quote 0
                • bahnuhr
                  bahnuhr Forum Testing Most Active @Thomas Braun last edited by bahnuhr

                  @thomas-braun
                  Habe durch deinen Link winmail.dat deaktiviert.

                  Vorgehensweise:
                  c66709ab-99fa-40fe-af2c-1623b20c4ba2-image.png

                  Durch das Script wird sie aber immer noch erzeugt.
                  Äußerst komisch das ganze.

                  1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active @Lucky_ESA last edited by bahnuhr

                    @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                    Was siehst du denn in der eMail?

                    271802e4-aba6-4691-8a43-6c344e542318-image.png

                    Da ist ganz normal die wav drin.

                    Von einer winmail.dat sieht man nix.

                    DJMarc75 1 Reply Last reply Reply Quote 0
                    • bahnuhr
                      bahnuhr Forum Testing Most Active @Lucky_ESA last edited by

                      @lucky_esa
                      Kann es sein, dass es 2 Anhänge gibt.

                      Einmal die wav, und weiterhin die dat.
                      Und dein Script greift halt die dat zuerst ab.

                      möglich ?

                      L 1 Reply Last reply Reply Quote 0
                      • DJMarc75
                        DJMarc75 @bahnuhr last edited by

                        @bahnuhr mach mal die eMail unkenntlich, sonst werde ich Dich stalken 🤡

                        bahnuhr 1 Reply Last reply Reply Quote 0
                        • bahnuhr
                          bahnuhr Forum Testing Most Active @DJMarc75 last edited by

                          @djmarc75 sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                          @bahnuhr mach mal die eMail unkenntlich, sonst werde ich Dich stalken 🤡

                          hab ich gemacht.
                          Aber bei so vielen Scrrenshots ist die doch noch irgendwo sichtbar 😉

                          L 1 Reply Last reply Reply Quote 0
                          • L
                            Lucky_ESA Developer Most Active @bahnuhr last edited by

                            @bahnuhr sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                            @lucky_esa
                            Kann es sein, dass es 2 Anhänge gibt.

                            Einmal die wav, und weiterhin die dat.
                            Und dein Script greift halt die dat zuerst ab.

                            möglich ?

                            Das wäre möglich. Aber es ist ka eine Schleife und daher sollten alle Dateien gespeichert werden.
                            Log das mal

                                console.log(JSON.stringify(result)); // Das mal hinzufügen
                                for (var i_index in result) {
                                    i = result[i_index];
                                    //console.log(JSON.stringify(i));
                                    var j_list = getAttr(i, 'body.attachments');
                                    for (var j_index in j_list) {
                            
                            1 Reply Last reply Reply Quote 0
                            • L
                              Lucky_ESA Developer Most Active @bahnuhr last edited by

                              @bahnuhr sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                              @djmarc75 sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                              @bahnuhr mach mal die eMail unkenntlich, sonst werde ich Dich stalken 🤡

                              hab ich gemacht.
                              Aber bei so vielen Scrrenshots ist die doch noch irgendwo sichtbar 😉

                              Deine eMail ist in allen Codeschnipsel enthalten 🙂

                              bahnuhr 1 Reply Last reply Reply Quote 0
                              • bahnuhr
                                bahnuhr Forum Testing Most Active @Lucky_ESA last edited by

                                @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                                Deine eMail ist in allen Codeschnipsel enthalten

                                Ich geh mal auf die Suche.

                                Und ich glaube ich habe es nun.

                                Habe ja diesen Anhang ...dat deaktiviert.
                                Und nun mal eine ganz neue Mail an mich selber versendet.

                                Und ja, das Script nimmt nun die wav.

                                Ich beobachte das mal weiter.

                                Danke an @Thomas-Braun für den Tipp.
                                Und primär Dank an @Lucky_ESA für deine Geduld.

                                Wie gesagt, ich beobachte dies mal die Tage und werde berichten.

                                mfg
                                Dieter

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  Lucky_ESA Developer Most Active @bahnuhr last edited by Lucky_ESA

                                  @bahnuhr Freut mich aber leider hast du noch ein Fehler in deinem Script. Du darfst die Datei nicht mit fs. löschen. Schau mal oben, da hatte ich dir das löschen gepostet.

                                              writeFile('vis.0', getAttr(j, 'filename'), json, function (error) {
                                  
                                                  if (error) {
                                  
                                                      console.log('Fehler beim Speichern von Datei ' + getAttr(json, 'filename') + '   Fehler:' + error, 'warn');
                                  
                                                  } else {
                                  
                                                      console.log('Datei ' + getAttr(j, 'filename') + ' wurde gespeichert');
                                  
                                                      // Hier an Telegram senden
                                  
                                                      delFile('vis.0', getAttr(j, 'filename'), function (error) {
                                  
                                                          if (!error)
                                  
                                                               console.log('Datei ' + getAttr(j, 'filename') + ' gelöscht');
                                  
                                                      });
                                  
                                                  }
                                  
                                              });
                                  

                                  Gruß//Lucky

                                  bahnuhr 1 Reply Last reply Reply Quote 0
                                  • bahnuhr
                                    bahnuhr Forum Testing Most Active @Lucky_ESA last edited by

                                    @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                                    delFile('vis.0'

                                    Kannst du mir sagen, was da der Unterschied ist zu fs.unlink

                                    fs.unlink funktioniert.

                                    L 1 Reply Last reply Reply Quote 0
                                    • L
                                      Lucky_ESA Developer Most Active @bahnuhr last edited by Lucky_ESA

                                      @bahnuhr sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                                      @lucky_esa sagte in Test Adapter ioBroker.imap v0.1.1 latest/stable:

                                      delFile('vis.0'

                                      Kannst du mir sagen, was da der Unterschied ist zu fs.unlink

                                      fs.unlink funktioniert.

                                      Mit writeFile wird die Datei in die iobroker db geschrieben und mit delFile wird diese dort auch wieder entfernt. Du kannst die Dateien dann in VIS sehen und auch dort löschen.
                                      Screenshot 2023-11-05 214810.png

                                      1 Reply Last reply Reply Quote 0
                                      • D3ltoroxp
                                        D3ltoroxp last edited by D3ltoroxp

                                        Hallo,

                                        ich wollte gerade ein Teams Schulkonto mit einbinden. In Thunderbird klappt es, hab es soweit übernommen.

                                        Leider kommt folgender Fehler im Log. Könnt ihr damit was anfangen ?

                                        warn	Fehler bei Host xxx_xxx_xxxschule_de - Error: C0A7C8D7087F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355: - _onError.
                                        

                                        Ok erste Fehler war glaube ich das ich, smtp.outlook365.com angegeben hab. Sollet da nicht outlook.office365.com rein ?

                                        Aber auch hier kommt Fehlermeldung.

                                        warn	Fehler bei Host xxx_xxx_xxxschule_de - Error: LOGIN failed. - _login.
                                        
                                        L 1 Reply Last reply Reply Quote 0
                                        • L
                                          Lucky_ESA Developer Most Active @D3ltoroxp last edited by

                                          @d3ltoroxp Schulkonten outlook sind leider nicht möglich.

                                          Gruß//Lucky

                                          D3ltoroxp 1 Reply Last reply Reply Quote 1
                                          • D3ltoroxp
                                            D3ltoroxp @Lucky_ESA last edited by

                                            @lucky_esa Schade. Dachte wenn da in Thunderbird geht, kann ich die hier auch abfragen. Dann muss ich mir irgendwie ne Weiterleitung basteln. Aber das geht nur wenn ich die mit TB abfrage, direkt im Outlook kann er auch nicht weiterleiten, oder darf nicht.

                                            L 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            485
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            26
                                            406
                                            59939
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo