debian/0000755000000000000000000000000012230307064007163 5ustar debian/patches/0000755000000000000000000000000012227610305010613 5ustar debian/patches/fix-path-expansion.patch0000644000000000000000000000342312227562111015361 0ustar Description: Make source and destination path expansion behave more like users expect it Bug-Debian: http://bugs.debian.org/594049 Author: Axel Beckert Index: mb2md/mb2md-3.20.pl =================================================================== --- mb2md.orig/mb2md-3.20.pl 2013-10-16 14:41:39.000000000 +0200 +++ mb2md/mb2md-3.20.pl 2013-10-16 16:52:21.000000000 +0200 @@ -411,6 +411,7 @@ my $dest = undef; my $strip_ext = undef; my $use_cl = undef; # defines whether we use the Content-Length: header if present +my $pwd = `pwd`; chomp($pwd); # if option "-c" is given, we use the Content-Length: header if present # dangerous! may be unreliable, as the whole CL stuff is a bad idea @@ -443,7 +444,7 @@ # it is a subdir of the users $home # if it does start with a "/" then # let's take $mbroot as a absolut path - $opts{s} = "$homedir/$opts{s}" if ($opts{s} !~ /^\//); + $opts{s} = "$homedir/$opts{s}" if ($opts{s} !~ m(^[/.])); # check if the given source is a mbox file if (-f $opts{s}) @@ -493,13 +494,13 @@ # if the destination is relative to the home dir, # check that the home dir exists -die("Fatal: home dir $homedir doesn't exist.\n") if ($dest !~ /^\// && ! -e $homedir); +die("Fatal: home dir $homedir doesn't exist.\n") if ($dest !~ m(^[/.]) && ! -e $homedir); # # form the destination value # slap the home dir on the front of the dest if the dest does not begin # with a '/' -$dest = "$homedir/$dest" if ($dest !~ /^\//); +$dest = "$homedir/$dest" if ($dest !~ m(^[/.])); # get rid of trailing /'s $dest =~ s/\/$//; @@ -754,6 +755,7 @@ # Change to the target mailbox directory. chdir "$maildir" ; + $mbox = "$pwd/$mbox"; # Converts a Mbox to multiple files # in a Maildir. debian/patches/better-separator-line-detection.patch0000644000000000000000000000167212227604030020024 0ustar Description: Better, but still not too strict RFC4155 separator line detection Bug-Debian: http://bugs.debian.org/578084 Author: Pete Ashdown Author: Axel Beckert Index: mb2md/mb2md-3.20.pl =================================================================== --- mb2md.orig/mb2md-3.20.pl 2013-10-16 22:53:45.000000000 +0200 +++ mb2md/mb2md-3.20.pl 2013-10-16 23:10:04.000000000 +0200 @@ -601,7 +601,7 @@ return 1 if(-z $mbxfile); sysopen(MBXFILE, "$mbxfile", O_RDONLY) or die "Could not open $mbxfile ! \n"; while() { - if (/^From/) { + if (/^From +\S+ .*\d\d:\d\d/) { close(MBXFILE); return 1; } @@ -1005,7 +1005,7 @@ # exchange possible Windows EOL (CRLF) with Unix EOL (LF) $_ =~ s/\r\n$/\n/; - if ( /^From / + if ( /^From +\S+ .*\d\d:\d\d/ && $previous_line_was_empty && (!defined $contentlength) ) debian/patches/series0000644000000000000000000000012712227610272012033 0ustar fix-path-expansion.patch fix-dash-r-option.patch better-separator-line-detection.patch debian/patches/fix-dash-r-option.patch0000644000000000000000000000175012227561756015126 0ustar Description: Fixes non-functionality of the -r option Bug-Debian: http://bugs.debian.org/333499 Author: Bastien Mourgues Reviewd-By: Axel Beckert Index: mb2md/mb2md-3.20.pl =================================================================== --- mb2md.orig/mb2md-3.20.pl 2013-10-16 20:20:35.000000000 +0200 +++ mb2md/mb2md-3.20.pl 2013-10-16 20:21:13.000000000 +0200 @@ -643,6 +643,7 @@ # Appending $oldpath => path is only missing $dest $destinationdir = "$temppath.$destinationdir"; + defined($strip_ext) && ($destinationdir =~ s/\_$strip_ext$//); # Converting '/' to '.' in $destinationdir $destinationdir =~s/\/+/\./g; @@ -678,7 +679,7 @@ # # if $strip_extension is defined, # strip it off the $targetfile - defined($strip_ext) && ($destinationdir =~ s/\.$strip_ext$//); +# defined($strip_ext) && ($destinationdir =~ s/\_$strip_ext$//); &convert("$mbroot/$oldpath/$dir","$dest/$destinationdir"); $mailboxcount++; } debian/mb2md.sgml0000644000000000000000000002457612227555523011101 0ustar manpage.1'. You may view the manual page with: `docbook-to-man manpage.sgml | nroff -man | less'. A typical entry in a Makefile or Makefile.am is: manpage.1: manpage.sgml docbook-to-man $< > $@ The docbook-to-man binary is found in the docbook-to-man package. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include docbook-to-man in your Build-Depends control field. --> Noèl"> Köthe"> 2003-05-02"> 1"> noel@debian.org"> MB2MD"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; Converts Mbox mailboxes to Maildir format. &dhpackage; -h &dhpackage; -m &dhpackage; -s sourcefile &dhpackage; -s sourcedir DESCRIPTION &dhpackage; Converts Mbox mailboxes to Maildir format. OPTIONS Show summary of options. Use the Content-Length: headers (if present) to find the beginning of the next message. Use with caution! Results may be unreliable. I recommend to do a run without "-c" first and only use it if you are certain, that the mbox in question really needs the "-c" option. If this is used then the source will be the single mailbox at /var/spool/mail/blah for user blah and the destination mailbox will be the "destdir" mailbox itself. sourcedir Directory, relative to the user's home directory, which is where the the "somefolders" directories are located. Or if directory starts with a "/" or "." it is taken as a absolute path, e.g. /mnt/oldmail/user _OR_ A single mbox file which will be converted to the destdir. If defined, do not skip directories found in a mailbox directory, but runs recursively into each of them, creating all wanted folders in Maildir. Incompatible with '-f' somefolder Directories, relative to "sourcedir" where the Mbox files are. All mailboxes in the "sourcedir" directory will be converted and placed in the "destdir" directory. (Typically the Inbox directory which in this instance is also functioning as a folder for other mailboxes.) The "somefolder" directory name will be encoded into the new mailboxes' names. See the example in the USAGE file (see below). This does not save an UW IMAP dummy message file at the start of the Mbox file. Small changes in the code could adapt it for looking for other distinctive patterns of dummy messages too. Don't let the source directory you give as "somefolders" contain any "."s in its name, unless you want to create subfolders from the IMAP user's point of view. See the example in the USAGE file (see below). Incompatible with '-R' destdir Directory where the Maildir format directories will be created. If not given, then the destination will be ~/Maildir . Typically, this is what the IMAP server sees as the Inbox and the folder for all user mailboxes. If this begins with a '/' the path is considered to be absolute, otherwise it is relative to the users home directory. strip_extension If defined this extension will be stripped from the original mailbox file name before creating the corresponding maildir. The extension must be given without the leading dot ("."). See the example in the USAGE file (see below). WU-file File containing the list of subscribed folders. If migrating from WU-IMAP the list of subscribed folders will be found in the file called .mailboxlist in the users home directory. This will convert all subscribed folders for a single user: /bin/mb2md -s mail -l .mailboxlist -R -d Maildir and for all users in a directory as root you can do the following: for i in *; do echo $i;su - $i -c "/bin/mb2md -s mail -l .mailboxlist -R -d Maildir";done USAGE Please read the USAGE documentation (zless /usr/share/doc/mb2md/USAGE.gz). AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.
debian/clean0000644000000000000000000000001712227555523010201 0ustar debian/mb2md.1 debian/compat0000644000000000000000000000000212227555523010374 0ustar 9 debian/watch0000644000000000000000000000013312227555525010226 0ustar version=2 http://batleth.sapienti-sat.org/projects/mb2md/mb2md-(.*)\.pl\.gz debian uupdate debian/changelog0000644000000000000000000001034712230307010011031 0ustar mb2md (3.20-5) unstable; urgency=low * Friendly package take over (Noël granted me to do whatever I consider to be the right thing for the package. :-) + Move package to team maintenance under the Debian Perl Group. + Set Noël and me as Uploaders. + Use git for packaging, add acoording Vcs-* headers * Apply wrap-and-sort. * Update script name (well, version number) in debian/copyright * Change perl5 dependency to perl * Bump debhelper compatibility to 9 + Update versioned debhelper build-dependency accordingly * Switch to source format "3.0 (quilt)" + Move mb2md.1 and USAGE to the debian subdirectory and update paths in debian/rules and debian/docs accordingly. * Remove generated mb2md.1 from source and add it to debian/clean * Revamp debian/rules: + Fix lintian warning dh-clean-k-is-deprecated + Fix lintian warning debian-rules-missing-recommended-target + Fix lintian warning binary-arch-rules-but-pkg-is-arch-indep + Remove unused, commented code + Remove all code related to compiling C code + No more clean up stamp files manually (dh_clean does that now) + Use debian/manpages instead of dh_installman parameters + Use dh_install and debian/install (with dh-exec, build-dependency added) instead of calling cp manually. + Finally switch to a dh7 style debian/rules file. * Fix further lintian warnings: + description-possibly-contains-homepage and no-homepage-field + debhelper-but-no-misc-depends * Bump Standards-Version to 3.9.4 (no further changes) * Add patch to make source and destination path expansion behave more like most users expect it. (Closes: #594049) + Update man page and USAGE accordingly * Add patch by Bastien Mourgues to fix the -r option (Closes: #333499) * Add patch to more reliably detect separator lines (Closes: #578084) -- Axel Beckert Fri, 18 Oct 2013 21:17:46 +0200 mb2md (3.20-4) unstable; urgency=low * Update documentation (closes: #438891, #438893, #438896, #438898) (Patch from Thijs Kinkhorst Wed, 19 Mar 2008 14:02:36 +0100 mb2md (3.20-3) unstable; urgency=low * updated Standards-Version * corrected description (closes: Bug#421764) -- Noèl Köthe Mon, 18 Jun 2007 15:32:27 +0200 mb2md (3.20-2) unstable; urgency=low * fixed manpage typo (closes: Bug#280797) * updated Standards-Version * added watchfile -- Noèl Köthe Mon, 04 Jul 2005 22:38:35 +0200 mb2md (3.20-1) unstable; urgency=low * new upstream release 2004-03-28 * added support for \r\n mboxes (closes: Bug#231190) (closes: Bug#231188) * "follow the Maildir spec more closely" (closes: Bug#208240) -- Noèl Köthe Fri, 09 Apr 2004 14:29:28 +0200 mb2md (3.10-6) unstable; urgency=low * updated Standards-Version * control, copyright and changelog are now utf8 * correct mb2md-h in manpage (closes: Bug#207563) * added missing USAGE to package and a hint into the manpage (closes: Bug#207571) (closes: Bug#207566) -- Noèl Köthe Wed, 10 Sep 2003 21:40:00 +0200 mb2md (3.10-5) unstable; urgency=low * added missing build-dep docbook-to-man (closes: Bug#191726) -- Noel Koethe Mon, 5 May 2003 20:34:00 +0100 mb2md (3.10-4) unstable; urgency=low * command name is now "mb2md" without version and without .pl (closes: Bug#191614) * added manpage to the package (closes: Bug#189608) -- Noel Koethe Fri, 2 May 2003 11:58:00 +0100 mb2md (3.10-3) unstable; urgency=low * added patch from Glen Harris which added correct handling when $MAIL isn't set. (closes: Bug#187532) * fixed spelling error in description * updated Standards-Version to 3.5.9 -- Noel Koethe Sun, 6 Apr 2003 22:38:00 +0100 mb2md (3.10-2) unstable; urgency=low * corrected debian/rules for the missing Debian changelog -- Noel Koethe Sat, 8 Mar 2003 12:17:00 +0100 mb2md (3.10-1) unstable; urgency=low * Initial Release. (closes: Bug#183073) -- Noel Koethe Fri, 7 Mar 2003 22:03:12 +0100 debian/copyright0000644000000000000000000000050212227560015011116 0ustar This package was debianized by Noèl Köthe on Fri, 7 Mar 2003 22:03:12 +0100. It was downloaded from http://batleth.sapienti-sat.org/projects/mb2md/ Upstream Authors: Juri Haberland Copyright: # mb2md-3.20.pl Converts Mbox mailboxes to Maildir format. # # Public domain. debian/USAGE0000644000000000000000000002272412227555523007774 0ustar # USAGE # ===== # # Run this as the user of the mailboxes, not as root. # # # mb2md -h # mb2md [-c] -m [-d destdir] # mb2md [-c] -s sourcefile [-d destdir] # mb2md [-c] -s sourcedir [-l wu-mailboxlist] [-R|-f somefolder] [-d destdir] [-r strip_extension] # # -c use the Content-Length: headers (if present) to find the # beginning of the next message # Use with caution! Results may be unreliable. I recommend to do # a run without "-c" first and only use it if you are certain, # that the mbox in question really needs the "-c" option # # -m If this is used then the source will # be the single mailbox at /var/spool/mail/blah for # user blah and the destination mailbox will be the # "destdir" mailbox itself. # # # -s source Directory or file relative to the user's home directory, # which is where the the "somefolders" directories are located. # Or if starting with a "/" it is taken as a # absolute path, e.g. /mnt/oldmail/user, and if starting with # a "." it is taken as relative to the current directory, e.g. # ./tmp. # # or # # A single mbox file which will be converted to # the destdir. # # -R If defined, do not skip directories found in a mailbox # directory, but runs recursively into each of them, # creating all wanted folders in Maildir. # Incompatible with '-f' # # -f somefolder Directories, relative to "sourcedir" where the Mbox files # are. All mailboxes in the "sourcedir" # directory will be converted and placed in the # "destdir" directory. (Typically the Inbox directory # which in this instance is also functioning as a # folder for other mailboxes.) # # The "somefolder" directory # name will be encoded into the new mailboxes' names. # See the examples below. # # This does not save an UW IMAP dummy message file # at the start of the Mbox file. Small changes # in the code could adapt it for looking for # other distinctive patterns of dummy messages too. # # Don't let the source directory you give as "somefolders" # contain any "."s in its name, unless you want to # create subfolders from the IMAP user's point of # view. See the example below. # # Incompatible with '-R' # # # -d destdir Directory where the Maildir format directories will be created. # If not given, then the destination will be ~/Maildir . # Typically, this is what the IMAP server sees as the # Inbox and the folder for all user mailboxes. # If this begins with a '/' the path is considered to be # absolute, if it begins with '.', the path is considered # relative to the current directory, otherwise it is relative # to the users home directory. # # -r strip_ext If defined this extension will be stripped from # the original mailbox file name before creating # the corresponding maildir. The extension must be # given without the leading dot ("."). See the example below. # # -l WU-file File containing the list of subscribed folders. If # migrating from WU-IMAP the list of subscribed folders will # be found in the file called .mailboxlist in the users # home directory. This will convert all subscribed folders # for a single user: # /bin/mb2md -s mail -l .mailboxlist -R -d Maildir # and for all users in a directory as root you can do the # following: # for i in *; do echo $i;su - $i -c "/bin/mb2md -s mail -l .mailboxlist -R -d Maildir";done # # # Example # ======= # # We have a bunch of directories of Mbox mailboxes located at # /home/blah/oldmail/ # # /home/blah/oldmail/fffff # /home/blah/oldmail/ggggg # /home/blah/oldmail/xxx/aaaa # /home/blah/oldmail/xxx/bbbb # /home/blah/oldmail/xxx/cccc # /home/blah/oldmail/xxx/dddd # /home/blah/oldmail/yyyy/huey # /home/blah/oldmail/yyyy/duey # /home/blah/oldmail/yyyy/louie # # With the UW IMAP server, fffff and ggggg would have appeared in the root # of this mail server, along with the Inbox. aaaa, bbbb etc, would have # appeared in a folder called xxx from that root, and xxx was just a folder # not a mailbox for storing messages. # # We also have the mailspool Inbox at: # # /var/spool/mail/blah # # # To convert these, as user blah, we give the first command: # # mb2md -m # # The main Maildir directory will be created if it does not exist. # (This is true of any argument options, not just "-m".) # # /home/blah/Maildir/ # # It has the following subdirectories: # # /home/blah/Maildir/tmp/ # /home/blah/Maildir/new/ # /home/blah/Maildir/cur/ # # Then /var/spool/blah file is read, split into individual files and # written into /home/blah/Maildir/cur/ . # # Now we give the second command: # # mb2md -s oldmail -R # # This reads recursively all Mbox mailboxes and creates: # # /home/blah/Maildir/.fffff/ # /home/blah/Maildir/.ggggg/ # /home/blah/Maildir/.xxx/ # /home/blah/Maildir/.xxx.aaaa/ # /home/blah/Maildir/.xxx.bbbb/ # /home/blah/Maildir/.xxx.cccc/ # /home/blah/Maildir/.xxx.aaaa/ # /home/blah/Maildir/.yyyy/ # /home/blah/Maildir/.yyyy.huey/ # /home/blah/Maildir/.yyyy.duey/ # /home/blah/Maildir/.yyyy.louie/ # # The result, from the IMAP client's point of view is: # # Inbox ----------------- # | # | fffff ----------- # | ggggg ----------- # | # - xxx ------------- # | | aaaa -------- # | | bbbb -------- # | | cccc -------- # | | dddd -------- # | # - yyyy ------------ # | huey ------- # | duey ------- # | louie ------ # # Note that although ~/Maildir/.xxx/ and ~/Maildir/.yyyy may appear # as folders to the IMAP client the above commands to not generate # any Maildir folders of these names. These are simply elements # of the names of other Maildir directories. (if you used '-R', they # whill be able to act as normal folders, containing messages AND folders) # # With a separate run of this script, using just the "-s" option # without "-f" nor "-R", it would be possible to create mailboxes which # appear at the same location as far as the IMAP client is # concerned. By having Mbox mailboxes in some directory: # ~/oldmail/nnn/ of the form: # # /home/blah/oldmail/nn/xxxx # /home/blah/oldmail/nn/yyyyy # # then the command: # # mb2md -s oldmail/nn # # will create two new Maildirs: # # /home/blah/Maildir/.xxx/ # /home/blah/Maildir/.yyyy/ # # Then what used to be the xxx and yyyy folders now function as # mailboxes too. Netscape 4.77 needed to be put to sleep and given ECT # to recognise this - deleting the contents of (Win2k example): # # C:\Program Files\Netscape\Users\uu\ImapMail\aaa.bbb.ccc\ # # where "uu" is the user and "aaa.bbb.ccc" is the IMAP server # # I often find that deleting all this directory's contents, except # "rules.dat", forces Netscape back to reality after its IMAP innards # have become twisted. Then maybe use File > Subscribe - but this # seems incapable of subscribing to folders. # # For Outlook Express, select the mail server, then click the # "IMAP Folders" button and use "Reset list". In the "All" # window, select the mailboxes you want to see in normal # usage. # # # This script did not recurse subdirectories or delete old mailboxes, before addition of the '-R' parameter :) # # Be sure not to be accessing the Mbox mailboxes while running this # script. It does not attempt to lock them. Likewise, don't run two # copies of this script either. # # # Trickier usage . . . # ==================== # # If you have a bunch of mailboxes in a directory ~/oldmail/doors/ # and you want them to appear in folders such as: # # ~/Maildir/.music.bands.doors.Jim # ~/Maildir/.music.bands.doors.John # # etc. so they appear in an IMAP folder: # # Inbox ----------------- # | music # | bands # | doors # | Jim # | John # | Robbie # | Ray # # Then you could rename the source directory to: # # ~/oldmail/music.bands.doors/ # # then use: # # mb2md -s oldmail -f music.bands.doors # # # Or simply use '-R' switch with: # mb2md -s oldmail -R # # # Stripping mailbox extensions: # ============================= # # If you want to convert mailboxes that came for example from # a Windows box than you might want to strip the extension of # the mailbox name so that it won't create a subfolder in your # mail clients view. # # Example: # You have several mailboxes named Trash.mbx, Sent.mbx, Drafts.mbx # If you don't strip the extension "mbx" you will get the following # hierarchy: # # Inbox # | # - Trash # | | mbx # | # - Sent # | | mbx # | # - Drafts # | mbx # # This is more than ugly! # Just use: # mb2md -s oldmail -r mbx # # Note: don't specify the dot! It will be stripped off # automagically ;) # #------------------------------------------------------------------------------ debian/docs0000644000000000000000000000001512227555523010045 0ustar debian/USAGE debian/control0000644000000000000000000000344112230307064010570 0ustar Source: mb2md Section: net Priority: optional Maintainer: Debian Perl Group Uploaders: Axel Beckert , Noël Köthe Build-Depends: debhelper (>= 9~), dh-exec, docbook-to-man Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/mb2md.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/mb2md.git Homepage: http://batleth.sapienti-sat.org/projects/mb2md/ Package: mb2md Architecture: all Depends: libtimedate-perl, perl, ${misc:Depends} Description: Converting Mbox mailboxes to Maildir format A Perl script that takes one or more Mbox format mailbox files in a directory and convert them to Maildir format mailboxes. As the Mbox format has some drawbacks, D. J. Bernstein created the Maildir format when he wrote Qmail. With the Mbox format all mail of a specific folder is stored as one large text file. The Maildir format stores each mail as a separate file. It is a faster and more efficient way to store mail. It works particularly well over NFS, which has a long history of locking-related woes. The Mbox format is used by most of the POP3/IMAP servers, most mail servers (MTAs) and mail readers (MUAs). The Maildir format is used by Qmail, Courier-MTA and can be also used as a alternative mail storage format by Postfix and Exim. A good POP3/IMAP server for Maildirs is Courier IMAP. . Mb2md.pl does not only convert mailbox files into a Maildir but also the /var/spool/mail/$USER mailspool file. It is smart enough to not transfer a dummy message such as the UW IMAPD puts at the start of Mbox mailboxes - and you could add your own search terms into the script to make it ignore other forms of dummy first message. debian/dirs0000644000000000000000000000003412227555523010057 0ustar usr/bin usr/share/doc/mb2md debian/source/0000755000000000000000000000000012227555523010476 5ustar debian/source/format0000644000000000000000000000001412227555523011704 0ustar 3.0 (quilt) debian/manpages0000644000000000000000000000001712227555523010712 0ustar debian/mb2md.1 debian/install0000755000000000000000000000006212227555523010570 0ustar #!/usr/bin/dh-exec mb2md-3.20.pl => usr/bin/mb2md debian/rules0000755000000000000000000000026212227555523010256 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ override_dh_auto_build: /usr/bin/docbook-to-man debian/mb2md.sgml > debian/mb2md.1