Skip to content

Commit

Permalink
Stable release of 2021 group (#430)
Browse files Browse the repository at this point in the history
* first steps to implement a working offline mode. Therefor the exsisting object saving of the mails is used. this tries to resolve the issue:"Offline reading of mails #383"

* first steps to implement a working offline mode. Therefor the exsisting object saving of the mails is used. this tries to resolve the issue:"Offline reading of mails #383"

* fix trying to make loading possible on windows

* Fixing MIME-Error and refactoring call stack for fetching an E-Mail-Body

* Fixing red test appeared after last session refactoring.

* Added CommandStorage for offline mode.

* Flagging in offline mode is now possible

* small changes to fix some bugs and make the code better

* E-Mail flag change now shown in offline-mode

* the setting and unsetting of flags is now offline possibe and synced to the server when connected with the internet again.

* Add feature to add contacts and contact names to the address book (#396)

* Added feature for adding contacts to address book

* Contact Objects have been introduced for address book entries. A contact consists of a name and an email address field. 

Contact names are displayed (additionally to email addresses) in the address book.

Tests for contacts and the address book are created/modified accordingly. 

This commit includes refactoring for adding contacts.

* Refactoring for contact names and add-contact feature

* Add icons in ICFolderDialog (#401)

* adds icons for update, contacts and add account button in ICFolderDialog

* move addContactIcon and add newlines

* Trying to fix Ubuntu-Test-Failure

* All Mails are fetched to hard drive during update or login

* Fixed failing test

* Feature/offline mode (#398)

* first steps to implement a working offline mode. Therefor the exsisting object saving of the mails is used. this tries to resolve the issue:"Offline reading of mails #383"

* first steps to implement a working offline mode. Therefor the exsisting object saving of the mails is used. this tries to resolve the issue:"Offline reading of mails #383"

* fix trying to make loading possible on windows

* Fixing MIME-Error and refactoring call stack for fetching an E-Mail-Body

* Fixing red test appeared after last session refactoring.

* Added CommandStorage for offline mode.

* Flagging in offline mode is now possible

* small changes to fix some bugs and make the code better

* E-Mail flag change now shown in offline-mode

* the setting and unsetting of flags is now offline possibe and synced to the server when connected with the internet again.

* Trying to fix Ubuntu-Test-Failure

* Refactoring for offline mode

* resolve merge conflicts yet again

* Loading time is dramatically reduced

* Small fixes

* Create merge_request_template.md

can be selected when creating a merge request

* Add feature to show last synchronization time (#400)

## What does this change?
Adds the feature to show the last synchronization time in ICFolderDialog

dialog title of an ICFolderDialog instance is updated after every successfull update.

* Rename merge_request_template.md to pull_request_template.md

* Sort the address book by name and mail address (#403)

## What does this change?
adds the ability to sort the address book by name and mail address
add tests for address book sorting

* Equalize button sizes (#408)

equalizes the size of the buttons on the navigation panel in ICFolderDialog (they have the same extent now)

* remove broken Travis-CI badge and add 2021 team

* Refactoring endpoint (#407)

Splitted ICEndpoint in ICEndpoint and ICConnectionHandler (splits off direct server communication). Enhances Architecture for online/offline mode switch.

* test folder load offline

* Splits Login from ICFolderDialog initialization

* deletes readFoldersFromDisk

* set unitializedAccounts

* relieve passwordPromptCallback and accountsComplete

* restore multiple account login

* emails not read from disk second time in login process

* removing uninitializedAccounts instance variable

* "production ready"

* implements moving of offline emails, not tested yet

* still under development, further smooothing out some bugs

* Adding MockCommandStorage to fix tests (#414)

Added MockCommandStorage to fix failing tests.

* Increase test coverage (#412)

This adds missing tests for ICAccountInfo, ICFolder and ICEmail.

* in development, just to save progress

* Merge login into offline_email_move (#416)

copy current state of login branch

* now the Moving of emails should work properly offline and online, please test at your system before approving. Sould be ready to merge into develop.

* finalizing this branch to merge.
Especially adressing comments by laugengebaeck, most small fixes without additional features or bugs.
Also adding a new dialogTitle for the case the clinets is opened but not updated.

* fix spelling mistakes

* Access to email account in offline mode (#413)

[Feature] Adds the possibility to access offline mode of IMAP Client without being logged in.

Splits Login Process from ICFolderDialog initialization. Emails and Folders are loaded from File Storage (structure from last synchronization). Uses the UIManager for password request. Layered structure for calls from UI to interface with returns implemented. Bugs for login fixed (fatal error extracted from login process). Adjusted inital login for editing and adding accounts accordingly.

Closes #409 and closes #410

* address review comments

* The commit fixes the briken tests and addresses some minor problems. 
The tests required a variable not provided by the environment

* Fixing moving of emails

* fixing moving of emails again

* Update README to reflect changes in this iteration (#419)

main changes: updated screenshots and added explanation for new offline mode and address book features

* Feature/offline tests (#420)

Adds Tests for

-Offline Switch Flag
-Offline Delete Mail
-Offline Move Email (also part of delete Mail)
-Update Process (mocked Endpoint)

* Fix wrong folder selection for moving (#426)

show all but currently selected folder in move menu (fix for #379)

* Connection closing on shutdown (#427)

close connection on image shutdown to prevent errors when reopening IMAPClient (fix for #397)

* Small Refactoring  (#425)

* Small changes for style and law of demeter

* Refactorings to shorten methods

* More refactoring to shorten methods

* Small refactorings for style

* LoginDialog is back, sorry!

* Fix failing test

* Fixed Flags Bugs

* update tests related to flag storement

* Fixing minor style/linting issues last minute (#429)

* Improve style in updateProcess

* Revert "Improve style in updateProcess"

Co-authored-by: Johann Schulze Tast <[email protected]>
Co-authored-by: Jan Groeneveld <[email protected]>
Co-authored-by: Smilla Fox <[email protected]>
Co-authored-by: Elena Gensch <[email protected]>
Co-authored-by: Christian Helms <[email protected]>
Co-authored-by: Lukas Rost <[email protected]>
  • Loading branch information
6 people authored Aug 6, 2021
1 parent 94d8137 commit 21aabaa
Show file tree
Hide file tree
Showing 528 changed files with 2,354 additions and 984 deletions.
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## What does this change?

[Bug/Feature]*First, briefly describe what this merge request does.*

*Then, describe the changes in more detail (tests added, summary of )*
*Make sure potential reviewers have enough information to quickly dive in and understand the changes.*
Fixes *#number*

Co-authored-by: *name <[email protected]>*
Co-authored-by: *another-name <[email protected]>*


## Decisions / Choices I made

*This text should provide background information on the changes you did (optional). A great merge request answers at least the following question:*
*- Which architectural or implementation decisions did you make? And why?*

*Remember: The more information you give other developers, the easier it is for them
to understand and review the code, and the more helpful their review will ultimately be.*


## Checklist

- [ ] Your branch has no merge conflicts with master
- [ ] All related commits are squashed together
- [ ] Singleton / Database changed*: if changed which Singleton*
10 changes: 5 additions & 5 deletions .squot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OrderedDictionary {
'packages\/BaselineOfIMAPClient.package' : #SquotCypressCodeSerializer,
'packages\/IMAPClient-Core.package' : #SquotCypressCodeSerializer,
'packages\/IMAPClient-Tests.package' : #SquotCypressCodeSerializer,
'packages\/IMAPClient-UI.package' : #SquotCypressCodeSerializer,
'packages\/IMAPClient-Protocol.package' : #SquotCypressCodeSerializer
'packages/BaselineOfIMAPClient.package' : #SquotCypressCodeSerializer,
'packages/IMAPClient-Core.package' : #SquotCypressCodeSerializer,
'packages/IMAPClient-Tests.package' : #SquotCypressCodeSerializer,
'packages/IMAPClient-UI.package' : #SquotCypressCodeSerializer,
'packages/IMAPClient-Protocol.package' : #SquotCypressCodeSerializer
}
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IMAPClient [![Build Status](https://travis-ci.org/hpi-swa-teaching/IMAPClient.svg?branch=develop)](https://travis-ci.org/hpi-swa-teaching/IMAPClient) [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/IMAPClient/badge.svg?branch=develop)](https://coveralls.io/github/hpi-swa-teaching/IMAPClient?branch=develop)
# IMAPClient [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/IMAPClient/badge.svg?branch=develop)](https://coveralls.io/github/hpi-swa-teaching/IMAPClient?branch=develop)

Welcome to our IMAP Client project. We are a team of 4th semester IT-Systems Engineering students and are happy to take over this project for the sixth iteration.
This project is part of a lecture in Softwareengineering techniques and will be contributing to our final grade, so we are giving it our best ;)
Welcome to our IMAP Client project. We are a team of 4th semester IT-Systems Engineering students and are happy to take over this project for the seventh iteration.
This project is part of a lecture in Software Engineering techniques and will be contributing to our final grade, so we are giving it our best ;)
As this is a student project, it will mostly be worked on during the summer terms. Therefore our time with this project is limited to the end of july.

In case of any questions, feel free to contact us.
Expand All @@ -25,51 +25,54 @@ Metacello new
You can open the tool with the command `ICFolderDialog new` or using a Menu Entry.

## Configuration
You can customize the number of mails, which are fetched on the initial update process, and the number of mails which are loaded if you press the `Load older Mails` Button. Default are 100 and 10. Change `ICFolder>>numbersOfHeadersToFetch{AtLoaderOlderMail | AtTheBeginning}`
You can customize the number of mails, which are fetched on the initial update process, and the number of mails which are loaded if you press the `Load older Mails` Button. Default are 100 and 10. Change `ICFolder>>numbersOfHeadersToFetch{AtLoadOlderMail | AtTheBeginning}`
This will not regard the e-mails that are already persisted on your disk, so if you have some e-mails in a Maildir directory, all of them will be read no matter what you defined here.

## Features
- Manage different accounts
- _Manage different accounts_
![](screenshots/addAccount.png)
You can add an account by clicking the `+` button. You will then be prompted to enter the account information needed to establish a connection with the server.

- Fetch new mails from the server
- _Fetch new mails from the server_
![](screenshots/updating.png)
Mails are automatically fetched on login. If you wish to update and resynchronize with the server, click the update button.
Mails are automatically fetched on the first login. If you wish to update and resynchronize with the server afterwards, click the update button. The title bar of the tool will show you the time of the last successful synchronization to help you decide if you want to update.

- Delete & move mails
- _Delete & move mails_
![](screenshots/move.png)
A right click on any mail will show you your options. Deleting a mail automatically moves it to the trash folder. If you want to revert a deletion, you can simply navigate to the trash folder and move the email back to another folder.
When you want to permanently delete emails, right click on the trash folder and choose expunge. This will dump your trash folder permanently.

- Flag and read emails
- _Flag and read emails_
A right click on any mail will show you your options. You can flag an email for later use or mark it as seen if you do not want to be disturbed by it beeing highlighted anymore. Also you can mark already seen mails as unseen again.
![](screenshots/flag.png)
![](screenshots/unflag.png)

- See unseen mails immediately.
- _See unseen mails immediately._
All unseen mails will be highlighted and the number of unseen mails per folder can be seen next to the folder name.

- Search Mails
- _Search Mails_
![](screenshots/search.png)
You can enter a search string into the search bar at the top. Right next to the search bar you can see, how many search results you got for the current search.
You can enter a search string into the search bar at the top. Right next to the search bar you can see how many search results you got for the current search.

- Parse different encodings
- _Parse different encodings_

- Reflect server changes back to Client.
- _Reflect server changes back to Client._
If you're accessing your mails for a different device, and deleting/moving them, just press the update button in the Client, and every change should be correctly updated.

- Sort mails by different categories.
- _Offline mode_
All above features are also available while you are offline. Specifically, mails can be read, flagged and moved to other folders after they were downloaded on the first login. As soon as you are online again, you may resynchronize your account with the server by clicking on the update button and filling in your password.

- _Sort mails by different categories._
![](screenshots/sort.png)
By default all sortings are ascending. Double clicking the button will switch do descending order.
By default all sortings are ascending. Double clicking the button will switch to descending order.

- Addressbook.
- _Addressbook._
![](screenshots/addressbook.png)
You can open the addressbook by clicking the button with the person icon. The adressbook holds all sender addresses of mails from any of the currently logged in accounts.
You can open the addressbook by clicking the button with the persons icon. The adressbook holds all sender names and addresses of mails from any of the currently logged in accounts. You can also add your own contacts by clicking on the respective button. Finally, it is possible to sort contacts in ascending or descending order by both sender name and address.

## Usage
Start the IMAP Client with `ICFolderDialog new`. Add new Accounts with the `+` Button. We tested the functionality with web.de Accounts. But other accounts should work fine.
The hpi owa accounts are known to be relatively large, as calendar and contact meta information is also sent to our client as folder objects. Therefore it might not entirely load in the requested time of 5 seconds.
The HPI OWA accounts are known to be relatively large, as calendar and contact meta information is also sent to our client as folder objects. Therefore it might not entirely load in the requested time of 5 seconds.

For HPI accounts use the following login info:
```
Expand All @@ -90,18 +93,18 @@ Use SSL: True

## Security
Your password isn't stored on disk, but will be visible to your Squeak environment. It is immediately deleted after login, so you will not be able to retrieve it afterwards, but be aware that we are no security experts and you might not want to test this with a high severity account.
After closing the IMAP-Client and reopening it your are welcomed by a password prompt to re-enter your credentials.
After closing the IMAP-Client and reopening it, you are welcomed by a password prompt when you click the update button for the first time.

## Known Problems

As this project has lived through many iterations, there are a couple of known issues that we could not resolve during the few months we spend with this project.
If you encounter any problem while using our IMAP client, have a look at the Issues of this GitHub Project. Most of them are probably already known to us.
If you encounter any problem while using our IMAP client, have a look at the [Issues](https://github.com/hpi-swa-teaching/IMAPClient/issues) of this GitHub Project. Most of them are probably already known to us.
In case your problem has not been reported yet, feel free to post a new issue and describe what you did to get the problem, what the unexpected behaviour was and what behaviour you would have expected.
Thank you in anvance for contributing to making this project better by reporting any problems that we are not yet aware of!
Thank you in advance for contributing to making this project better by reporting any problems that we are not yet aware of!

## Documentation

Hava a look at the GitHub Project Wiki to find more insights into the project.
Have a look at the [GitHub Project Wiki](https://github.com/hpi-swa-teaching/IMAPClient/wiki) to find more insights into the project.

## History
2016: Johannes Schneider, Maximilian Söchting, Julian Weise, Alexander Riese, Alexander Loeser
Expand All @@ -113,3 +116,5 @@ Hava a look at the GitHub Project Wiki to find more insights into the project.
2019: Paul Methfessel, Martin Taraz, Otto Kissig, Tim Garrels, Felix Rindt

2020: Henrik Guhl, Lorenz Woth, Niko Hastrich, Julia Joch

2021: Smilla Fox, Elena Gensch, Jan Groeneveld, Christian Helms, Lukas Rost, Johann Schulze Tast

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"eraseStoredPassword" : "LW 7/31/2020 11:39",
"hasValidServerInfo" : "tg 7/15/2019 12:08",
"hasValidUserInfo" : "tg 7/15/2019 12:08",
"hash" : "LW 8/1/2020 12:04",
"host" : "tg 7/10/2019 20:06",
"host:" : "tg 7/10/2019 17:11",
"isValid" : "fr 7/26/2019 15:57",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
action
addEmail: aString

self addIfNotPresent: aString

self addAllFirstUnlessAlreadyPresent: {aString} asOrderedCollection
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
initialize
feedMeWithEntries: anEmailCollection

anEmailCollection do: [:emailAccount |
self
readRootFoldersMailsFrom: emailAccount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
initialize
readChildFoldersMailsFrom: anEmailAccount

| anICContact |
anEmailAccount rootFolder recursiveChildFolders do: [:childFolder |
childFolder emails do: [:childFolderEmail |
self addEmail: childFolderEmail senderAddressFromHeader]]
anICContact := ICContact newWith: childFolderEmail senderAddressFromHeader
with: childFolderEmail senderName.
self addEmail: anICContact asString]]
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
initialize
readRootFoldersMailsFrom: anEmailAccount
readRootFoldersMailsFrom: anEmailAccount

anEmailAccount rootFolder emails do: [:rootFolderEmail |
self addEmail: rootFolderEmail senderAddressFromHeader]
| anICContact |
anEmailAccount rootFolder emails
do: [:rootFolderEmail |
anICContact := ICContact newWith: rootFolderEmail senderAddressFromHeader
with: rootFolderEmail senderName.
self addEmail: anICContact asString]
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"class" : {
"new" : "hg 6/24/2020 12:34" },
"instance" : {
"addEmail:" : "LW 6/16/2020 09:51",
"feedMeWithEntries:" : "LW 6/16/2020 09:51",
"addEmail:" : "EG 5/22/2021 09:43",
"feedMeWithEntries:" : "EG 5/20/2021 12:25",
"find:" : "LW 6/16/2020 09:51",
"readChildFoldersMailsFrom:" : "LW 6/16/2020 09:50",
"readRootFoldersMailsFrom:" : "LW 6/10/2020 13:32" } }
"readChildFoldersMailsFrom:" : "EG 5/29/2021 23:35",
"readRootFoldersMailsFrom:" : "EG 5/29/2021 23:35" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An ICCommandStorage stores the user's commands in offline mode so changes can be sychronized with the server later. It maps every account's hash to a list of commands.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
new

Instance ifNil: [Instance := super new].
^ Instance
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
do
add: aCommand for: anAccount

(self at: anAccount ifAbsent: [ self addAccount: anAccount ]) addFirst: aCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
addAccount: anAccount

self at: anAccount put: OrderedCollection new.
^ self at: anAccount
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
getNextCommandFor: anAccount

^ (self at: anAccount) last
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
isEmptyFor: anAccount

^ (self at: anAccount ifAbsent: [ self addAccount: anAccount ]) isEmpty
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
undo
popNextCommandFor: anAccount

^ (self at: anAccount) removeLast
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"class" : {
"new" : "EG 6/25/2021 10:19" },
"instance" : {
"add:for:" : "sf 5/27/2021 12:02",
"addAccount:" : "jng 6/3/2021 11:22",
"getNextCommandFor:" : "jng 5/29/2021 15:09",
"isEmptyFor:" : "sf 5/27/2021 12:25",
"popNextCommandFor:" : "jng 5/29/2021 15:09" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "IMAPClient-Core",
"classinstvars" : [
],
"classvars" : [
"Instance" ],
"commentStamp" : "sf 5/27/2021 09:12",
"instvars" : [
],
"name" : "ICCommandStorage",
"pools" : [
],
"super" : "Dictionary",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ConnectionHandler handles the connection to the server.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
accountInfo: anObject

accountInfo := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
accountInfo

^ accountInfo ifNil: [accountInfo := ICAccountInfo new]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
allUIDs

self sendCommand: ICCommand allUIDs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
connection
assembleResponse

| multiLineResponse |
multiLineResponse := OrderedCollection new.
[ICParser commandSucceeded: self stream lastResponse] whileFalse: [
multiLineResponse add: self stream lastResponse.
self stream nextResponse].

^ multiLineResponse
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
connection
checkConnected

self isConnected
ifFalse: [
self fatalErrorOccured: true.
^ false].

^ true
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
error handling
connection
checkForBadRequest

(self fatalErrorOccured)
ifTrue: [^ false].

(ICParser responseIsError: self stream lastResponse) ifTrue: [
self fatalErrorOccured: true.
^ Error signal: self class errorBadProtocol].
self inform: 'responseError in checkForBadRequest'.
^ true].

^ false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error handling
connection
checkForParameterError

(self fatalErrorOccured)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
login
connection
checkLoggedIn

(self fatalErrorOccured)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
connection
close

self stream close.
self loggedIn: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connection
connect

self connectWith: self class defaultStreamClass
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
connection
connectWith: aStreamClass

self accountInfo isValid ifFalse: [^ Error signal: self class errorInvalidConnectionConfiguration].
self accountInfo isValid ifFalse: [^ self handleInvalidAccountInfo].
[self stream
ssl: self accountInfo ssl;
connectTo: self accountInfo host on: self accountInfo port with: aStreamClass;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
delete
deleteEmail: aMessageID

self sendCommand: (ICCommand deleteEmail: aMessageID)


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
delete
expungeEmails

self sendCommand: ICCommand expungeEmails
Loading

0 comments on commit 21aabaa

Please sign in to comment.