Giter Site home page Giter Site logo

hpi-swa-teaching / imapclient Goto Github PK

View Code? Open in Web Editor NEW
22.0 11.0 3.0 10.74 MB

This project provides a library and tool set to access email through IMAP in the Squeak/Smalltalk environment. (SWT22-13)

License: MIT License

Smalltalk 100.00%
squeak smalltalk imap email

imapclient's Issues

Please readd the deleted metadata

The develop branch is missing:

  • .travis.yml and .smalltalk.ston. How do you even Travis-CI?
  • LICENSE. It is morally questionable to remove the License.
  • README. The MIT license (The license the original Client is under) requires stating the original authors. Removing the README amounts to license violation.

Just reverting the files should fix these issues.

Response class?

ICEndpoint owns methods to check the responses. These could also be used by other objects. Maybe it is a good idea to encapsulate these in a Response class?

Implement test cases for ICFolder class

Within my latest commit we implemented our new class ICFolder.
We need to find some useful ways to test this new class.

I already wrote a test scenario when adding new folders in the hierarchy.

Add functionality to mark E-Mails as \Flagged and \Seen

The IMAP protocol includes flags for \Answered \Flagged \Deleted \Draft \Seen.
We should be able to incorporate functionality for flagged, draft and seen. Flags for \Answered may be difficult without SMTP. Also we shouldn't care about flags for deletion, since we put deleted emails simply in the "trash-folder" (but this should be done in a different issue).

Test refactoring

TestCase method not used properly

for example:
[self assert: (self endPoint ping)] on: Exception do: [ ^ self ]. self fail
self should: (self endPoint ping) raise: Exception

self assert: (self endPoint logout) = true.
self assert: (self endPoint logout) equals: true
or even better: self assert: (self endPoint logout).

Test for broken connection

Check whether the framework recognizes a sudden connection loss. If this is not the case, implement a feature to handle this behavior.

Improve the Save Credentials Feature

A User who checks his mails on a regular basis, wont fill in his credentials every time. So I implemented the save credentials check box. Its just creating an config.txt in the Resources Directory, where the credentials are stored in plaintext. This is far away from being good. If i hand my squeak image to a friend, i would also give him my password in plain text.

  • We shouldnt save the Logindata file into the resource directory of the image
  • We should encrypt it somehow. The IMAP Client should be the only one able to decrypt it again. But how should we implement this? Any Ideas?

ICAuthenricationInfo>>isValid misleading name?

The message checks if the username and passwort differs from the default values.
If the default values are not valid values, the name default value is a little bit misleading?

Furthermore if a server has these default values as user credentials, they can not be used, because they are incorrectly recognised as "inValid".

In my opinion these message is not necessary and can be deleted

Server connection closed after inactivity

Seems like the server is closing the connections after a few minutes of inactivity. We should find a way to reopen the connection. At the Moment i cant open any mails anymore, after waiting for a few minutes.

image

deleting emails may change messageIDs stored in Email object

Currently a dynamic message id is stored in an email object. The message ids are enumerated beginning from 1 on the server. If a email is removed out of our system from the server, the stored message ids may not be up to date.
This could be fixed by a server wide global message id or by fetching the message ids every time before they are used.

Add functionality to mark E-Mails as read/unread

Sobald der Inhalt einer Email geöffnet wird, wird die Email als gelesen markiert.
Die Schrift von Betreff, Absender und Datum einer ungelesenen Email wird fett markiert.
Eine gelesene Email wird nicht fett markiert.

Constants on class or on instance side

In SWA we learned (from @krono) that constants should be implemented on instance side of classes.
In @Hannes01071995 and my opinion this does not make much sense. Since constants should be constant for every instance of a class this should be on class side.
Please state your opinion.

Feature: Delete emails

Deleting messages in IMAP is a bit tricky, as there is no explicit delete command. Instead, a flag is set on the message marking it as deleted. This, by itself, does nothing to get the message removed. Just when a special command is called all messages in the current folder marked as to be deleted are removed.

. UID SEARCH ALL

  • 1 EXISTS
  • 1 RECENT
  • SEARCH 1814
    . OK Completed
    . UID STORE 1814 +FLAGS (\Deleted)
  • 1 FETCH (FLAGS (\Recent \Deleted \Seen) UID 1814)
    . OK Completed
    . EXPUNGE
  • 1 EXPUNGE
  • 0 EXISTS
  • 0 RECENT
    . OK Completed
    . UID SEARCH ALL
  • SEARCH
    . OK Completed

The above is executed in a folder containing just a single message (see the result of the UID SEARCH ALL). The flag \Deleted is then added to flag list of the message (UID STORE 1814 +FLAGS (\Deleted)). The STORE command returns the new flag list. The EXPUNGE command then removes the message.

improve interface for connect methods

At the moment a error is thrown if the connect fails otherwise it returns true.
For me it is a little bit confusing. Either the return value should be checked to indicate failure or the failure is indicated through an exception. As far as I know currently no message (for example UI) checks the return value, so it should be enough to check for exceptions?

Remove comments in source code resp. using message comments

  • ICEndpoint>>connectTo: a "stream nextResponse" call is needed to skip the server greetings. Since this call is on a different abstraction level and the purpose is not clear a commend was used.
    Ideas:
    1. a skipServerGreetings message which encapsulate this line
    2. a checkServerGreetings message which encapsulate this line and could (later) check the greeting for success etc.
  • ICEndpoint>>fetchNextResponse
    ideas:
    1. using the message comment
  • ICEndpoint>>folderFromResponse
    idea:
    1. using the message comment

Fetching Email Bodys often fails

Maybe we should collect here different types of mails, which cant be parsed atm:

So i wanted to open an amazon mail, which fails in the parseFetchBody Method within the Function asTextFromHtml. So there are 2 issues at the moment. The Amazon Mail contains two Content-Types.
Content-Type: text/plain; charset=utf-8 and Content-Type: text/html; charset=utf-8. I think as long as we are not able to display css with html properly (we should think about using an squeak web browser?). We should always go for the Content-Type: text/plain; charset=utf-8. Often Emails are sent with both Content-Types for devices not capable of displaying HTML.

At the Moment our parseFetchBody method is just

((self lastResponse copyFrom: 2 to: (self lastResponse size - 1)) joinSeparatedBy: Character cr) asTextFromHtml 

Instead of taking everything from 2 to last -1 index, we have to parse the body, looking for content-types and only render the specific content-type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.