-
Notifications
You must be signed in to change notification settings - Fork 88
feat: allow setting sent date on APPEND #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I tested the implementation on a small tool to migrate a massive mbox file through imap on fastmail.com. Emails appear with expected times. There's no test for append so I was lazy and didn't add to it. So yeah, ready for review @jonhoo :) |
Excellent, thank you! I left one small inline comment, but that's the only thing. It would be very nice to have an append test, but I'm not going to require it :p |
Changed DateTime<Local> to DateTime<FixedOffset> Local takes the timezone from the system. Utc sets to +0000 we seem to be wanting one that remains fixed so that when formatted it is a specified.
f0e5bf3
to
e380177
Compare
The test is temporarily disabled since the other append test doesn't seem to clean up properly, so the `.len()` test may either be 1 or 2. Also the date isn't reflected in either Greenmail or in the returned envelope.
Oh, my mistake hadn't seen the integration tests. I've added a test for the However, I had to disable it for now since the date returned from Greenmail is the time of the append not the date given. The date you specify with APPEND is the internal date as far as I know. I'm not sure how to best test this as the returned envelop would have the sent date not the internal date. I guess I could send to emails first one without Any thoughts? |
Greenmail seems to be doing things by the book: |
That's interesting -- if it doesn't modify the actual message date, how then is Also, I had another thought over the weekend: I think this append API is getting pretty unwieldy. Given that we're going to be doing a breaking release soon anyway, I suggest we just make struct AppendOptions<'a> {
flags: Option<&'a [Flag<'a>]>,
date: Option<DateTime<FixedOffset>>,
} And then have a couple of nice |
Yes, that was it.
The You also mentioned (somewhere) that you take the path of a builder. Would the you then create an AppendCmd that implements
Or did you think to have a more generic command builder that was fed to something like |
Ah, yes, |
References issue #60
Followed syntax of (date-time token) http://www.faqs.org/rfcs/rfc3501.html
I followed the pattern of
append
callingappend_with_flags
callingappend_with_flags_and_date
.This change is