<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <div class="moz-cite-prefix">On 8/4/21 9:11 AM, Mika Silander wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1945563404.128297.1628061111271.JavaMail.zimbra@csc.fi">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        10pt; color: #000000">
        <div> I went through the mail attachment collector bot's logs
          again and noticed that I had misinterpreted the info,
          apologies for that. Based on the log it looks like every time
          the bot is restarted, it reads and forwards all the messages
          available in the mail box. Once that's done, it does not
          reprocess the messages anymore, only the new incoming ones, so
          no bug there. Thus, I should invent a way to remove the
          processed messages permanently between restarts.</div>
      </div>
    </blockquote>
    <p>There's already a suggestion to move mails to a different IMAP
      folder after processing:
      <a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq/issues/1632">https://github.com/certtools/intelmq/issues/1632</a></p>
    <p>Pull requests welcome :)</p>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:1945563404.128297.1628061111271.JavaMail.zimbra@csc.fi">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        10pt; color: #000000">
        <div><br data-mce-bogus="1">
        </div>
        <div>Br, Mika</div>
        <div><br>
        </div>
        <hr id="zwchr" data-marker="__DIVIDER__">
        <div data-marker="__HEADERS__"><b>From: </b>"Sebastian Wagner"
          <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at"><wagner@cert.at></a><br>
          <b>To: </b>"intelmq-dev" <a class="moz-txt-link-rfc2396E" href="mailto:intelmq-dev@lists.cert.at"><intelmq-dev@lists.cert.at></a><br>
          <b>Sent: </b>Wednesday, 4 August, 2021 09:43:27<br>
          <b>Subject: </b>Re: [IntelMQ-dev] How does one avoid
          reprocessing mail attachments already processed?<br>
        </div>
        <div><br>
        </div>
        <div data-marker="__QUOTED_TEXT__">
          <p>Hi,<br>
          </p>
          <div class="moz-cite-prefix">On 8/4/21 8:26 AM, Mika Silander
            wrote:<br>
          </div>
          <blockquote
            cite="mid:1450680057.107134.1628058364964.JavaMail.zimbra@csc.fi">
            <pre class="moz-quote-pre"> We are using the mail collector bot to read email attachments over IMAPS. It works fine but rereads all the messages in the message folder even if it had processed them already. Is there a way to configure the mail bot to remove the messages once it has processed them? I didn't find a hint concerning this in the bot's documentation nor the sources. What approaches do people use to avoid reprocessing messages?</pre>
          </blockquote>
          <p>The bot should only look at <i>unread</i> mails, plus the
            other criteria like subjects etc. After the successful
            processing, the mails are marked as read to avoid
            re-processing. If that does not work for you, that's a bug.</p>
          <p>best regards<br>
            Sebastian<br>
          </p>
          <p>Reading just unread mails:
            <a class="moz-txt-link-freetext"
href="https://github.com/certtools/intelmq/blob/72cee0ee5eeede17700604b138f2bc419703f461/intelmq/bots/collectors/mail/_lib.py#L58"
              target="_blank" moz-do-not-send="true">https://github.com/certtools/intelmq/blob/72cee0ee5eeede17700604b138f2bc419703f461/intelmq/bots/collectors/mail/_lib.py#L58</a><br>
            Marking mail as seen after processing a mail:
            <a class="moz-txt-link-freetext"
href="https://github.com/certtools/intelmq/blob/72cee0ee5eeede17700604b138f2bc419703f461/intelmq/bots/collectors/mail/_lib.py#L74"
              target="_blank" moz-do-not-send="true">https://github.com/certtools/intelmq/blob/72cee0ee5eeede17700604b138f2bc419703f461/intelmq/bots/collectors/mail/_lib.py#L74</a><br>
          </p>
          <blockquote
            cite="mid:1450680057.107134.1628058364964.JavaMail.zimbra@csc.fi">
          </blockquote>
          <pre class="moz-signature">-- 
// Sebastian Wagner <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at" target="_blank" moz-do-not-send="true"><wagner@cert.at></a> - T: +43 676 898 298 7201
// CERT Austria - <a class="moz-txt-link-freetext" href="https://www.cert.at/" target="_blank" moz-do-not-send="true">https://www.cert.at/</a>
// Eine Initiative der nic.at GmbH - <a class="moz-txt-link-freetext" href="https://www.nic.at/" target="_blank" moz-do-not-send="true">https://www.nic.at/</a>
// Firmenbuchnummer 172568b, LG Salzburg</pre>
          <br>
          _______________________________________________<br>
          IntelMQ-dev mailing list<br>
          <a class="moz-txt-link-freetext" href="https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev">https://lists.cert.at/cgi-bin/mailman/listinfo/intelmq-dev</a><br>
          <a class="moz-txt-link-freetext" href="https://intelmq.readthedocs.io/">https://intelmq.readthedocs.io/</a><br>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
// Sebastian Wagner <a class="moz-txt-link-rfc2396E" href="mailto:wagner@cert.at"><wagner@cert.at></a> - T: +43 676 898 298 7201
// CERT Austria - <a class="moz-txt-link-freetext" href="https://www.cert.at/">https://www.cert.at/</a>
// Eine Initiative der nic.at GmbH - <a class="moz-txt-link-freetext" href="https://www.nic.at/">https://www.nic.at/</a>
// Firmenbuchnummer 172568b, LG Salzburg</pre>
  </body>
</html>