         return FetchResult(uid: uid,
                            header: header,
                            flags: flags,
-                           body: body?.mergeAttachments(attachments),
+                           body: body?.mergeAttachments(attachments: attachments),
                            rfc822Size: rfc822Size,
                            internalDate: internalDate,
                            gmailThreadId: gmailThreadId,

            }
    }
    
    func rac_fetchTextualMail(folder: String, uids: NSIndexSet) -> SignalProducer<FetchResult, PostalError> {
        return rac_fetch(folder, uids: uids, flags: [ .structure, .fullHeaders ])
            .flatMap(.Concat) { (fetchResult: FetchResult) -> SignalProducer<FetchResult, PostalError> in
                let inlineElements = fetchResult.body?.allParts.filter { singlePart in
                    if case .Some(.attachment) = singlePart.mimeFields.contentDisposition { return false }
                    return [ "text/html", "text/plain" ].contains("\(singlePart.mimeType)")
                    } ?? []
                
                return SignalProducer<SinglePart, PostalError>(values: inlineElements)
                    .flatMap(.Merge) { (singlePart: SinglePart) -> SignalProducer<(String, MailData), PostalError> in
                        return self.rac_fetchAttachment(folder, uid: fetchResult.uid, partId: singlePart.id).map { (singlePart.id, $0) }
                    }
                    .collect()
                    .map { fetchResult.mergeAttachments(Dictionary(elements: $0)) }
            }
    }
}

private extension Dictionary {
    init<S: SequenceType where S.Generator.Element == Element>(elements: S) {
        self.init()
        for (k, v) in elements {
            self[k] = v

            self.connect(timeout: Postal.defaultTimeout) { result in
                result.analysis(
                    ifSuccess: {
                        observer.send(value: ())
                        observer.sendCompleted()
                    },
                    ifFailure: observer.send)
                }
            }
    }
