Skip to content

Commit

Permalink
Merge eae68db into e3f3273
Browse files Browse the repository at this point in the history
  • Loading branch information
EightSQ committed Jul 26, 2019
2 parents e3f3273 + eae68db commit d497a6f
Show file tree
Hide file tree
Showing 29 changed files with 70 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ retrieveBody
self folder endpoint
select: self folder path;
fillBodyFor: self.

"add the Content-Type to mail body --> necessary for correct parsing"


^'Content-Type: ', (self contentType), Character cr,
'Content-Transfer-Encoding: ', self contentTransferEncoding,
Character cr, Character cr, self body
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"modifyFlag:" : "C.G. 7/25/2018 13:48",
"moveEmail:" : "fr 7/26/2019 15:41",
"open" : "lvm 5/20/2018 20:10",
"retrieveBody" : "fr 7/26/2019 16:01",
"retrieveBody" : "ok 7/26/2019 21:07",
"retrieveFlags" : "pm 6/2/2019 15:58",
"saveInMaildir" : "pm 6/2/2019 15:58",
"seen" : "C.G. 7/25/2018 13:49",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
accountFolderHashRelevantCharacters

^ 10

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
refreshConnectionIntervalInSeconds

^ 60 * 10
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ currentUIDsFor: anICFolder
removeFirst;
removeFirst;
yourself)]
ifTrue: [
Transcript show: (anICFolder folderName), ' is an empty folder!'.
^ OrderedCollection new]
ifTrue: [^ OrderedCollection new]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
host

^ self accountInfo host
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ loadEmailsFromMaildir
directoryName := self rootFolderName.

(directory directoryExists: directoryName)
ifFalse: [
Transcript show: 'Maildir doesnt exist'.
^ (OrderedCollection new)].
ifFalse: [^ (OrderedCollection new)].

^ self createEmailsWith: directory andName: directoryName and: (self rootFolder)
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ fetching
maildirDiffFetchHeadersFrom: start to: end

| searchBegin searchEnd mailFolder |

(FileDirectory default directoryExists: (FileDirectory default fullPathFor: self maildirFileName))
ifTrue: [
mailFolder := FileDirectory default on: self maildirFileName.
searchBegin := mailFolder fileNamesMatching: (end asString).
searchEnd := mailFolder fileNamesMatching: (start asString).

(searchBegin notEmpty and: [searchEnd notEmpty]) ifTrue: [
Transcript show: 'Do nothing. Newest Mailrange already loaded'.
^ OrderedCollection new]].

(searchBegin notEmpty and: [searchEnd notEmpty])
ifTrue: [^ OrderedCollection new]].

^ self
sendCommand: (ICCommand fetchHeadersForUIDsFrom: start to: end);
fetchNextResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
connection
refreshConnectionProcess

| delayTime |

delayTime := 60 * 10. "Wait for 10 minutes."

[self isConnected and: [self loggedIn]]
whileTrue: [
self sendCommand: ICCommand noop.
self fetchNextResponse.
Transcript show: 'Prevent timeout'.
(Delay forSeconds: delayTime) wait]
(Delay forSeconds: self class refreshConnectionIntervalInSeconds) wait]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
accessing
rootFolderName

^ (SecureHashAlgorithm new hashMessage: self accountInfo host, self accountInfo username) asString first: 10
^ (SecureHashAlgorithm new
hashMessage: self host, self username)
asString first: self class accountFolderHashRelevantCharacters
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
username

^ self accountInfo username
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"class" : {
"accountFolderHashRelevantCharacters" : "ok 7/26/2019 19:11",
"addConfiguration:" : "tg 7/8/2019 15:12",
"basicConnectionConfigurations" : "tg 7/8/2019 15:14",
"checkValidConfiguration:" : "tg 7/18/2019 23:06",
"clearConfigurations" : "pm 6/19/2019 13:17",
"connectionConfigurations" : "tg 7/8/2019 15:14",
"connectionConfigurations:" : "pm 6/19/2019 14:49",
"defaultStreamClass" : "tg 7/15/2019 13:26",
"errorBadParameter" : "jwe 7/28/2016 11:12",
"errorBadProtocol" : "js 5/15/2016 13:55",
"errorInvalidAuthenticationConfiguration" : "js 5/15/2016 16:16",
"errorInvalidConnectionConfiguration" : "js 5/15/2016 16:15",
"errorLoginFailed" : "js 5/15/2016 14:57",
"errorNoConnection" : "tg 7/19/2019 09:39",
"errorNoPasswordSet" : "js 5/15/2016 13:51",
"errorNoUsernameSet" : "js 5/15/2016 13:51",
"refreshConnectionIntervalInSeconds" : "ok 7/26/2019 21:04",
"removeConfiguration:" : "tg 7/8/2019 15:12" },
"instance" : {
"accountInfo" : "tg 7/10/2019 17:23",
Expand All @@ -32,7 +28,7 @@
"currentFolderName" : "C.G. 7/25/2018 13:50",
"currentFolderName:" : "C.G. 7/25/2018 13:50",
"currentUIDs" : "fr 7/26/2019 15:48",
"currentUIDsFor:" : "fr 7/26/2019 16:22",
"currentUIDsFor:" : "ok 7/26/2019 21:01",
"deleteEmail:" : "tg 7/26/2019 14:12",
"expungeEmail" : "pm 7/23/2019 15:07",
"fatalErrorOccured" : "tg 7/26/2019 21:05",
Expand All @@ -45,26 +41,27 @@
"folderNameOfTrash:" : "tg 7/26/2019 14:13",
"hierarchyDelimiter" : "mw 5/11/2018 10:37",
"hierarchyDelimiter:" : "mw 5/11/2018 10:37",
"host" : "ok 7/26/2019 19:09",
"isConnected" : "js 6/7/2016 10:13",
"lastResponse" : "pm 6/9/2019 13:10",
"lastResponse:" : "lvm 5/24/2018 10:16",
"listAllFolders" : "js 6/14/2016 12:31",
"listFoldersIn:using:" : "pm 7/23/2019 14:51",
"loadEmailsFromMaildir" : "pm 6/3/2019 18:33",
"loadEmailsFromMaildir" : "ok 7/26/2019 21:02",
"loggedIn" : "pm 6/9/2019 13:07",
"loggedIn:" : "js 5/15/2016 13:09",
"login" : "tg 7/26/2019 11:43",
"logout" : "tg 7/25/2019 12:42",
"maildirDiffFetchHeadersFrom:" : "tg 7/15/2019 13:31",
"maildirDiffFetchHeadersFrom:to:" : "fr 7/26/2019 15:56",
"maildirDiffFetchHeadersFrom:to:" : "ok 7/26/2019 21:02",
"maildirFileName" : "tg 7/26/2019 21:05",
"moveEmail:to:" : "pm 7/23/2019 14:58",
"parseFetchHeaders:" : "fr 7/26/2019 15:53",
"parseFetchedFlagsAndPopulate:" : "pm 7/25/2019 17:45",
"parseListResponse" : "tg 7/26/2019 14:20",
"ping" : "pm 7/23/2019 15:09",
"preventTimeout" : "lvm 7/23/2018 23:33",
"refreshConnectionProcess" : "pm 7/23/2019 15:09",
"refreshConnectionProcess" : "ok 7/26/2019 21:04",
"resetFlag:and:" : "tg 7/26/2019 13:44",
"retrieveFlagsFrom:to:in:" : "pm 7/25/2019 17:45",
"rootFolder" : "pm 6/9/2019 13:09",
Expand All @@ -77,4 +74,5 @@
"stream:" : "js 6/7/2016 10:17",
"testAccountWith:" : "tg 7/15/2019 12:29",
"uids" : "C.G. 7/25/2018 13:59",
"uids:" : "pm 6/9/2019 16:52" } }
"uids:" : "pm 6/9/2019 16:52",
"username" : "ok 7/26/2019 19:09" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
accountName

^ self endpoint accountInfo accountName
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
hierarchyDelimiter

^ self endpoint hierarchyDelimiter
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
parentPath

^ self parent path
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
folder hierarchy
path

^ (self parent == self endpoint rootFolder)
^ (self parent == self rootFolder)
ifTrue: [ self folderName ]
ifFalse: [ self parent path, self endpoint hierarchyDelimiter, self folderName]
ifFalse: [ self parentPath, self hierarchyDelimiter, self folderName]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rootFolder

^ self endpoint rootFolder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ update: aBlock

ProgressNotification
signal: (aBlock value)
extra: (self endpoint accountInfo accountName, ' Mailbox. Folder: ', self folderName).
extra: (self accountName, ' Mailbox. Folder: ', self folderName).

self startUpdateProcess: self highestUniqueID.
self childFolders do: [:anICFolder | anICFolder update: aBlock]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"numberOfHeadersToFetchAtLoadOlderMails" : "DH 7/22/2018 22:37",
"numberOfHeadersToFetchAtTheBeginning" : "DH 7/22/2018 22:37" },
"instance" : {
"accountName" : "ok 7/26/2019 19:06",
"addFolder:" : "js 6/7/2016 13:09",
"checkTopicality" : "fr 7/26/2019 15:57",
"childFolderNamed:" : "C.G. 7/25/2018 14:02",
Expand All @@ -24,18 +25,21 @@
"fetchHeadersFrom:" : "tg 7/26/2019 21:05",
"folderName" : "tg 7/19/2019 09:17",
"folderName:" : "tg 7/19/2019 09:17",
"hierarchyDelimiter" : "ok 7/26/2019 19:02",
"highestUniqueID" : "pm 6/3/2019 18:34",
"latestEmails:" : "fr 7/26/2019 15:55",
"loadOlderMails" : "tg 7/26/2019 21:05",
"lowestUniqueID" : "pm 6/3/2019 18:34",
"numOfUnseenMails" : "C.G. 7/25/2018 14:03",
"parent" : "tg 6/25/2019 21:21",
"parent:" : "js 6/7/2016 11:32",
"path" : "tg 7/19/2019 09:20",
"parentPath" : "ok 7/26/2019 19:08",
"path" : "ok 7/26/2019 19:08",
"recursiveChildFolders" : "tg 7/25/2019 12:56",
"removeFolder:" : "C.G. 7/25/2018 14:03",
"removeFolder:ifAbsent:" : "C.G. 7/25/2018 14:04",
"retrieveFlagsFrom:to:" : "fr 7/26/2019 15:37",
"rootFolder" : "ok 7/26/2019 19:05",
"startUpdateProcess:" : "tg 7/26/2019 20:33",
"update" : "pm 6/3/2019 18:34",
"update:" : "tg 7/19/2019 09:19" } }
"update:" : "ok 7/26/2019 19:05" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
connectionTimeout

^ 10
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessing
lastResponse: anOrderedCollection

Transcript show: 'RECEIVED: ', (anOrderedCollection copy truncateTo:50); cr.
lastResponse := anOrderedCollection
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ sslConnectTo: host on: port
| hostAddress |

hostAddress := NetNameResolver addressForName: host.
self stream: (SecureSocketStream openConnectionToHost: hostAddress port: port timeout: 10).
self stream: (SecureSocketStream openConnectionToHost: hostAddress port: port timeout: self class connectionTimeout).
self stream sslConnectTo: host
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"class" : {
},
"connectionTimeout" : "ok 7/26/2019 18:50" },
"instance" : {
"close" : "js 6/14/2016 10:43",
"connectTo:on:" : "C.G. 7/25/2018 14:08",
Expand All @@ -9,14 +9,14 @@
"host:" : "js 6/7/2016 09:59",
"isConnected" : "js 6/7/2016 10:04",
"lastResponse" : "js 6/7/2016 10:08",
"lastResponse:" : "pm 6/9/2019 16:59",
"lastResponse:" : "ok 7/26/2019 21:15",
"nextResponse" : "C.G. 7/25/2018 14:09",
"port" : "js 6/7/2016 09:59",
"port:" : "pm 6/9/2019 16:59",
"sendCommand:" : "DH 6/26/2018 20:20",
"ssl" : "pm 6/9/2019 13:14",
"ssl:" : "ms 7/12/2016 09:45",
"sslConnectTo:on:" : "C.G. 7/25/2018 14:09",
"sslConnectTo:on:" : "ok 7/26/2019 18:52",
"stream" : "pm 6/9/2019 13:14",
"stream:" : "js 6/7/2016 10:05",
"useSSL" : "ms 7/12/2016 09:45" } }

0 comments on commit d497a6f

Please sign in to comment.