Comments (6)
So, it looks like the 'Mail' gem is failing to parse one of the date headers of an email, and imap-backup is not handling the error.
The only solution I can see within imap-backup is to trap errors like this and log the fact that the email cannot be backed up (and maybe dump the contents of the email). I don't really like that solution as users might not see the log message and might end up relying on backups that are partial.
An alternative is to debug the failure within Mail and try to see if it needs a patch to handle the date in question. To do this we need to work out which email is causing the failure.
If you feel like 'getting you hands dirty', please do the following:
- open the file
/Users/username/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/imap-backup-1.0.9/lib/email/mboxrd/message.rb
and insert the linerescue puts @body
at the end of line 18, i.e.:
@parsed ||= Mail.new(@body) rescue puts @body; exit
- rerun the backup and you should see the text of the email that's causing the failure,
- add the email headers to this issue, or even better put them in a secret gist.
Thanks, Joe
from imap-backup.
Hello Martin,
were you able to pinpoint the email that was causing the problem?
from imap-backup.
so i changed the code of the mail gem to the following:
def parsed
begin
@parsed ||= Mail.new(@body)
rescue
puts @body
exit
end
end
after starting the backup, half an hour later i got an error message like this ( yay viagra spam): https://gist.github.com/martinjuhasz/49c9a8d69581ccdd068a
from imap-backup.
The malformed date is this: Sun, 26 Oct 2012 11:14:66 -0700
(with a seconds value of 66).
In cases like this, I think the only thing to be done is to log the problem and not backup the file.
from imap-backup.
I've released version 1.0.10 which skips unparsable messages. You get no backup, but you get a log message indicating message id and body.
from imap-backup.
i think thats the right decision.
from imap-backup.
Related Issues (20)
- `uninitialized constant Imap::Backup::VERSION` with 13.3.0 release build HOT 3
- Provide short summary on "check" command HOT 1
- "From:" header is changed to "-From:" HOT 22
- Setup does not offer to save when only changing the list of folders to include/exclude HOT 1
- Upgrade from v8.0.1 to v14.3.0 seems to have breaking changes: `backup` detects no remote folder; `stats` stays empty HOT 4
- imap-backup-14.4.3 error HOT 1
- Migrate is failing HOT 9
- Docker DNS access HOT 3
- Clarification between migrate and mirror HOT 1
- Import support from a local storage format (mbox, maildir, Thunderbird .sbd, ...) HOT 6
- Support for setting account (backups) to "archived" or "offline" HOT 1
- Unexpected backup data loss on re-adding legacy backup folder/account HOT 4
- No emails download HOT 8
- "--mirror" ignored when using "single backup" HOT 5
- Backup for account failed with error closed stream HOT 6
- Restore does not accept a `--delimiter` parameter HOT 5
- How is the length/offset calculated? HOT 2
- Backup of a large folder does not work (sent mails, Office 365) HOT 5
- Miration failed with "Character not allowed in mailbox name" HOT 1
- imap-backup with email-oauth2-proxy support in a container HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imap-backup.