1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-16 15:52:47 +01:00
This commit is contained in:
Nick Bebout 2011-03-12 02:45:04 +00:00
parent 3f8607bd96
commit d88bf4b46a
90 changed files with 13227 additions and 504 deletions

41
CREDITS
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: CREDITS,v 1.150 2010/10/24 23:54:09 gilles Exp gilles $
# $Id: CREDITS,v 1.154 2011/01/18 01:52:25 gilles Exp gilles $
If you want to make a donation to the author, Gilles LAMIRAL,
use any of the following ways:
@ -13,7 +13,7 @@ b) If you can read french, please use the following wishlist :
(books will be send with free postal cost)
c) its paypal account : gilles.lamiral@laposte.net
http://www.linux-france.org/prj/imapsync/paypal.html
http://www.linux-france.org/prj/imapsync/paypal.shtml
d) If you prefer making your donation with
cash or cheque then my postal address is:
@ -27,6 +27,33 @@ Here are the persons who helped me to develop and maintain imapsync.
Feel free to tell me if a name is missing or if you want to remove one.
I thank very much all of these people.
I thank also very much all people who bought imapsync from the homepage
but I don't cite them here.
Daniel Melnechuk
Contributed by giving the book
10.02 "The Design of Everyday Things"
Pratch Pakpinpetch
Contributed by giving the book
17.95 "Life and How to Survive It"
Edward Helvund
Contributed by giving the book
9.84 "Satan, Cantor and Infinity: Mind-Boggling Puzzles"
Andrea Provaglio
Contributed by giving the book
24.95 "Salsa, Further Adventures In Afro Cuban Music For Piano"
Eric Busalacchi
Contributed by giving money 84 USD
Jorge López Pérez
Gave patch proxyauth-v2_1.366.patch
Jeffrey Allison
Contributed by giving money 30 USD
Roger Schmid
Contributed by giving money 100 USD
@ -946,7 +973,13 @@ Eric Yung
Total amount of book prices :
c \
29.95
10.02+\
\
17.95+\
9.84+\
\
24.95+\
29.95+\
\
11.20+\
24.95+\
@ -1058,4 +1091,4 @@ c \
31.20+\
40.00
=
2618.10
2710.81

146
ChangeLog
View File

@ -1,17 +1,155 @@
RCS file: RCS/imapsync,v
Working file: imapsync
head: 1.366
head: 1.398
branch:
locks: strict
gilles: 1.366
gilles: 1.398
access list:
symbolic names:
keyword substitution: kv
total revisions: 366; selected revisions: 366
total revisions: 398; selected revisions: 398
description:
----------------------------
revision 1.366 locked by: gilles;
revision 1.398 locked by: gilles;
date: 2011/01/18 03:03:24; author: gilles; state: Exp; lines: +7 -6
Fix. Removed too much about buffersize.
----------------------------
revision 1.397
date: 2011/01/18 02:39:12; author: gilles; state: Exp; lines: +25 -19
Changed --delete2foldersnot option name to --delete2foldersbutnot
----------------------------
revision 1.396
date: 2011/01/18 02:03:49; author: gilles; state: Exp; lines: +23 -11
Added --authmd51 and --authmd52 options to allow CRAM-MD5 authentication per host.
----------------------------
revision 1.395
date: 2011/01/15 04:57:28; author: gilles; state: Exp; lines: +8 -8
--debugimap* implies --debug now.
----------------------------
revision 1.394
date: 2011/01/15 04:46:16; author: gilles; state: Exp; lines: +21 -11
Added info about biggest messages.
----------------------------
revision 1.393
date: 2011/01/15 03:40:43; author: gilles; state: Exp; lines: +7 -7
*** empty log message ***
----------------------------
revision 1.392
date: 2011/01/15 03:29:37; author: gilles; state: Exp; lines: +17 -8
Added --delete2foldersnot option: do not delete folders matching regex.
----------------------------
revision 1.391
date: 2011/01/10 23:11:49; author: gilles; state: Exp; lines: +7 -7
*** empty log message ***
----------------------------
revision 1.390
date: 2011/01/10 05:47:43; author: gilles; state: Exp; lines: +403 -94
Added --usecache option. Goal: speed up the synchronisation.
----------------------------
revision 1.389
date: 2011/01/06 04:28:58; author: gilles; state: Exp; lines: +7 -6
Mirapoint host1 success
----------------------------
revision 1.388
date: 2010/12/29 22:46:08; author: gilles; state: Exp; lines: +44 -10
Added help to guess separator and prefix when NAMESPACE is not available.
----------------------------
revision 1.387
date: 2010/12/22 02:27:39; author: gilles; state: Exp; lines: +13 -8
Added option --delete2foldersonly <regex>: delete only folders matching regex.
----------------------------
revision 1.386
date: 2010/12/09 22:34:25; author: gilles; state: Exp; lines: +7 -7
hMailServer 4.4.1
----------------------------
revision 1.385
date: 2010/12/03 23:40:12; author: gilles; state: Exp; lines: +34 -25
Changed default behaviour: now --delete implies --expunge
It is safer with multiples runs.
----------------------------
revision 1.384
date: 2010/12/02 01:07:48; author: gilles; state: Exp; lines: +48 -34
Code cleanup.
Wrote create_folder()
Wrote select_folder()
Simplified folder loop (a beginning)
----------------------------
revision 1.383
date: 2010/11/28 04:28:52; author: gilles; state: Exp; lines: +14 -12
Allow size mismatch by default.
Use --useheader 'Message-Id' by default.
Use --noauthmd5 by default.
Why? Because users don't have to spend time or mine reading or not
reading the documentation, spend time turning on options to success.
or speed.
----------------------------
revision 1.382
date: 2010/11/19 21:31:35; author: gilles; state: Exp; lines: +23 -12
Added a way to handle no headers in messages: take first 2Ko body.
----------------------------
revision 1.381
date: 2010/11/19 20:48:27; author: gilles; state: Exp; lines: +7 -7
Fixed 'ps' call for Solaris.
----------------------------
revision 1.380
date: 2010/11/19 20:44:25; author: gilles; state: Exp; lines: +12 -11
updated success list.
----------------------------
revision 1.379
date: 2010/11/12 00:44:02; author: gilles; state: Exp; lines: +7 -7
dkimap is now a success story!
----------------------------
revision 1.378
date: 2010/11/12 00:22:59; author: gilles; state: Exp; lines: +19 -11
Added --nouid1 --nouid2 options to support dkimap and other imap server without uid capability.
----------------------------
revision 1.377
date: 2010/11/09 02:12:40; author: gilles; state: Exp; lines: +8 -7
Added Authen::NTLM in modules_VERSION()
----------------------------
revision 1.376
date: 2010/11/09 01:14:33; author: gilles; state: Exp; lines: +17 -10
Added --domain1 --domain2 options for NTLM authentication.
----------------------------
revision 1.375
date: 2010/11/07 23:26:01; author: gilles; state: Exp; lines: +12 -15
Adapted documentation to new distribution rule.
----------------------------
revision 1.374
date: 2010/11/07 18:31:06; author: gilles; state: Exp; lines: +10 -7
imapsync is no longer gratis on the homepage.
----------------------------
revision 1.373
date: 2010/11/07 18:23:13; author: gilles; state: Exp; lines: +7 -7
Smarter Mail 5.5
----------------------------
revision 1.372
date: 2010/11/03 00:10:29; author: gilles; state: Exp; lines: +9 -8
No thanks for *.bin and *.exe
----------------------------
revision 1.371
date: 2010/11/02 07:37:35; author: gilles; state: Exp; lines: +9 -7
hMailServer 5.3.3 [host2] success
Oracle Beehive [host1] success
----------------------------
revision 1.370
date: 2010/10/31 23:07:12; author: gilles; state: Exp; lines: +7 -7
Prepare to move from linux-france.org with independant name.
----------------------------
revision 1.369
date: 2010/10/31 23:03:22; author: gilles; state: Exp; lines: +9 -6
No thanks with imapsync.exe just homepage link.
----------------------------
revision 1.368
date: 2010/10/31 22:17:52; author: gilles; state: Exp; lines: +9 -3
Applied proxyauth-v2_1.366.patch on 1.366
----------------------------
revision 1.367
date: 2010/10/31 00:01:44; author: gilles; state: Exp; lines: +44 -13
Applied patch patches/proxyauth_1.366.patch from Jorge López Pérez.
----------------------------
revision 1.366
date: 2010/10/25 17:15:52; author: gilles; state: Exp; lines: +11 -12
Permit host* to have change the case of headers.
----------------------------

119
FAQ
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: FAQ,v 1.75 2010/10/19 23:31:10 gilles Exp gilles $
# $Id: FAQ,v 1.82 2011/01/15 06:32:12 gilles Exp gilles $
+------------------+
| FAQ for imapsync |
@ -450,7 +450,7 @@ R. try to transfer the mails without SSL connection. SSL code outside
======================================================================
Q. I want to exclude a folder hierarchy like "public"
R. Use
R. Use:
--exclude '^public\.'
or maybe
@ -462,6 +462,18 @@ output line :
From folders list : [INBOX] [public.dreams] [etc.]
======================================================================
Q. I want to exclude only INBOX
R. Use:
imapsync ... --exclude '^INBOX$'
A good way to see what will be done is to first use:
imapsync ... --exclude '^INBOX$' --justfolders --nofoldersizes --dry
======================================================================
Q. I want the --folder 'MyFolder' option be recursive.
@ -477,6 +489,19 @@ R. Do not use the --folder option.
and only them.
======================================================================
Q. How to migrate from or to Exchange 2007/2010 with an
admin/authuser account?
R. The trick comes from Michele Marcionelli:
This doesn't work:
imapsync ... --user2 user2 --authuser2 admin2 --password2 adminpassword2 ...
This works:
imapsync ... --user2 'domain\admin2\user2' --password2 adminpassword2 ...
======================================================================
Q. How to migrate from uw-imap with an admin/authuser account?
@ -513,6 +538,34 @@ Here is an example:
--password2 joespassonserver2 \
--exclude '^user\.'
======================================================================
Q: How to migrate from Sun Java Enterprise System / Sun One / iPlanet /
Netscape servers with an admin account?
R: Those imap servers don't allow the typical use of --authuser1 to use an
administrative account. They expect the use of an IMAP command called
proxyauth that is issued after login in as an administrative account.
For example, consider the administrative account 'administrator' and your
real user 'real_user'. The IMAP sequence would be:
OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS
CHILDREN BINARY UNSELECT LANGUAGE STARTTLS XSENDER X-NETSCAPE XSERVERINFO
AUTH=PLAIN] imap.server IMAP4 service (Sun Java(tm) System Messaging
Server ...))
1 LOGIN administrator password
1 OK User logged in
2 PROXYAUTH real_user
2 OK Completed
In imapsync, you can achieve this by using the following options:
--host1 source.imap.server \
--user1 real_user \
--authuser1 administrator \
--proxyauth1 \
--passfile admin.txt
======================================================================
Q. Is there anyway of making imapsync purge the destination folder
when the source folder is deleted?
@ -550,8 +603,8 @@ imapsync \
======================================================================
Q. I have moved from Braunschweig to Graz, so I would like to have my
whole Braunschweig mail sorted into a folder INBOX.Braunschweig of my
new mail account.
whole Braunschweig mail sorted into a subfolder INBOX.Braunschweig
of my new mail account.
R.
1) First try (safe mode):
@ -581,16 +634,32 @@ Examples:
happy with the output remove the --dry --justfolders options.
1) To remove INBOX. in the name of destination folders:
--regextrans2 's/^INBOX\.(.+)/$1/'
2) To sync a complete account in a subfolder called FOO:
a) Seperator is dot character "." and "INBOX" prefixes every folder
--regextrans2 's/^INBOX(.*)/INBOX.FOO$1/'
Or
b) Seperator is slash character "/"
or:
b) Seperator is slash character "/" and there is no prefix
--regextrans2 's#(.*)#FOO/$1#'
or:
c) Any separator, any prefix solution, FOO is the subfolder:
It is a complicated line because every case is taken into account.
Type it in one line (or with the \ at the end of first line on Unix shells.
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}NEW${h2_sep}INBOX,'
3) to substitute all characters dot "." by underscores "_"
--regextrans2 's/\./_/g'
@ -736,6 +805,34 @@ format issues. And now it works fine. (Thanks to Hansjoerg.Maurer)
Server specific issues and solutions
=======================================================================
Q. From or to HMailServer version 4.4.1.
R. You have to add prefix and separator manually because 4.4.1 doesn't
honor the NAMESPACE imap command.
Example for host1:
imapsync ... \
--prefix1 "" --sep1 .
No specific option for HMailServer 5.3.3 since NAMESPACE is supported.
Maybe --subscribe_all will help you to see all migrated folders.
=======================================================================
Q. Synchronising from SmarterMail to XXX
imapsync --host1 imap.d1.org --user1 joe --password1 secret1 --sep1 "/" \
--host2 imap.d2.org --user2 joe --password2 secret2 \
--noauthmd5 \
--prefix1 "Inbox/" \
--regextrans2 's#^Inbox$#INBOX#' \
--regextrans2 's#Sent Items$#Sent#' \
--dry --justfolders
Maybe add other --regextrans2 to change folder names and see the result.
When satisfied, run without --dry --justfolders
=======================================================================
Q. Synchronising from XXX to Gmail
@ -747,15 +844,15 @@ R. There are some details to get the special [Gmail] sub-folders
imapsync --host1 mail.oldhost.com \
--user1 my_email@oldhost.com \
--password1 password \
--host2 imap.gmail.com --port2 993 --ssl2 \
--host2 imap.gmail.com --ssl2 \
--user2 my_email@gmail.com \
--password2 password \
--useheader 'Message-Id' --skipsize \
--useheader 'Message-Id' \
--prefix2 '[Gmail]/' \
--folder 'INBOX.Sent' \
--regextrans2 's/Sent/Sent Mail/'
The same goes for the "All Mail" archive psuedo-folder.
The same goes for the "All Mail" archive pseudo-folder.
=======================================================================
Q. Synchronising from Gmail to XXX
@ -783,7 +880,9 @@ option:
Q. migrate email from gmail to google apps
R. Take a look at:
http://biasecurities.com/2009/migrate-email-from-gmail-to-google-apps/
http://www.linux-france.org/prj/imapsync_list/msg00639.html
http://biasecurities.com/blog/2009/migrate-email-from-gmail-to-google-apps/
http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration/
=======================================================================

View File

@ -1,4 +1,4 @@
# $Id: INSTALL,v 1.18 2010/10/25 09:32:49 gilles Exp gilles $
# $Id: INSTALL,v 1.19 2010/11/09 02:52:18 gilles Exp gilles $
#
# INSTALL file for imapsync
# imapsync : IMAP sync or copy tool.
@ -93,9 +93,13 @@ Here is some individual module help:
- Perl Digest::HMAC_MD5 module
Good for non plain text password over network.
- Perl Authen::NTLM
perl -mAuthen::NTLM -e ''
Everything in one command:
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mFile::Spec -mDigest::HMAC_MD5 -e ''
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL \
-mFile::Spec -mDigest::HMAC_MD5 -mAuthen::NTLM -e ''
INSTALLING
----------

194
Makefile
View File

@ -1,5 +1,5 @@
# $Id: Makefile,v 1.42 2010/10/24 23:52:31 gilles Exp gilles $
# $Id: Makefile,v 1.57 2011/01/12 00:59:12 gilles Exp gilles $
.PHONY: help usage all
@ -12,10 +12,11 @@ usage:
@echo "make testv # run tests verbosely"
@echo "make test3xx # run tests with (last) Mail-IMAPClient-3.xy"
@echo "make test229 # run tests with Mail-IMAPClient-2.2.9"
@echo "make tests_win32 # run tests on win32"
@echo "make all "
@echo "make upload_index"
@echo "make imapsync.exe"
@echo "make upload_imapsync_exe"
@echo "make imapsync_elf_x86.bin"
DIST_NAME=imapsync-$(VERSION)
@ -24,42 +25,8 @@ DEB_FILE=$(DIST_NAME).deb
VERSION=$(shell perl -I./Mail-IMAPClient-2.2.9 ./imapsync --version)
all: ChangeLog README VERSION VERSION_EXE
all: ChangeLog README VERSION
.PHONY: test tests testp testf test3xx
.test: imapsync tests.sh
/usr/bin/time sh tests.sh 1>/dev/null
touch .test
test_quick : test_quick_229 test_quick_3xx
test_quick_229: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' /usr/bin/time sh tests.sh locallocal 1>/dev/null
test_quick_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
testv:
nice -40 sh -x tests.sh
test: .test_229 .test_3xx
tests: test
test3xx: .test_3xx
test229: .test_229
.test_229: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_229
.test_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_3xx
testf: clean_test test
testp :
perl -c imapsync
@ -95,42 +62,59 @@ imapsync.1: imapsync
pod2man imapsync > imapsync.1
install: testp imapsync.1
install -D imapsync $(DESTDIR)/usr/bin/imapsync
install -D imapsync.1 $(DESTDIR)/usr/share/man/man1/imapsync.1
install imapsync $(DESTDIR)/usr/bin/imapsync
install imapsync.1 $(DESTDIR)/usr/share/man/man1/imapsync.1
chmod 755 $(DESTDIR)/usr/bin/imapsync
dist: cidone test clean clean_dist all INSTALL tarball
tarball:
echo making tarball $(DIST_FILE)
mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME)
rsync -aCv --delete --omit-dir-times --exclude dist/ ./ ../prepa_dist/$(DIST_NAME)
cd ../prepa_dist && (tar czfv $(DIST_FILE) $(DIST_NAME) || tar czfv $(DIST_FILE) $(DIST_NAME))
ln -f ../prepa_dist/$(DIST_FILE) dist/
cd dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt
cd dist && md5sum -c $(DIST_FILE).md5.txt
deb:
echo making debball $(DEB_FILE)
mkdir -p ../prepa_deb
cd ../prepa_deb && tar xzvf ../prepa_dist/$(DIST_FILE) &&\
cd ../prepa_dist/$(DIST_NAME)
.PHONY: cidone clean_dist
.PHONY: cidone
cidone:
rcsdiff RCS/*
clean_dist:
echo Used to be 'rm -f dist/*'
###############
# Local goals
###############
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public dosify_bat imapsync_cidone
.PHONY: test tests testp testf test3xx
test_quick : test_quick_229 test_quick_3xx
test_quick_229: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' /usr/bin/time sh tests.sh locallocal 1>/dev/null
test_quick_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' /usr/bin/time sh tests.sh locallocal 1>/dev/null
testv:
nice -40 sh -x tests.sh
test: .test_229 .test_3xx
tests: test
test3xx: .test_3xx
test229: .test_229
.test_229: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_229
.test_3xx: imapsync tests.sh
CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' /usr/bin/time sh tests.sh 1>/dev/null
touch .test_3xx
testf: clean_test test
.PHONY: lfo upload_lfo niouze_lfo niouze_fm public imapsync_cidone
upload_index: index.shtml
rcsdiff index.shtml
@ -138,67 +122,103 @@ upload_index: index.shtml
../../public_html/www.linux-france.org/html/prj/imapsync/
sh $(HOME)/memo/lfo-rsync
.dosify_bat: build_exe.bat test_exe.bat test.bat
unix2dos build_exe.bat test.bat test_exe.bat
touch .dosify_bat
dosify_bat: .dosify_bat
.imapsync_cidone: dosify_bat
rcsdiff imapsync
touch .imapsync_cidone
imapsync_cidone: .imapsync_cidone
copy_win32:
scp imapsync Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
tests_win32: dosify_bat
scp imapsync test.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests_debug'
# ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync'
# ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
# ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests_debug'
ssh Admin@c 'perl C:/msys/1.0/home/Admin/imapsync/imapsync --tests'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
# ssh Admin@c 'tasklist /FI "PID eq 0"'
# ssh Admin@c 'tasklist /NH /FO CSV'
upload_imapsync_exe:
rsync -avH imapsync.exe \
../../public_html/www.linux-france.org/html/prj/imapsync/
#sh $(HOME)/memo/lfo-rsync
test_imapsync_exe: dosify_bat
scp test_exe.bat Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
imapsync.exe: imapsync imapsync_cidone dosify_bat
imapsync.exe: imapsync build_exe.bat test_exe.bat .dosify_bat
rcsdiff imapsync
ssh Admin@c 'perl -V'
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
scp imapsync build_exe.bat test_exe.bat \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat'
time ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/build_exe.bat'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/imapsync.exe --version' > VERSION_EXE
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
zzz:
(date "+%s"| tr "\n" " "; echo -n "BEGIN " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
(date "+%s"| tr "\n" " "; echo -n "END " $(VERSION) ": "; date) >> .BUILD_EXE_TIME
# vadrouille or petite
imapsync_elf_x86.bin: imapsync
rcsdiff imapsync
{ test 'vadrouille' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.25/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
imapsync ; \
} || :
{ test 'petite' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.25/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
-M Tie::Hash::NamedCapture \
-a '/usr/lib/perl/5.10.0/auto/POSIX/SigAction;auto/POSIX/SigAction' \
imapsync ; \
} || :
{ test 'ks200821.kimsufi.com' = "`hostname`" && \
pp -o imapsync_elf_x86.bin -I Mail-IMAPClient-3.25/lib \
-M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL \
-M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey \
-M Authen::NTLM \
-M Tie::Hash::NamedCapture \
-a '/usr/lib/perl/5.10.1/auto/POSIX/SigAction;auto/POSIX/SigAction' \
imapsync ; \
} || :
./imapsync_elf_x86.bin
lfo: dist niouze_lfo upload_lfo
lfo: cidone niouze_lfo upload_lfo
upload_lfo:
rsync -avH --delete . \
dist: cidone test clean all INSTALL tarball
tarball: cidone all imapsync_elf_x86.bin imapsync.exe
echo making tarball $(DIST_FILE)
mkdir -p dist
mkdir -p ../prepa_dist/$(DIST_NAME)
rsync -aCv --delete --omit-dir-times --exclude dist/ ./ ../prepa_dist/$(DIST_NAME)/
rsync -av ./imapsync.exe ../prepa_dist/$(DIST_NAME)/
cd ../prepa_dist && (tar czfv $(DIST_FILE) $(DIST_NAME) || tar czfv $(DIST_FILE) $(DIST_NAME))
#ln -f ../prepa_dist/$(DIST_FILE) dist/
cd ../prepa_dist && md5sum $(DIST_FILE) > $(DIST_FILE).md5.txt
cd ../prepa_dist && md5sum -c $(DIST_FILE).md5.txt
ls -l ../prepa_dist/$(DIST_FILE)
upload_lfo:
#rm -rf /home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
#rm -rf /home/gilles/public_html/www.linux-france.org/ftp/prj/imapsync/
rsync -avH ./ChangeLog ./COPYING ./CREDITS ./FAQ \
./index.shtml ./INSTALL \
./logo_imapsync.png ./logo_imapsync_s.png \
./paypal.shtml ./README ./style.css ./TODO ./VERSION ./VERSION_EXE \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/
rsync -avH --delete ../prepa_dist/imapsync-*tgz \
/home/gilles/public_html/www.linux-france.org/ftp/prj/imapsync/
rsync -avH ./dist/index.shtml \
/home/gilles/public_html/www.linux-france.org/html/prj/imapsync/dist/
sh ~/memo/lfo-rsync
niouze_lfo : VERSION
. ./memo && lfo_announce
echo "CORRECT ME: . ./memo && lfo_announce"
niouze_fm: VERSION
. ./memo && fm_announce

24
NTLM-1.05/Changes Normal file
View File

@ -0,0 +1,24 @@
Revision history for Perl NTLM authentication suite
1.05 19 Jun 2008
- implement OO interface - thanks to Dmitry Karasik <dmitry@karasik.eu.org>
- fix minor bug in last release - thanks to Dmitry Karasik <dmitry@karasik.eu.org>
1.04 29 May 2008
- implement NTLMv2 - thanks to Andrew Hobson <ahobson@infloop.com>
1.03 Thur Aug 09 09:13:00 2007
- fixes bug from 2001 - http://rt.cpan.org/Public/Bug/Display.html?id=9521
- fixes minor doco bug also reported in same place.
1.02 Mon Oct 29 19:01:00 2001
- fixed package names due to a source code mixup!
- added a test suite
1.01 Sun Oct 28 11:01:00 2001
- added ntlm_domain() to set initial domain
- added ntlm_reset() to reset state machine for multiple use
- added fuller documentation
1.00 Sat Oct 27 13:31:53 2001
- original version;

294
NTLM-1.05/DES/DES.pm Normal file
View File

@ -0,0 +1,294 @@
#!/usr/local/bin/perl
#
# This is an implementation of part of the DES specification. According
# to the code this is ported from, this code does NOT enable 2-way
# encryption and is, hence, not a cypher and does not appear to come
# under any export restrictions on such.
#
package Authen::NTLM::DES;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
$VERSION = "1.02";
@ISA = qw(Exporter);
@EXPORT = qw(E_P16 E_P24);
my ($loop, $loop2);
$loop = 0;
$loop2 = 0;
my $perm1 = [57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15,
7, 62, 54, 46, 38, 30, 22,
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4];
my $perm2 = [14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55,
30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53,
46, 42, 50, 36, 29, 32];
my $perm3 = [58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
64, 56, 48, 40, 32, 24, 16, 8,
57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7];
my $perm4 = [32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1];
my $perm5 = [16, 7, 20, 21, 29, 12, 28, 17,
1, 15, 23, 26, 5, 18, 31, 10,
2, 8, 24, 14, 32, 27, 3, 9,
19, 13, 30, 6, 22, 11, 4, 25];
my $perm6 = [40, 8, 48, 16, 56, 24, 64, 32,
39, 7, 47, 15, 55, 23, 63, 31,
38, 6, 46, 14, 54, 22, 62, 30,
37, 5, 45, 13, 53, 21, 61, 29,
36, 4, 44, 12, 52, 20, 60, 28,
35, 3, 43, 11, 51, 19, 59, 27,
34, 2, 42, 10, 50, 18, 58, 26,
33, 1, 41, 9, 49, 17, 57, 25];
my $sc = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];
my $sbox = [
[
[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7],
[0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8],
[4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0],
[15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13]
],
[
[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10],
[3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5],
[0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15],
[13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9]
],
[
[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8],
[13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1],
[13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7],
[1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12]
],
[
[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15],
[13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9],
[10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4],
[3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14]
],
[
[2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9],
[14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6],
[4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14],
[11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3]
],
[
[12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11],
[10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8],
[9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6],
[4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13]
],
[
[4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1],
[13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6],
[1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2],
[6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12]
],
[
[13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7],
[1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2],
[7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8],
[2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11]
]
];
sub E_P16
{
my ($p14) = @_;
my $sp8 = [0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25];
my $p7 = substr($p14, 0, 7);
my $p16 = smbhash($sp8, $p7);
$p7 = substr($p14, 7, 7);
$p16 .= smbhash($sp8, $p7);
return $p16;
}
sub E_P24
{
my ($p21, $c8_str) = @_;
my @c8 = map {ord($_)} split(//, $c8_str);
my $p24 = smbhash(\@c8, substr($p21, 0, 7));
$p24 .= smbhash(\@c8, substr($p21, 7, 7));
$p24 .= smbhash(\@c8, substr($p21, 14, 7));
}
sub permute
{
my ($out, $in, $p, $n) = @_;
my $i;
foreach $i (0..($n-1))
{
$out->[$i] = $in->[$p->[$i]-1];
}
}
sub lshift
{
my ($d, $count, $n) = @_;
my (@out, $i);
foreach $i (0..($n-1))
{
$out[$i] = $d->[($i+$count)%$n];
}
foreach $i (0..($n-1))
{
$d->[$i] = $out[$i];
}
}
sub xor
{
my ($out, $in1, $in2, $n) = @_;
my $i;
foreach $i (0..($n-1))
{
$out->[$i] = $in1->[$i]^$in2->[$i];
}
}
sub dohash
{
my ($out, $in, $key) = @_;
my ($i, $j, $k, @pk1, @c, @d, @cd,
@ki, @pd1, @l, @r, @rl);
&permute(\@pk1, $key, $perm1, 56);
foreach $i (0..27)
{
$c[$i] = $pk1[$i];
$d[$i] = $pk1[$i+28];
}
foreach $i (0..15)
{
my @array;
&lshift(\@c, $sc->[$i], 28);
&lshift(\@d, $sc->[$i], 28);
@cd = (@c, @d);
&permute(\@array, \@cd, $perm2, 48);
$ki[$i] = \@array;
}
&permute(\@pd1, $in, $perm3, 64);
foreach $j (0..31)
{
$l[$j] = $pd1[$j];
$r[$j] = $pd1[$j+32];
}
foreach $i (0..15)
{
local (@er, @erk, @b, @cb, @pcb, @r2);
permute(\@er, \@r, $perm4, 48);
&xor(\@erk, \@er, $ki[$i], 48);
foreach $j (0..7)
{
foreach $k (0..5)
{
$b[$j][$k] = $erk[$j*6+$k];
}
}
foreach $j (0..7)
{
local ($m, $n);
$m = ($b[$j][0]<<1) | $b[$j][5];
$n = ($b[$j][1]<<3) | ($b[$j][2]<<2) | ($b[$j][3]<<1) | $b[$j][4];
foreach $k (0..3)
{
$b[$j][$k] = ($sbox->[$j][$m][$n] & (1<<(3-$k)))? 1: 0;
}
}
foreach $j (0..7)
{
foreach $k (0..3)
{
$cb[$j*4+$k] = $b[$j][$k];
}
}
&permute(\@pcb, \@cb, $perm5, 32);
&xor(\@r2, \@l, \@pcb, 32);
foreach $j (0..31)
{
$l[$j] = $r[$j];
$r[$j] = $r2[$j];
}
}
@rl = (@r, @l);
&permute($out, \@rl, $perm6, 64);
}
sub str_to_key
{
my ($str) = @_;
my $i;
my @key;
my $out;
my @str = map {ord($_)} split(//, $str);
$key[0] = $str[0]>>1;
$key[1] = (($str[0]&0x01)<<6) | ($str[1]>>2);
$key[2] = (($str[1]&0x03)<<5) | ($str[2]>>3);
$key[3] = (($str[2]&0x07)<<4) | ($str[3]>>4);
$key[4] = (($str[3]&0x0f)<<3) | ($str[4]>>5);
$key[5] = (($str[4]&0x1f)<<2) | ($str[5]>>6);
$key[6] = (($str[5]&0x3f)<<1) | ($str[6]>>7);
$key[7] = $str[6]&0x7f;
foreach $i (0..7)
{
$key[$i] = 0xff&($key[$i]<<1);
}
return \@key;
}
sub smbhash
{
my ($in, $key) = @_;
my $key2 = &str_to_key($key);
my ($i, $div, $mod, @in, @outb, @inb, @keyb, @out);
foreach $i (0..63)
{
$div = int($i/8); $mod = $i%8;
$inb[$i] = ($in->[$div] & (1<<(7-($mod))))? 1: 0;
$keyb[$i] = ($key2->[$div] & (1<<(7-($mod))))? 1: 0;
$outb[$i] = 0;
}
&dohash(\@outb, \@inb, \@keyb);
foreach $i (0..7)
{
$out[$i] = 0;
}
foreach $i (0..63)
{
$out[int($i/8)] |= (1<<(7-($i%8))) if ($outb[$i]);
}
my $out = pack("C8", @out);
return $out;
}
1;

580
NTLM-1.05/DES/Makefile Normal file
View File

@ -0,0 +1,580 @@
# This Makefile is for the Authen::NTLM::DES extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.30_01 (Revision: Revision: 4535 ) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# AUTHOR => q[David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>]
# NAME => q[Authen::NTLM::DES]
# VERSION_FROM => q[DES.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl/5.8/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
LD = cc
LDDLFLAGS = -shared -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc-2.7.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.6.24-19-server
RANLIB = :
SITELIBEXP = /usr/local/share/perl/5.8.8
SITEARCHEXP = /usr/local/lib/perl/5.8.8
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
VENDORARCHEXP = /usr/lib/perl5
VENDORLIBEXP = /usr/share/perl5
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
DIRFILESEP = /
DFSEP = $(DIRFILESEP)
NAME = Authen::NTLM::DES
NAME_SYM = Authen_NTLM_DES
VERSION = 1.02
VERSION_MACRO = VERSION
VERSION_SYM = 1_02
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION = 1.02
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = ../blib/arch
INST_SCRIPT = ../blib/script
INST_BIN = ../blib/bin
INST_LIB = ../blib/lib
INST_MAN1DIR = ../blib/man1
INST_MAN3DIR = ../blib/man3
MAN1EXT = 1p
MAN3EXT = 3pm
INSTALLDIRS = site
DESTDIR =
PREFIX = /usr
PERLPREFIX = $(PREFIX)
SITEPREFIX = $(PREFIX)/local
VENDORPREFIX = $(PREFIX)
INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.8
DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.8.8
DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5
DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.8
DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.8.8
DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5
DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
INSTALLBIN = $(PERLPREFIX)/bin
DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
INSTALLSITEBIN = $(SITEPREFIX)/bin
DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
INSTALLVENDORBIN = $(VENDORPREFIX)/bin
DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
INSTALLSCRIPT = $(PERLPREFIX)/bin
DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
INSTALLSITESCRIPT = $(SITEPREFIX)/bin
DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT)
INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin
DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT)
INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1
DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1
DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1
DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3
DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3
DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3
DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
PERL_LIB = /usr/share/perl/5.8
PERL_ARCHLIB = /usr/lib/perl/5.8
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKEFILE_OLD = Makefile.old
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl/5.8/CORE
PERL = /usr/bin/perl
FULLPERL = /usr/bin/perl
ABSPERL = $(PERL)
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
ABSPERLRUN = $(ABSPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
PERL_CORE = 0
PERM_RW = 644
PERM_RWX = 755
MAKEMAKER = /usr/share/perl/5.8/ExtUtils/MakeMaker.pm
MM_VERSION = 6.30_01
MM_REVISION = Revision: 4535
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Authen/NTLM/DES
BASEEXT = DES
PARENT_NAME = Authen::NTLM
DLBASE = $(BASEEXT)
VERSION_FROM = DES.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
BOOTDEP =
# Handy lists of source code files:
XS_FILES =
C_FILES =
O_FILES =
H_FILES =
MAN1PODS =
MAN3PODS =
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
# Where to build things
INST_LIBDIR = $(INST_LIB)/Authen/NTLM
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Authen/NTLM
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC =
INST_DYNAMIC =
INST_BOOT =
# Extra linker info
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = DES.pm
PM_TO_BLIB = DES.pm \
$(INST_LIB)/Authen/NTLM/DES.pm
# --- MakeMaker platform_constants section:
MM_Unix_VERSION = 1.50_01
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)'
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
NOECHO = @
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath
EQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime
ECHO = echo
ECHO_N = echo -n
UNINST = 0
VERBINST = 0
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
DOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
UNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall
WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist
MACROSTART =
MACROEND =
USEMAKEFILE = -f
FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"
# --- MakeMaker makemakerdflt section:
makemakerdflt: all
$(NOECHO) $(NOOP)
# --- MakeMaker dist section skipped.
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
# --- MakeMaker const_loadlibs section:
# --- MakeMaker const_cccmd section:
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"
# --- MakeMaker special_targets section:
.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir
# --- MakeMaker c_o section:
# --- MakeMaker xs_c section:
# --- MakeMaker xs_o section:
# --- MakeMaker top_targets section:
all :: pure_all manifypods
$(NOECHO) $(NOOP)
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) blibdirs
$(NOECHO) $(NOOP)
help :
perldoc ExtUtils::MakeMaker
# --- MakeMaker blibdirs section:
blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
$(NOECHO) $(NOOP)
# Backwards compat with 6.18 through 6.25
blibdirs.ts : blibdirs
$(NOECHO) $(NOOP)
$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_LIBDIR)
$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)
$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHLIB)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB)
$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_AUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)
$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)
$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
$(INST_BIN)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_BIN)
$(NOECHO) $(CHMOD) 755 $(INST_BIN)
$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_SCRIPT)
$(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)
$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN1DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)
$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)
$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
$(NOECHO) $(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
$(NOECHO) $(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP =
# --- MakeMaker dynamic_lib section:
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
static :: $(FIRST_MAKEFILE) $(INST_STATIC)
$(NOECHO) $(NOOP)
# --- MakeMaker static_lib section:
# --- MakeMaker manifypods section:
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
POD2MAN = $(POD2MAN_EXE)
manifypods : pure_all
$(NOECHO) $(NOOP)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean_subdirs section:
clean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean :: clean_subdirs
- $(RM_F) \
*$(LIB_EXT) core \
core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
core.[0-9][0-9] $(BASEEXT).bso \
pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
$(BASEEXT).x $(BOOTSTRAP) \
perl$(EXE_EXT) tmon.out \
*$(OBJ_EXT) pm_to_blib \
$(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
core.*perl.*.? $(MAKE_APERL_FILE) \
perl $(BASEEXT).def \
core.[0-9][0-9][0-9] mon.out \
lib$(BASEEXT).def perlmain.c \
perl.exe so_locations \
$(BASEEXT).exp
- $(RM_RF) \
blib
- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
# --- MakeMaker realclean_subdirs section:
realclean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete dist files
realclean purge :: clean realclean_subdirs
- $(RM_F) \
$(MAKEFILE_OLD) $(FIRST_MAKEFILE)
- $(RM_RF) \
$(DISTVNAME)
# --- MakeMaker metafile section:
metafile : create_distdir
$(NOECHO) $(ECHO) Generating META.yml
$(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META_new.yml
$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META_new.yml
$(NOECHO) $(ECHO) 'name: Authen-NTLM-DES' >> META_new.yml
$(NOECHO) $(ECHO) 'version: 1.02' >> META_new.yml
$(NOECHO) $(ECHO) 'version_from: DES.pm' >> META_new.yml
$(NOECHO) $(ECHO) 'installdirs: site' >> META_new.yml
$(NOECHO) $(ECHO) 'requires:' >> META_new.yml
$(NOECHO) $(ECHO) '' >> META_new.yml
$(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml
$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.30_01' >> META_new.yml
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
# --- MakeMaker signature section:
signature :
cpansign -s
# --- MakeMaker dist_basics section skipped.
# --- MakeMaker dist_core section skipped.
# --- MakeMaker distdir section skipped.
# --- MakeMaker dist_test section skipped.
# --- MakeMaker dist_ci section skipped.
# --- MakeMaker distmeta section:
distmeta : create_distdir metafile
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
-e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
# --- MakeMaker distsignature section:
distsignature : create_distdir
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \
-e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"'
$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
cd $(DISTVNAME) && cpansign -s
# --- MakeMaker install section skipped.
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
$(NOECHO) $(NOOP)
# --- MakeMaker perldepend section:
# --- MakeMaker makefile section:
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
$(PERLRUN) Makefile.PL
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = ../perl
FULLPERL = /usr/bin/perl
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES =
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
$(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.'
test_dynamic :: pure_all
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: test_dynamic
testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="1,02,0,0">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR>David (Buzz) Bussenschutt &lt;davidbuzz@gmail.com&gt;, Mark Bush &lt;Mark.Bush@bushnet.demon.co.uk&gt;</AUTHOR>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="i486-linux-gnu-thread-multi" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib : $(TO_INST_PM)
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \
DES.pm $(INST_LIB)/Authen/NTLM/DES.pm
$(NOECHO) $(TOUCH) pm_to_blib
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.

12
NTLM-1.05/DES/Makefile.PL Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/perl
use ExtUtils::MakeMaker;
#
WriteMakefile(
'NAME' => 'Authen::NTLM::DES',
'VERSION_FROM' => 'DES.pm',
($] >= 5.005 ? ## Add these new keywords supported since 5.005
('AUTHOR' => 'David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>') : ()),
);

0
NTLM-1.05/DES/pm_to_blib Normal file
View File

15
NTLM-1.05/MANIFEST Normal file
View File

@ -0,0 +1,15 @@
Changes
Makefile.PL
MANIFEST
README
NTLM.pm
DES/DES.pm
DES/Makefile.PL
MD4/MD4.pm
MD4/Makefile.PL
t/01_load.t
t/02_ntlm.t
t/03_oo.t
t/04_v2.t
t/99_pod.t
META.yml Module meta-data (added by MakeMaker)

197
NTLM-1.05/MD4/MD4.pm Normal file
View File

@ -0,0 +1,197 @@
#!/usr/local/bin/perl
#
# This is a partial implentation of the MD4 checksum code.
#
# NOTE
#
# The function &add() in this module is required as we need to be
# able to add 32bit integers ignoring overflow. The C code this is
# based on does this because it uses the underlying hardware to
# perform the required addition however we need to be more careful
# as Perl will overflow an int and produce a result of 0xffffffff
# which is not very useful. The &add() function splits its arguments
# into two shorts and adds these carrying overflow from the low short
# to the high short and ignoring carry from the high short. Not
# exactly efficient, but it works and is fast enough for the purposes
# of this implementation
#
package Authen::NTLM::MD4;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
$VERSION = "1.02";
@ISA = qw(Exporter);
@EXPORT = qw(mdfour);
my ($A, $B, $C, $D);
my (@X, $M);
sub mdfour
{
my ($in) = @_;
my ($i, $pos);
my $len = length($in);
my $b = $len * 8;
$in .= "\0"x128;
$A = 0x67452301;
$B = 0xefcdab89;
$C = 0x98badcfe;
$D = 0x10325476;
$pos = 0;
while ($len > 64)
{
&copy64(substr($in, $pos, 64));
&mdfour64;
$pos += 64;
$len -= 64;
}
my $buf = substr($in, $pos, $len);
$buf .= sprintf "%c", 0x80;
if ($len <= 55)
{
$buf .= "\0"x(55-$len);
$buf .= pack("V", $b);
$buf .= "\0"x4;
&copy64($buf);
&mdfour64;
}
else
{
$buf .= "\0"x(120-$len);
$buf .= pack("V", $b);
$buf .= "\0"x4;
&copy64(substr($buf, 0, 64));
&mdfour64;
&copy64(substr($buf, 64, 64));
&mdfour64;
}
my $out = pack("VVVV", $A, $B, $C, $D);
return $out;
}
sub F
{
my ($X, $Y, $Z) = @_;
my $res = ($X&$Y) | ((~$X)&$Z);
return $res;
}
sub G
{
my ($X, $Y, $Z) = @_;
return ($X&$Y) | ($X&$Z) | ($Y&$Z);
}
sub H
{
my ($X, $Y, $Z) = @_;
return $X^$Y^$Z;
}
sub lshift
{
my ($x, $s) = @_;
$x &= 0xffffffff;
return (($x<<$s)&0xffffffff) | ($x>>(32-$s));
}
sub ROUND1
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &F($b, $c, $d), $X[$k]);
return &lshift($e, $s);
}
sub ROUND2
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &G($b, $c, $d), $X[$k], 0x5a827999);
return &lshift($e, $s);
}
sub ROUND3
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &H($b, $c, $d), $X[$k], 0x6ed9eba1);
return &lshift($e, $s);
}
sub mdfour64
{
my ($i, $AA, $BB, $CC, $DD);
@X = unpack("N16", $M);
$AA = $A;
$BB = $B;
$CC = $C;
$DD = $D;
$A = &ROUND1($A,$B,$C,$D, 0, 3); $D = &ROUND1($D,$A,$B,$C, 1, 7);
$C = &ROUND1($C,$D,$A,$B, 2,11); $B = &ROUND1($B,$C,$D,$A, 3,19);
$A = &ROUND1($A,$B,$C,$D, 4, 3); $D = &ROUND1($D,$A,$B,$C, 5, 7);
$C = &ROUND1($C,$D,$A,$B, 6,11); $B = &ROUND1($B,$C,$D,$A, 7,19);
$A = &ROUND1($A,$B,$C,$D, 8, 3); $D = &ROUND1($D,$A,$B,$C, 9, 7);
$C = &ROUND1($C,$D,$A,$B,10,11); $B = &ROUND1($B,$C,$D,$A,11,19);
$A = &ROUND1($A,$B,$C,$D,12, 3); $D = &ROUND1($D,$A,$B,$C,13, 7);
$C = &ROUND1($C,$D,$A,$B,14,11); $B = &ROUND1($B,$C,$D,$A,15,19);
$A = &ROUND2($A,$B,$C,$D, 0, 3); $D = &ROUND2($D,$A,$B,$C, 4, 5);
$C = &ROUND2($C,$D,$A,$B, 8, 9); $B = &ROUND2($B,$C,$D,$A,12,13);
$A = &ROUND2($A,$B,$C,$D, 1, 3); $D = &ROUND2($D,$A,$B,$C, 5, 5);
$C = &ROUND2($C,$D,$A,$B, 9, 9); $B = &ROUND2($B,$C,$D,$A,13,13);
$A = &ROUND2($A,$B,$C,$D, 2, 3); $D = &ROUND2($D,$A,$B,$C, 6, 5);
$C = &ROUND2($C,$D,$A,$B,10, 9); $B = &ROUND2($B,$C,$D,$A,14,13);
$A = &ROUND2($A,$B,$C,$D, 3, 3); $D = &ROUND2($D,$A,$B,$C, 7, 5);
$C = &ROUND2($C,$D,$A,$B,11, 9); $B = &ROUND2($B,$C,$D,$A,15,13);
$A = &ROUND3($A,$B,$C,$D, 0, 3); $D = &ROUND3($D,$A,$B,$C, 8, 9);
$C = &ROUND3($C,$D,$A,$B, 4,11); $B = &ROUND3($B,$C,$D,$A,12,15);
$A = &ROUND3($A,$B,$C,$D, 2, 3); $D = &ROUND3($D,$A,$B,$C,10, 9);
$C = &ROUND3($C,$D,$A,$B, 6,11); $B = &ROUND3($B,$C,$D,$A,14,15);
$A = &ROUND3($A,$B,$C,$D, 1, 3); $D = &ROUND3($D,$A,$B,$C, 9, 9);
$C = &ROUND3($C,$D,$A,$B, 5,11); $B = &ROUND3($B,$C,$D,$A,13,15);
$A = &ROUND3($A,$B,$C,$D, 3, 3); $D = &ROUND3($D,$A,$B,$C,11, 9);
$C = &ROUND3($C,$D,$A,$B, 7,11); $B = &ROUND3($B,$C,$D,$A,15,15);
$A = &add($A, $AA); $B = &add($B, $BB);
$C = &add($C, $CC); $D = &add($D, $DD);
$A &= 0xffffffff; $B &= 0xffffffff;
$C &= 0xffffffff; $D &= 0xffffffff;
map {$_ = 0} @X;
}
sub copy64
{
my ($in) = @_;
$M = pack("V16", unpack("N16", $in));
}
# see note at top of this file about this function
sub add
{
my (@nums) = @_;
my ($r_low, $r_high, $n_low, $l_high);
my $num;
$r_low = $r_high = 0;
foreach $num (@nums)
{
$n_low = $num & 0xffff;
$n_high = ($num&0xffff0000)>>16;
$r_low += $n_low;
($r_low&0xf0000) && $r_high++;
$r_low &= 0xffff;
$r_high += $n_high;
$r_high &= 0xffff;
}
return ($r_high<<16)|$r_low;
}
1;

580
NTLM-1.05/MD4/Makefile Normal file
View File

@ -0,0 +1,580 @@
# This Makefile is for the Authen::NTLM::MD4 extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.30_01 (Revision: Revision: 4535 ) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# AUTHOR => q[David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>]
# NAME => q[Authen::NTLM::MD4]
# VERSION_FROM => q[MD4.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl/5.8/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
LD = cc
LDDLFLAGS = -shared -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc-2.7.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.6.24-19-server
RANLIB = :
SITELIBEXP = /usr/local/share/perl/5.8.8
SITEARCHEXP = /usr/local/lib/perl/5.8.8
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
VENDORARCHEXP = /usr/lib/perl5
VENDORLIBEXP = /usr/share/perl5
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
DIRFILESEP = /
DFSEP = $(DIRFILESEP)
NAME = Authen::NTLM::MD4
NAME_SYM = Authen_NTLM_MD4
VERSION = 1.02
VERSION_MACRO = VERSION
VERSION_SYM = 1_02
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION = 1.02
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = ../blib/arch
INST_SCRIPT = ../blib/script
INST_BIN = ../blib/bin
INST_LIB = ../blib/lib
INST_MAN1DIR = ../blib/man1
INST_MAN3DIR = ../blib/man3
MAN1EXT = 1p
MAN3EXT = 3pm
INSTALLDIRS = site
DESTDIR =
PREFIX = /usr
PERLPREFIX = $(PREFIX)
SITEPREFIX = $(PREFIX)/local
VENDORPREFIX = $(PREFIX)
INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.8
DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.8.8
DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5
DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.8
DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.8.8
DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5
DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
INSTALLBIN = $(PERLPREFIX)/bin
DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
INSTALLSITEBIN = $(SITEPREFIX)/bin
DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
INSTALLVENDORBIN = $(VENDORPREFIX)/bin
DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
INSTALLSCRIPT = $(PERLPREFIX)/bin
DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
INSTALLSITESCRIPT = $(SITEPREFIX)/bin
DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT)
INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin
DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT)
INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1
DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1
DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1
DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3
DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3
DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3
DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
PERL_LIB = /usr/share/perl/5.8
PERL_ARCHLIB = /usr/lib/perl/5.8
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKEFILE_OLD = Makefile.old
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl/5.8/CORE
PERL = /usr/bin/perl
FULLPERL = /usr/bin/perl
ABSPERL = $(PERL)
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
ABSPERLRUN = $(ABSPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
PERL_CORE = 0
PERM_RW = 644
PERM_RWX = 755
MAKEMAKER = /usr/share/perl/5.8/ExtUtils/MakeMaker.pm
MM_VERSION = 6.30_01
MM_REVISION = Revision: 4535
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Authen/NTLM/MD4
BASEEXT = MD4
PARENT_NAME = Authen::NTLM
DLBASE = $(BASEEXT)
VERSION_FROM = MD4.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
BOOTDEP =
# Handy lists of source code files:
XS_FILES =
C_FILES =
O_FILES =
H_FILES =
MAN1PODS =
MAN3PODS =
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
# Where to build things
INST_LIBDIR = $(INST_LIB)/Authen/NTLM
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Authen/NTLM
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC =
INST_DYNAMIC =
INST_BOOT =
# Extra linker info
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = MD4.pm
PM_TO_BLIB = MD4.pm \
$(INST_LIB)/Authen/NTLM/MD4.pm
# --- MakeMaker platform_constants section:
MM_Unix_VERSION = 1.50_01
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)'
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
NOECHO = @
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath
EQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime
ECHO = echo
ECHO_N = echo -n
UNINST = 0
VERBINST = 0
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
DOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
UNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall
WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist
MACROSTART =
MACROEND =
USEMAKEFILE = -f
FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"
# --- MakeMaker makemakerdflt section:
makemakerdflt: all
$(NOECHO) $(NOOP)
# --- MakeMaker dist section skipped.
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
# --- MakeMaker const_loadlibs section:
# --- MakeMaker const_cccmd section:
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"
# --- MakeMaker special_targets section:
.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir
# --- MakeMaker c_o section:
# --- MakeMaker xs_c section:
# --- MakeMaker xs_o section:
# --- MakeMaker top_targets section:
all :: pure_all manifypods
$(NOECHO) $(NOOP)
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) blibdirs
$(NOECHO) $(NOOP)
help :
perldoc ExtUtils::MakeMaker
# --- MakeMaker blibdirs section:
blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
$(NOECHO) $(NOOP)
# Backwards compat with 6.18 through 6.25
blibdirs.ts : blibdirs
$(NOECHO) $(NOOP)
$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_LIBDIR)
$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)
$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHLIB)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB)
$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_AUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)
$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)
$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
$(INST_BIN)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_BIN)
$(NOECHO) $(CHMOD) 755 $(INST_BIN)
$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_SCRIPT)
$(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)
$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN1DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)
$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)
$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
$(NOECHO) $(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
$(NOECHO) $(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP =
# --- MakeMaker dynamic_lib section:
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
static :: $(FIRST_MAKEFILE) $(INST_STATIC)
$(NOECHO) $(NOOP)
# --- MakeMaker static_lib section:
# --- MakeMaker manifypods section:
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
POD2MAN = $(POD2MAN_EXE)
manifypods : pure_all
$(NOECHO) $(NOOP)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean_subdirs section:
clean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean :: clean_subdirs
- $(RM_F) \
*$(LIB_EXT) core \
core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
core.[0-9][0-9] $(BASEEXT).bso \
pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
$(BASEEXT).x $(BOOTSTRAP) \
perl$(EXE_EXT) tmon.out \
*$(OBJ_EXT) pm_to_blib \
$(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
core.*perl.*.? $(MAKE_APERL_FILE) \
$(BASEEXT).def perl \
core.[0-9][0-9][0-9] mon.out \
lib$(BASEEXT).def perl.exe \
perlmain.c so_locations \
$(BASEEXT).exp
- $(RM_RF) \
blib
- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
# --- MakeMaker realclean_subdirs section:
realclean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete dist files
realclean purge :: clean realclean_subdirs
- $(RM_F) \
$(MAKEFILE_OLD) $(FIRST_MAKEFILE)
- $(RM_RF) \
$(DISTVNAME)
# --- MakeMaker metafile section:
metafile : create_distdir
$(NOECHO) $(ECHO) Generating META.yml
$(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META_new.yml
$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META_new.yml
$(NOECHO) $(ECHO) 'name: Authen-NTLM-MD4' >> META_new.yml
$(NOECHO) $(ECHO) 'version: 1.02' >> META_new.yml
$(NOECHO) $(ECHO) 'version_from: MD4.pm' >> META_new.yml
$(NOECHO) $(ECHO) 'installdirs: site' >> META_new.yml
$(NOECHO) $(ECHO) 'requires:' >> META_new.yml
$(NOECHO) $(ECHO) '' >> META_new.yml
$(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml
$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.30_01' >> META_new.yml
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
# --- MakeMaker signature section:
signature :
cpansign -s
# --- MakeMaker dist_basics section skipped.
# --- MakeMaker dist_core section skipped.
# --- MakeMaker distdir section skipped.
# --- MakeMaker dist_test section skipped.
# --- MakeMaker dist_ci section skipped.
# --- MakeMaker distmeta section:
distmeta : create_distdir metafile
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
-e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
# --- MakeMaker distsignature section:
distsignature : create_distdir
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \
-e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"'
$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
cd $(DISTVNAME) && cpansign -s
# --- MakeMaker install section skipped.
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
$(NOECHO) $(NOOP)
# --- MakeMaker perldepend section:
# --- MakeMaker makefile section:
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
$(PERLRUN) Makefile.PL
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = ../perl
FULLPERL = /usr/bin/perl
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES =
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
$(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.'
test_dynamic :: pure_all
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: test_dynamic
testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="1,02,0,0">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR>David (Buzz) Bussenschutt &lt;davidbuzz@gmail.com&gt;, Mark Bush &lt;Mark.Bush@bushnet.demon.co.uk&gt;</AUTHOR>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="i486-linux-gnu-thread-multi" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib : $(TO_INST_PM)
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \
MD4.pm $(INST_LIB)/Authen/NTLM/MD4.pm
$(NOECHO) $(TOUCH) pm_to_blib
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.

12
NTLM-1.05/MD4/Makefile.PL Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/perl
use ExtUtils::MakeMaker;
#
WriteMakefile(
'NAME' => 'Authen::NTLM::MD4',
'VERSION_FROM' => 'MD4.pm',
($] >= 5.005 ? ## Add these new keywords supported since 5.005
('AUTHOR' => 'David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>') : ()),
);

0
NTLM-1.05/MD4/pm_to_blib Normal file
View File

15
NTLM-1.05/META.yml Normal file
View File

@ -0,0 +1,15 @@
--- #YAML:1.0
name: Authen-NTLM
version: 1.05
abstract: ~
license: ~
author:
- David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>
generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
Digest::HMAC_MD5: 0
MIME::Base64: 0
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3

793
NTLM-1.05/Makefile Normal file
View File

@ -0,0 +1,793 @@
# This Makefile is for the Authen::NTLM extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.30_01 (Revision: Revision: 4535 ) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# AUTHOR => q[David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>]
# DIR => [q[DES], q[MD4]]
# NAME => q[Authen::NTLM]
# PREREQ_PM => { Digest::HMAC_MD5=>q[0], MIME::Base64=>q[0] }
# VERSION_FROM => q[NTLM.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl/5.8/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = cc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E
DLEXT = so
DLSRC = dl_dlopen.xs
LD = cc
LDDLFLAGS = -shared -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc-2.7.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.6.24-19-server
RANLIB = :
SITELIBEXP = /usr/local/share/perl/5.8.8
SITEARCHEXP = /usr/local/lib/perl/5.8.8
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
VENDORARCHEXP = /usr/lib/perl5
VENDORLIBEXP = /usr/share/perl5
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
DIRFILESEP = /
DFSEP = $(DIRFILESEP)
NAME = Authen::NTLM
NAME_SYM = Authen_NTLM
VERSION = 1.05
VERSION_MACRO = VERSION
VERSION_SYM = 1_05
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION = 1.05
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
INST_BIN = blib/bin
INST_LIB = blib/lib
INST_MAN1DIR = blib/man1
INST_MAN3DIR = blib/man3
MAN1EXT = 1p
MAN3EXT = 3pm
INSTALLDIRS = site
DESTDIR =
PREFIX = /usr
PERLPREFIX = $(PREFIX)
SITEPREFIX = $(PREFIX)/local
VENDORPREFIX = $(PREFIX)
INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.8
DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.8.8
DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5
DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.8
DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.8.8
DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5
DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
INSTALLBIN = $(PERLPREFIX)/bin
DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
INSTALLSITEBIN = $(SITEPREFIX)/bin
DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
INSTALLVENDORBIN = $(VENDORPREFIX)/bin
DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
INSTALLSCRIPT = $(PERLPREFIX)/bin
DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
INSTALLSITESCRIPT = $(SITEPREFIX)/bin
DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT)
INSTALLVENDORSCRIPT = $(VENDORPREFIX)/bin
DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT)
INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1
DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1
DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1
DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3
DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3
DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3
DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
PERL_LIB = /usr/share/perl/5.8
PERL_ARCHLIB = /usr/lib/perl/5.8
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKEFILE_OLD = Makefile.old
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl/5.8/CORE
PERL = /usr/bin/perl
FULLPERL = /usr/bin/perl
ABSPERL = $(PERL)
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
ABSPERLRUN = $(ABSPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
PERL_CORE = 0
PERM_RW = 644
PERM_RWX = 755
MAKEMAKER = /usr/share/perl/5.8/ExtUtils/MakeMaker.pm
MM_VERSION = 6.30_01
MM_REVISION = Revision: 4535
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Authen/NTLM
BASEEXT = NTLM
PARENT_NAME = Authen
DLBASE = $(BASEEXT)
VERSION_FROM = NTLM.pm
OBJECT =
LDFROM = $(OBJECT)
LINKTYPE = dynamic
BOOTDEP =
# Handy lists of source code files:
XS_FILES =
C_FILES =
O_FILES =
H_FILES =
MAN1PODS =
MAN3PODS = NTLM.pm
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
# Where to build things
INST_LIBDIR = $(INST_LIB)/Authen
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Authen
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC =
INST_DYNAMIC =
INST_BOOT =
# Extra linker info
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = NTLM.pm
PM_TO_BLIB = NTLM.pm \
$(INST_LIB)/Authen/NTLM.pm
# --- MakeMaker platform_constants section:
MM_Unix_VERSION = 1.50_01
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)'
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
NOECHO = @
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath
EQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime
ECHO = echo
ECHO_N = echo -n
UNINST = 0
VERBINST = 0
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
DOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
UNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall
WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist
MACROSTART =
MACROEND =
USEMAKEFILE = -f
FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"
# --- MakeMaker makemakerdflt section:
makemakerdflt: all
$(NOECHO) $(NOOP)
# --- MakeMaker dist section:
TAR = tar
TARFLAGS = cvf
ZIP = zip
ZIPFLAGS = -r
COMPRESS = gzip --best
SUFFIX = .gz
SHAR = shar
PREOP = $(NOECHO) $(NOOP)
POSTOP = $(NOECHO) $(NOOP)
TO_UNIX = $(NOECHO) $(NOOP)
CI = ci -u
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
DIST_CP = best
DIST_DEFAULT = tardist
DISTNAME = Authen-NTLM
DISTVNAME = Authen-NTLM-1.05
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
# --- MakeMaker const_loadlibs section:
# --- MakeMaker const_cccmd section:
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"
# --- MakeMaker special_targets section:
.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
.PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir
# --- MakeMaker c_o section:
# --- MakeMaker xs_c section:
# --- MakeMaker xs_o section:
# --- MakeMaker top_targets section:
all :: pure_all manifypods
$(NOECHO) $(NOOP)
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) blibdirs
$(NOECHO) $(NOOP)
help :
perldoc ExtUtils::MakeMaker
# --- MakeMaker blibdirs section:
blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
$(NOECHO) $(NOOP)
# Backwards compat with 6.18 through 6.25
blibdirs.ts : blibdirs
$(NOECHO) $(NOOP)
$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_LIBDIR)
$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)
$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHLIB)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB)
$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_AUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)
$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
$(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)
$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
$(INST_BIN)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_BIN)
$(NOECHO) $(CHMOD) 755 $(INST_BIN)
$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_SCRIPT)
$(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)
$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN1DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)
$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
$(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)
$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
$(NOECHO) $(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
$(NOECHO) $(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP =
# --- MakeMaker dynamic_lib section:
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
static :: $(FIRST_MAKEFILE) $(INST_STATIC)
$(NOECHO) $(NOOP)
# --- MakeMaker static_lib section:
# --- MakeMaker manifypods section:
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
POD2MAN = $(POD2MAN_EXE)
manifypods : pure_all \
NTLM.pm \
NTLM.pm
$(NOECHO) $(POD2MAN) --section=$(MAN3EXT) --perm_rw=$(PERM_RW) \
NTLM.pm $(INST_MAN3DIR)/Authen::NTLM.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# The default clean, realclean and test targets in this Makefile
# have automatically been given entries for each subdir.
subdirs ::
$(NOECHO) cd DES && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
subdirs ::
$(NOECHO) cd MD4 && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)
# --- MakeMaker clean_subdirs section:
clean_subdirs :
$(ABSPERLRUN) -e 'chdir '\''DES'\''; system '\''$(MAKE) clean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';'
$(ABSPERLRUN) -e 'chdir '\''MD4'\''; system '\''$(MAKE) clean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';'
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean :: clean_subdirs
- $(RM_F) \
*$(LIB_EXT) core \
core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
core.[0-9][0-9] $(BASEEXT).bso \
pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
$(BASEEXT).x $(BOOTSTRAP) \
perl$(EXE_EXT) tmon.out \
*$(OBJ_EXT) pm_to_blib \
$(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
core.*perl.*.? $(MAKE_APERL_FILE) \
$(BASEEXT).def perl \
core.[0-9][0-9][0-9] mon.out \
lib$(BASEEXT).def perl.exe \
perlmain.c so_locations \
$(BASEEXT).exp
- $(RM_RF) \
blib
- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
# --- MakeMaker realclean_subdirs section:
realclean_subdirs :
- $(ABSPERLRUN) -e 'chdir '\''DES'\''; system '\''$(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) realclean'\'' if -f '\''$(MAKEFILE_OLD)'\'';'
- $(ABSPERLRUN) -e 'chdir '\''DES'\''; system '\''$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) realclean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';'
- $(ABSPERLRUN) -e 'chdir '\''MD4'\''; system '\''$(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) realclean'\'' if -f '\''$(MAKEFILE_OLD)'\'';'
- $(ABSPERLRUN) -e 'chdir '\''MD4'\''; system '\''$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) realclean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';'
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete dist files
realclean purge :: clean realclean_subdirs
- $(RM_F) \
$(MAKEFILE_OLD) $(FIRST_MAKEFILE)
- $(RM_RF) \
$(DISTVNAME)
# --- MakeMaker metafile section:
metafile : create_distdir
$(NOECHO) $(ECHO) Generating META.yml
$(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META_new.yml
$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META_new.yml
$(NOECHO) $(ECHO) 'name: Authen-NTLM' >> META_new.yml
$(NOECHO) $(ECHO) 'version: 1.05' >> META_new.yml
$(NOECHO) $(ECHO) 'version_from: NTLM.pm' >> META_new.yml
$(NOECHO) $(ECHO) 'installdirs: site' >> META_new.yml
$(NOECHO) $(ECHO) 'requires:' >> META_new.yml
$(NOECHO) $(ECHO) ' Digest::HMAC_MD5: 0' >> META_new.yml
$(NOECHO) $(ECHO) ' MIME::Base64: 0' >> META_new.yml
$(NOECHO) $(ECHO) '' >> META_new.yml
$(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml
$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.30_01' >> META_new.yml
-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
# --- MakeMaker signature section:
signature :
cpansign -s
# --- MakeMaker dist_basics section:
distclean :: realclean distcheck
$(NOECHO) $(NOOP)
distcheck :
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
skipcheck :
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
$(RM_F) *~ *.orig */*~ */*.orig
# --- MakeMaker dist_core section:
dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
$(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \
-e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';'
tardist : $(DISTVNAME).tar$(SUFFIX)
$(NOECHO) $(NOOP)
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
zipdist : $(DISTVNAME).zip
$(NOECHO) $(NOOP)
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
# --- MakeMaker distdir section:
create_distdir :
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
distdir : create_distdir distmeta
$(NOECHO) $(NOOP)
# --- MakeMaker dist_test section:
disttest : distdir
cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
# --- MakeMaker dist_ci section:
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \
-e "@all = keys %{ maniread() };" \
-e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \
-e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
# --- MakeMaker distmeta section:
distmeta : create_distdir metafile
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
-e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
# --- MakeMaker distsignature section:
distsignature : create_distdir
$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \
-e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"'
$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
cd $(DISTVNAME) && cpansign -s
# --- MakeMaker install section:
install :: all pure_install doc_install
$(NOECHO) $(NOOP)
install_perl :: all pure_perl_install doc_perl_install
$(NOECHO) $(NOOP)
install_site :: all pure_site_install doc_site_install
$(NOECHO) $(NOOP)
install_vendor :: all pure_vendor_install doc_vendor_install
$(NOECHO) $(NOOP)
pure_install :: pure_$(INSTALLDIRS)_install
$(NOECHO) $(NOOP)
doc_install :: doc_$(INSTALLDIRS)_install
$(NOECHO) $(NOOP)
pure__install : pure_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
$(NOECHO) umask 022; $(MOD_INSTALL) \
$(INST_LIB) $(DESTINSTALLPRIVLIB) \
$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
$(INST_BIN) $(DESTINSTALLBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
$(SITEARCHEXP)/auto/$(FULLEXT)
pure_site_install ::
$(NOECHO) umask 02; $(MOD_INSTALL) \
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(DESTINSTALLSITELIB) \
$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
$(INST_BIN) $(DESTINSTALLSITEBIN) \
$(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
pure_vendor_install ::
$(NOECHO) umask 022; $(MOD_INSTALL) \
$(INST_LIB) $(DESTINSTALLVENDORLIB) \
$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
$(INST_BIN) $(DESTINSTALLVENDORBIN) \
$(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
doc_perl_install ::
doc_site_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod
-$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH)
-$(NOECHO) umask 02; $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(DESTINSTALLSITEARCH)/perllocal.pod
doc_vendor_install ::
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
$(NOECHO) $(NOOP)
uninstall_from_perldirs ::
uninstall_from_sitedirs ::
$(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
uninstall_from_vendordirs ::
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
$(NOECHO) $(NOOP)
# --- MakeMaker perldepend section:
# --- MakeMaker makefile section:
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
$(PERLRUN) Makefile.PL
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = perl
FULLPERL = /usr/bin/perl
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
$(NOECHO) $(PERLRUNINST) \
Makefile.PL DIR=DES:MD4 \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES = t/*.t
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
$(NOECHO) $(ABSPERLRUN) -e 'chdir '\''DES'\''; ' \
-e 'system '\''$(MAKE) test $(PASTHRU)'\'' ' \
-e ' if -f '\''$(FIRST_MAKEFILE)'\'';'
$(NOECHO) $(ABSPERLRUN) -e 'chdir '\''MD4'\''; ' \
-e 'system '\''$(MAKE) test $(PASTHRU)'\'' ' \
-e ' if -f '\''$(FIRST_MAKEFILE)'\'';'
test_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: test_dynamic
testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="1,05,0,0">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR>David (Buzz) Bussenschutt &lt;davidbuzz@gmail.com&gt;, Mark Bush &lt;Mark.Bush@bushnet.demon.co.uk&gt;</AUTHOR>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <DEPENDENCY NAME="Digest-HMAC_MD5" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <DEPENDENCY NAME="MIME-Base64" VERSION="0,0,0,0" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="i486-linux-gnu-thread-multi" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib : $(TO_INST_PM)
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \
NTLM.pm $(INST_LIB)/Authen/NTLM.pm
$(NOECHO) $(TOUCH) pm_to_blib
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.

14
NTLM-1.05/Makefile.PL Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/perl
use ExtUtils::MakeMaker;
#
WriteMakefile(
'NAME' => 'Authen::NTLM',
'DIR' => ['DES', 'MD4'],
'VERSION_FROM' => 'NTLM.pm',
'PREREQ_PM' => { 'MIME::Base64' => 0, 'Digest::HMAC_MD5' => 0 },
($] >= 5.005 ? ## Add these new keywords supported since 5.005
('AUTHOR' => 'David (Buzz) Bussenschutt <davidbuzz@gmail.com>, Mark Bush <Mark.Bush@bushnet.demon.co.uk>') : ()),
);

499
NTLM-1.05/NTLM.pm Normal file
View File

@ -0,0 +1,499 @@
#!/usr/local/bin/perl
package Authen::NTLM;
use strict;
use Authen::NTLM::DES;
use Authen::NTLM::MD4;
use MIME::Base64;
use Digest::HMAC_MD5;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
=head1 NAME
Authen::NTLM - An NTLM authentication module
=head1 SYNOPSIS
use Mail::IMAPClient;
use Authen::NTLM;
my $imap = Mail::IMAPClient->new(Server=>'imaphost');
ntlm_user($username);
ntlm_password($password);
$imap->authenticate("NTLM", Authen::NTLM::ntlm);
:
$imap->logout;
ntlm_reset;
:
or
ntlmv2(1);
ntlm_user($username);
ntlm_host($host);
ntlm_password($password);
:
or
my $ntlm = Authen::NTLM-> new(
host => $host,
user => $username,
domain => $domain,
password => $password,
version => 1,
);
$ntlm-> challenge;
:
$ntlm-> challenge($challenge);
=head1 DESCRIPTION
This module provides methods to use NTLM authentication. It can
be used as an authenticate method with the Mail::IMAPClient module
to perform the challenge/response mechanism for NTLM connections
or it can be used on its own for NTLM authentication with other
protocols (eg. HTTP).
The implementation is a direct port of the code from F<fetchmail>
which, itself, has based its NTLM implementation on F<samba>. As
such, this code is not especially efficient, however it will still
take a fraction of a second to negotiate a login on a PII which is
likely to be good enough for most situations.
=head2 FUNCTIONS
=over 4
=item ntlm_domain()
Set the domain to use in the NTLM authentication messages.
Returns the new domain. Without an argument, this function
returns the current domain entry.
=item ntlm_user()
Set the username to use in the NTLM authentication messages.
Returns the new username. Without an argument, this function
returns the current username entry.
=item ntlm_password()
Set the password to use in the NTLM authentication messages.
Returns the new password. Without an argument, this function
returns the current password entry.
=item ntlm_reset()
Resets the NTLM challenge/response state machine so that the next
call to C<ntlm()> will produce an initial connect message.
=item ntlm()
Generate a reply to a challenge. The NTLM protocol involves an
initial empty challenge from the server requiring a message
response containing the username and domain (which may be empty).
The first call to C<ntlm()> generates this first message ignoring
any arguments.
The second time it is called, it is assumed that the argument is
the challenge string sent from the server. This will contain 8
bytes of data which are used in the DES functions to generate the
response authentication strings. The result of the call is the
final authentication string.
If C<ntlm_reset()> is called, then the next call to C<ntlm()> will
start the process again allowing multiple authentications within
an application.
=item ntlmv2()
Use NTLM v2 authentication.
=back
=head2 OBJECT API
=over
=item new %options
Creates an object that accepts the following options: C<user>, C<host>,
C<domain>, C<password>, C<version>.
=item challenge [$challenge]
If C<$challenge> is not supplied, first-stage challenge string is generated.
Otherwise, the third-stage challenge is generated, where C<$challenge> is
assumed to be extracted from the second stage of NTLM exchange. The result of
the call is the final authentication string.
=back
=head1 AUTHOR
David (Buzz) Bussenschutt <davidbuzz@gmail.com> - current maintainer
Dmitry Karasik <dmitry@karasik.eu.org> - nice ntlmv2 patch, OO extensions.
Andrew Hobson <ahobson@infloop.com> - initial ntlmv2 code
Mark Bush <Mark.Bush@bushnet.demon.co.uk> - perl port
Eric S. Raymond - author of fetchmail
Andrew Tridgell and Jeremy Allison for SMB/Netbios code
=head1 SEE ALSO
L<perl>, L<Mail::IMAPClient>, L<LWP::Authen::Ntlm>
=head1 HISTORY
1.05 - add OO interface by Dmitry Karasik
1.04 - implementation of NTLMv2 by Andrew Hobson/Dmitry Karasik
1.03 - fixes long-standing 1 line bug L<http://rt.cpan.org/Public/Bug/Display.html?id=9521> - released by David Bussenschutt 9th Aug 2007
1.02 - released by Mark Bush 29th Oct 2001
=cut
$VERSION = "1.05";
@ISA = qw(Exporter);
@EXPORT = qw(ntlm ntlm_domain ntlm_user ntlm_password ntlm_reset ntlm_host ntlmv2);
my $domain = "";
my $user = "";
my $password = "";
my $str_hdr = "vvV";
my $hdr_len = 8;
my $ident = "NTLMSSP";
my $msg1_f = 0x0000b207;
my $msg1 = "Z8VV";
my $msg1_hlen = 16 + ($hdr_len*2);
my $msg2 = "Z8Va${hdr_len}Va8a8a${hdr_len}";
my $msg2_hlen = 12 + $hdr_len + 20 + $hdr_len;
my $msg3 = "Z8V";
my $msg3_tl = "V";
my $msg3_hlen = 12 + ($hdr_len*6) + 4;
my $state = 0;
my $host = "";
my $ntlm_v2 = 0;
my $ntlm_v2_msg3_flags = 0x88205;
# Domain Name supplied on negotiate
use constant NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED => 0x00001000;
# Workstation Name supplied on negotiate
use constant NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED => 0x00002000;
# Try to use NTLMv2
use constant NTLMSSP_NEGOTIATE_NTLM2 => 0x00080000;
# Object API
sub new
{
my ( $class, %opt) = @_;
for (qw(domain user password host)) {
$opt{$_} = "" unless defined $opt{$_};
}
$opt{version} ||= 1;
return bless { %opt }, $class;
}
sub challenge
{
my ( $self, $challenge) = @_;
$state = defined $challenge;
($user,$domain,$password,$host) = @{$self}{qw(user domain password host)};
$ntlm_v2 = ($self-> {version} > 1) ? 1 : 0;
return ntlm($challenge);
}
eval "sub $_ { \$#_ ? \$_[0]->{$_} = \$_[1] : \$_[0]->{$_} }"
for qw(user domain password host version);
# Function API
sub ntlm_domain
{
if (@_)
{
$domain = shift;
}
return $domain;
}
sub ntlm_user
{
if (@_)
{
$user = shift;
}
return $user;
}
sub ntlm_password
{
if (@_)
{
$password = shift;
}
return $password;
}
sub ntlm_reset
{
$state = 0;
}
sub ntlmv2
{
if (@_) {
$ntlm_v2 = shift;
}
return $ntlm_v2;
}
sub ntlm_host {
if (@_) {
$host = shift;
}
return $host;
}
sub ntlm
{
my ($challenge) = @_;
my ($flags, $user_hdr, $domain_hdr,
$u_off, $d_off, $c_info, $lmResp, $ntResp, $lm_hdr,
$nt_hdr, $wks_hdr, $session_hdr, $lm_off, $nt_off,
$wks_off, $s_off, $u_user, $msg1_host, $host_hdr, $u_host);
my $response;
if ($state)
{
$challenge =~ s/^\s*//;
$challenge = decode_base64($challenge);
$c_info = &decode_challenge($challenge);
$u_user = &unicode($user);
if (!$ntlm_v2) {
$domain = substr($challenge, $c_info->{domain}{offset}, $c_info->{domain}{len});
$lmResp = &lmEncrypt($c_info->{data});
$ntResp = &ntEncrypt($c_info->{data});
$flags = pack($msg3_tl, $c_info->{flags});
} else {
$lmResp = &lmv2Encrypt($c_info->{data});
$ntResp = &ntv2Encrypt($c_info->{data}, $c_info->{target_data});
$flags = pack($msg3_tl, $ntlm_v2_msg3_flags);
}
$u_host = &unicode(($host ? $host : $user));
$response = pack($msg3, $ident, 3);
$lm_off = $msg3_hlen;
$nt_off = $lm_off + length($lmResp);
$d_off = $nt_off + length($ntResp);
$u_off = $d_off + length($domain);
$wks_off = $u_off + length($u_user);
$s_off = $wks_off + length($u_host);
$lm_hdr = &hdr($lmResp, $msg3_hlen, $lm_off);
$nt_hdr = &hdr($ntResp, $msg3_hlen, $nt_off);
$domain_hdr = &hdr($domain, $msg3_hlen, $d_off);
$user_hdr = &hdr($u_user, $msg3_hlen, $u_off);
$wks_hdr = &hdr($u_host, $msg3_hlen, $wks_off);
$session_hdr = &hdr("", $msg3_hlen, $s_off);
$response .= $lm_hdr . $nt_hdr . $domain_hdr . $user_hdr .
$wks_hdr . $session_hdr . $flags .
$lmResp . $ntResp . $domain . $u_user . $u_host;
}
else # first response;
{
my $f = $msg1_f;
if (!length $domain) {
$f &= ~NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED;
}
$msg1_host = $user;
if ($ntlm_v2) {
$f &= ~NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED;
$f |= NTLMSSP_NEGOTIATE_NTLM2;
$msg1_host = "";
}
$response = pack($msg1, $ident, 1, $f);
$u_off = $msg1_hlen;
$d_off = $u_off + length($msg1_host);
$host_hdr = &hdr($msg1_host, $msg1_hlen, $u_off);
$domain_hdr = &hdr($domain, $msg1_hlen, $d_off);
$response .= $host_hdr . $domain_hdr . $msg1_host . $domain;
$state = 1;
}
return encode_base64($response, "");
}
sub hdr
{
my ($string, $h_len, $offset) = @_;
my ($res, $len);
$len = length($string);
if ($string)
{
$res = pack($str_hdr, $len, $len, $offset);
}
else
{
$res = pack($str_hdr, 0, 0, $offset - $h_len);
}
return $res;
}
sub decode_challenge
{
my ($challenge) = @_;
my $res;
my (@res, @hdr);
my $original = $challenge;
$res->{buffer} = substr($challenge, $msg2_hlen);
$challenge = substr($challenge, 0, $msg2_hlen);
@res = unpack($msg2, $challenge);
$res->{ident} = $res[0];
$res->{type} = $res[1];
@hdr = unpack($str_hdr, $res[2]);
$res->{domain}{len} = $hdr[0];
$res->{domain}{maxlen} = $hdr[1];
$res->{domain}{offset} = $hdr[2];
$res->{flags} = $res[3];
$res->{data} = $res[4];
$res->{reserved} = $res[5];
$res->{empty_hdr} = $res[6];
@hdr = unpack($str_hdr, $res[6]);
$res->{target}{len} = $hdr[0];
$res->{target}{maxlen} = $hdr[1];
$res->{target}{offset} = $hdr[2];
$res->{target_data} = substr($original, $hdr[2], $hdr[1]);
return $res;
}
sub unicode
{
my ($string) = @_;
my ($reply, $c, $z) = ('');
$z = sprintf "%c", 0;
foreach $c (split //, $string)
{
$reply .= $c . $z;
}
return $reply;
}
sub NTunicode
{
my ($string) = @_;
my ($reply, $c);
foreach $c (map {ord($_)} split(//, $string))
{
$reply .= pack("v", $c);
}
return $reply;
}
sub lmEncrypt
{
my ($data) = @_;
my $p14 = substr($password, 0, 14);
$p14 =~ tr/a-z/A-Z/;
$p14 .= "\0"x(14-length($p14));
my $p21 = E_P16($p14);
$p21 .= "\0"x(21-length($p21));
my $p24 = E_P24($p21, $data);
return $p24;
}
sub ntEncrypt
{
my ($data) = @_;
my $p21 = &E_md4hash;
$p21 .= "\0"x(21-length($p21));
my $p24 = E_P24($p21, $data);
return $p24;
}
sub E_md4hash
{
my $wpwd = &NTunicode($password);
my $p16 = mdfour($wpwd);
return $p16;
}
sub lmv2Encrypt {
my ($data) = @_;
my $u_pass = &unicode($password);
my $ntlm_hash = mdfour($u_pass);
my $u_user = &unicode("\U$user\E");
my $u_domain = &unicode("$domain");
my $concat = $u_user . $u_domain;
my $hmac = Digest::HMAC_MD5->new($ntlm_hash);
$hmac->add($concat);
my $ntlm_v2_hash = $hmac->digest;
# Firefox seems to use this as its random challenge
my $random_challenge = "\0" x 8;
my $concat2 = $data . $random_challenge;
$hmac = Digest::HMAC_MD5->new($ntlm_v2_hash);
$hmac->add(substr($data, 0, 8) . $random_challenge);
my $r = $hmac->digest . $random_challenge;
return $r;
}
sub ntv2Encrypt {
my ($data, $target) = @_;
my $u_pass = &unicode($password);
my $ntlm_hash = mdfour($u_pass);
my $u_user = &unicode("\U$user\E");
my $u_domain = &unicode("$domain");
my $concat = $u_user . $u_domain;
my $hmac = Digest::HMAC_MD5->new($ntlm_hash);
$hmac->add($concat);
my $ntlm_v2_hash = $hmac->digest;
my $zero_long = "\000" x 4;
my $sig = pack("H8", "01010000");
my $time = pack("VV", (time + 11644473600) + 10000000);
my $rand = "\0" x 8;
my $blob = $sig . $zero_long . $time . $rand . $zero_long .
$target . $zero_long;
$concat = $data . $blob;
$hmac = Digest::HMAC_MD5->new($ntlm_v2_hash);
$hmac->add($concat);
my $d = $hmac->digest;
my $r = $d . $blob;
return $r;
}
1;

65
NTLM-1.05/README Normal file
View File

@ -0,0 +1,65 @@
NTLM Authentication Scheme
==========================
This module implements the NTLM authentication mechanism. It can be
used to perform NTLM style authentication for any desired protocol.
The module works well with the Mail::IMAPClient module in the
"authenticate" method, however I had to make a change to that method
for it to work. The following line (2511 in version 2.1.4):
($code) = $o->[DATA] =~ /^\+ (.*)$/ ;
needed to be changed to:
($code) = $o->[DATA] =~ /^\+(.*)$/ ;
as the initial NTLM challenge is empty.
This module also works well with LWP::Authen::Ntlm , allowing LWP::UserAgent
and/or WWW::Mechanise to automate/browse/fetch/etc remote Microsoft Windows
servers running NTLM authentication.
Example use is like this(note the fact that NTLM.pm is NOT explicitly used!):
use WWW::Mechanize;
$mech = WWW::Mechanize->new(keep_alive=>1);
$mech->no_proxy('my.server');
$mech->credentials('my.server:80', '', "my_domain\\my_user", my_pass);
$response = $mech->get( $url );
INSTALLATION
To install this application:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires the MIME::Base64 module, and Digest::HMAC_MD5
COPYRIGHT AND LICENCE
This application is free software. This code is distributed in the hope that
it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You may freely use,
copy and distribute this software as long as all copyright notices, including
this notice, remain intact and that you do not try to claim it as your own or
try to sell it. You may alter the code as long as you send me any diffs (this
will ensure that you have an easier time of it when you upgrade ;).
Parts of this code Copyright (C) 2007 David (Buzz) Bussenschutt.
<davidbuzz@gmail.com>
Perl port of this code is Copyright (C) 2001 Mark Bush.
<Mark.Bush@bushnet.demon.co.uk>
The code is originally based on fetchmail code which is Copyright (C) 1997 Eric
S. Raymond.
Fetchmail uses SMB/Netbios code from samba which is Copyright (C)
Andrew Tridgell 1992-1998 with modifications from Jeremy Allison.

View File

View File

View File

View File

@ -0,0 +1,499 @@
#!/usr/local/bin/perl
package Authen::NTLM;
use strict;
use Authen::NTLM::DES;
use Authen::NTLM::MD4;
use MIME::Base64;
use Digest::HMAC_MD5;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
=head1 NAME
Authen::NTLM - An NTLM authentication module
=head1 SYNOPSIS
use Mail::IMAPClient;
use Authen::NTLM;
my $imap = Mail::IMAPClient->new(Server=>'imaphost');
ntlm_user($username);
ntlm_password($password);
$imap->authenticate("NTLM", Authen::NTLM::ntlm);
:
$imap->logout;
ntlm_reset;
:
or
ntlmv2(1);
ntlm_user($username);
ntlm_host($host);
ntlm_password($password);
:
or
my $ntlm = Authen::NTLM-> new(
host => $host,
user => $username,
domain => $domain,
password => $password,
version => 1,
);
$ntlm-> challenge;
:
$ntlm-> challenge($challenge);
=head1 DESCRIPTION
This module provides methods to use NTLM authentication. It can
be used as an authenticate method with the Mail::IMAPClient module
to perform the challenge/response mechanism for NTLM connections
or it can be used on its own for NTLM authentication with other
protocols (eg. HTTP).
The implementation is a direct port of the code from F<fetchmail>
which, itself, has based its NTLM implementation on F<samba>. As
such, this code is not especially efficient, however it will still
take a fraction of a second to negotiate a login on a PII which is
likely to be good enough for most situations.
=head2 FUNCTIONS
=over 4
=item ntlm_domain()
Set the domain to use in the NTLM authentication messages.
Returns the new domain. Without an argument, this function
returns the current domain entry.
=item ntlm_user()
Set the username to use in the NTLM authentication messages.
Returns the new username. Without an argument, this function
returns the current username entry.
=item ntlm_password()
Set the password to use in the NTLM authentication messages.
Returns the new password. Without an argument, this function
returns the current password entry.
=item ntlm_reset()
Resets the NTLM challenge/response state machine so that the next
call to C<ntlm()> will produce an initial connect message.
=item ntlm()
Generate a reply to a challenge. The NTLM protocol involves an
initial empty challenge from the server requiring a message
response containing the username and domain (which may be empty).
The first call to C<ntlm()> generates this first message ignoring
any arguments.
The second time it is called, it is assumed that the argument is
the challenge string sent from the server. This will contain 8
bytes of data which are used in the DES functions to generate the
response authentication strings. The result of the call is the
final authentication string.
If C<ntlm_reset()> is called, then the next call to C<ntlm()> will
start the process again allowing multiple authentications within
an application.
=item ntlmv2()
Use NTLM v2 authentication.
=back
=head2 OBJECT API
=over
=item new %options
Creates an object that accepts the following options: C<user>, C<host>,
C<domain>, C<password>, C<version>.
=item challenge [$challenge]
If C<$challenge> is not supplied, first-stage challenge string is generated.
Otherwise, the third-stage challenge is generated, where C<$challenge> is
assumed to be extracted from the second stage of NTLM exchange. The result of
the call is the final authentication string.
=back
=head1 AUTHOR
David (Buzz) Bussenschutt <davidbuzz@gmail.com> - current maintainer
Dmitry Karasik <dmitry@karasik.eu.org> - nice ntlmv2 patch, OO extensions.
Andrew Hobson <ahobson@infloop.com> - initial ntlmv2 code
Mark Bush <Mark.Bush@bushnet.demon.co.uk> - perl port
Eric S. Raymond - author of fetchmail
Andrew Tridgell and Jeremy Allison for SMB/Netbios code
=head1 SEE ALSO
L<perl>, L<Mail::IMAPClient>, L<LWP::Authen::Ntlm>
=head1 HISTORY
1.05 - add OO interface by Dmitry Karasik
1.04 - implementation of NTLMv2 by Andrew Hobson/Dmitry Karasik
1.03 - fixes long-standing 1 line bug L<http://rt.cpan.org/Public/Bug/Display.html?id=9521> - released by David Bussenschutt 9th Aug 2007
1.02 - released by Mark Bush 29th Oct 2001
=cut
$VERSION = "1.05";
@ISA = qw(Exporter);
@EXPORT = qw(ntlm ntlm_domain ntlm_user ntlm_password ntlm_reset ntlm_host ntlmv2);
my $domain = "";
my $user = "";
my $password = "";
my $str_hdr = "vvV";
my $hdr_len = 8;
my $ident = "NTLMSSP";
my $msg1_f = 0x0000b207;
my $msg1 = "Z8VV";
my $msg1_hlen = 16 + ($hdr_len*2);
my $msg2 = "Z8Va${hdr_len}Va8a8a${hdr_len}";
my $msg2_hlen = 12 + $hdr_len + 20 + $hdr_len;
my $msg3 = "Z8V";
my $msg3_tl = "V";
my $msg3_hlen = 12 + ($hdr_len*6) + 4;
my $state = 0;
my $host = "";
my $ntlm_v2 = 0;
my $ntlm_v2_msg3_flags = 0x88205;
# Domain Name supplied on negotiate
use constant NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED => 0x00001000;
# Workstation Name supplied on negotiate
use constant NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED => 0x00002000;
# Try to use NTLMv2
use constant NTLMSSP_NEGOTIATE_NTLM2 => 0x00080000;
# Object API
sub new
{
my ( $class, %opt) = @_;
for (qw(domain user password host)) {
$opt{$_} = "" unless defined $opt{$_};
}
$opt{version} ||= 1;
return bless { %opt }, $class;
}
sub challenge
{
my ( $self, $challenge) = @_;
$state = defined $challenge;
($user,$domain,$password,$host) = @{$self}{qw(user domain password host)};
$ntlm_v2 = ($self-> {version} > 1) ? 1 : 0;
return ntlm($challenge);
}
eval "sub $_ { \$#_ ? \$_[0]->{$_} = \$_[1] : \$_[0]->{$_} }"
for qw(user domain password host version);
# Function API
sub ntlm_domain
{
if (@_)
{
$domain = shift;
}
return $domain;
}
sub ntlm_user
{
if (@_)
{
$user = shift;
}
return $user;
}
sub ntlm_password
{
if (@_)
{
$password = shift;
}
return $password;
}
sub ntlm_reset
{
$state = 0;
}
sub ntlmv2
{
if (@_) {
$ntlm_v2 = shift;
}
return $ntlm_v2;
}
sub ntlm_host {
if (@_) {
$host = shift;
}
return $host;
}
sub ntlm
{
my ($challenge) = @_;
my ($flags, $user_hdr, $domain_hdr,
$u_off, $d_off, $c_info, $lmResp, $ntResp, $lm_hdr,
$nt_hdr, $wks_hdr, $session_hdr, $lm_off, $nt_off,
$wks_off, $s_off, $u_user, $msg1_host, $host_hdr, $u_host);
my $response;
if ($state)
{
$challenge =~ s/^\s*//;
$challenge = decode_base64($challenge);
$c_info = &decode_challenge($challenge);
$u_user = &unicode($user);
if (!$ntlm_v2) {
$domain = substr($challenge, $c_info->{domain}{offset}, $c_info->{domain}{len});
$lmResp = &lmEncrypt($c_info->{data});
$ntResp = &ntEncrypt($c_info->{data});
$flags = pack($msg3_tl, $c_info->{flags});
} else {
$lmResp = &lmv2Encrypt($c_info->{data});
$ntResp = &ntv2Encrypt($c_info->{data}, $c_info->{target_data});
$flags = pack($msg3_tl, $ntlm_v2_msg3_flags);
}
$u_host = &unicode(($host ? $host : $user));
$response = pack($msg3, $ident, 3);
$lm_off = $msg3_hlen;
$nt_off = $lm_off + length($lmResp);
$d_off = $nt_off + length($ntResp);
$u_off = $d_off + length($domain);
$wks_off = $u_off + length($u_user);
$s_off = $wks_off + length($u_host);
$lm_hdr = &hdr($lmResp, $msg3_hlen, $lm_off);
$nt_hdr = &hdr($ntResp, $msg3_hlen, $nt_off);
$domain_hdr = &hdr($domain, $msg3_hlen, $d_off);
$user_hdr = &hdr($u_user, $msg3_hlen, $u_off);
$wks_hdr = &hdr($u_host, $msg3_hlen, $wks_off);
$session_hdr = &hdr("", $msg3_hlen, $s_off);
$response .= $lm_hdr . $nt_hdr . $domain_hdr . $user_hdr .
$wks_hdr . $session_hdr . $flags .
$lmResp . $ntResp . $domain . $u_user . $u_host;
}
else # first response;
{
my $f = $msg1_f;
if (!length $domain) {
$f &= ~NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED;
}
$msg1_host = $user;
if ($ntlm_v2) {
$f &= ~NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED;
$f |= NTLMSSP_NEGOTIATE_NTLM2;
$msg1_host = "";
}
$response = pack($msg1, $ident, 1, $f);
$u_off = $msg1_hlen;
$d_off = $u_off + length($msg1_host);
$host_hdr = &hdr($msg1_host, $msg1_hlen, $u_off);
$domain_hdr = &hdr($domain, $msg1_hlen, $d_off);
$response .= $host_hdr . $domain_hdr . $msg1_host . $domain;
$state = 1;
}
return encode_base64($response, "");
}
sub hdr
{
my ($string, $h_len, $offset) = @_;
my ($res, $len);
$len = length($string);
if ($string)
{
$res = pack($str_hdr, $len, $len, $offset);
}
else
{
$res = pack($str_hdr, 0, 0, $offset - $h_len);
}
return $res;
}
sub decode_challenge
{
my ($challenge) = @_;
my $res;
my (@res, @hdr);
my $original = $challenge;
$res->{buffer} = substr($challenge, $msg2_hlen);
$challenge = substr($challenge, 0, $msg2_hlen);
@res = unpack($msg2, $challenge);
$res->{ident} = $res[0];
$res->{type} = $res[1];
@hdr = unpack($str_hdr, $res[2]);
$res->{domain}{len} = $hdr[0];
$res->{domain}{maxlen} = $hdr[1];
$res->{domain}{offset} = $hdr[2];
$res->{flags} = $res[3];
$res->{data} = $res[4];
$res->{reserved} = $res[5];
$res->{empty_hdr} = $res[6];
@hdr = unpack($str_hdr, $res[6]);
$res->{target}{len} = $hdr[0];
$res->{target}{maxlen} = $hdr[1];
$res->{target}{offset} = $hdr[2];
$res->{target_data} = substr($original, $hdr[2], $hdr[1]);
return $res;
}
sub unicode
{
my ($string) = @_;
my ($reply, $c, $z) = ('');
$z = sprintf "%c", 0;
foreach $c (split //, $string)
{
$reply .= $c . $z;
}
return $reply;
}
sub NTunicode
{
my ($string) = @_;
my ($reply, $c);
foreach $c (map {ord($_)} split(//, $string))
{
$reply .= pack("v", $c);
}
return $reply;
}
sub lmEncrypt
{
my ($data) = @_;
my $p14 = substr($password, 0, 14);
$p14 =~ tr/a-z/A-Z/;
$p14 .= "\0"x(14-length($p14));
my $p21 = E_P16($p14);
$p21 .= "\0"x(21-length($p21));
my $p24 = E_P24($p21, $data);
return $p24;
}
sub ntEncrypt
{
my ($data) = @_;
my $p21 = &E_md4hash;
$p21 .= "\0"x(21-length($p21));
my $p24 = E_P24($p21, $data);
return $p24;
}
sub E_md4hash
{
my $wpwd = &NTunicode($password);
my $p16 = mdfour($wpwd);
return $p16;
}
sub lmv2Encrypt {
my ($data) = @_;
my $u_pass = &unicode($password);
my $ntlm_hash = mdfour($u_pass);
my $u_user = &unicode("\U$user\E");
my $u_domain = &unicode("$domain");
my $concat = $u_user . $u_domain;
my $hmac = Digest::HMAC_MD5->new($ntlm_hash);
$hmac->add($concat);
my $ntlm_v2_hash = $hmac->digest;
# Firefox seems to use this as its random challenge
my $random_challenge = "\0" x 8;
my $concat2 = $data . $random_challenge;
$hmac = Digest::HMAC_MD5->new($ntlm_v2_hash);
$hmac->add(substr($data, 0, 8) . $random_challenge);
my $r = $hmac->digest . $random_challenge;
return $r;
}
sub ntv2Encrypt {
my ($data, $target) = @_;
my $u_pass = &unicode($password);
my $ntlm_hash = mdfour($u_pass);
my $u_user = &unicode("\U$user\E");
my $u_domain = &unicode("$domain");
my $concat = $u_user . $u_domain;
my $hmac = Digest::HMAC_MD5->new($ntlm_hash);
$hmac->add($concat);
my $ntlm_v2_hash = $hmac->digest;
my $zero_long = "\000" x 4;
my $sig = pack("H8", "01010000");
my $time = pack("VV", (time + 11644473600) + 10000000);
my $rand = "\0" x 8;
my $blob = $sig . $zero_long . $time . $rand . $zero_long .
$target . $zero_long;
$concat = $data . $blob;
$hmac = Digest::HMAC_MD5->new($ntlm_v2_hash);
$hmac->add($concat);
my $d = $hmac->digest;
my $r = $d . $blob;
return $r;
}
1;

View File

View File

@ -0,0 +1,294 @@
#!/usr/local/bin/perl
#
# This is an implementation of part of the DES specification. According
# to the code this is ported from, this code does NOT enable 2-way
# encryption and is, hence, not a cypher and does not appear to come
# under any export restrictions on such.
#
package Authen::NTLM::DES;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
$VERSION = "1.02";
@ISA = qw(Exporter);
@EXPORT = qw(E_P16 E_P24);
my ($loop, $loop2);
$loop = 0;
$loop2 = 0;
my $perm1 = [57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15,
7, 62, 54, 46, 38, 30, 22,
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4];
my $perm2 = [14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55,
30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53,
46, 42, 50, 36, 29, 32];
my $perm3 = [58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,
64, 56, 48, 40, 32, 24, 16, 8,
57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7];
my $perm4 = [32, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13,
12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21,
20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1];
my $perm5 = [16, 7, 20, 21, 29, 12, 28, 17,
1, 15, 23, 26, 5, 18, 31, 10,
2, 8, 24, 14, 32, 27, 3, 9,
19, 13, 30, 6, 22, 11, 4, 25];
my $perm6 = [40, 8, 48, 16, 56, 24, 64, 32,
39, 7, 47, 15, 55, 23, 63, 31,
38, 6, 46, 14, 54, 22, 62, 30,
37, 5, 45, 13, 53, 21, 61, 29,
36, 4, 44, 12, 52, 20, 60, 28,
35, 3, 43, 11, 51, 19, 59, 27,
34, 2, 42, 10, 50, 18, 58, 26,
33, 1, 41, 9, 49, 17, 57, 25];
my $sc = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];
my $sbox = [
[
[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7],
[0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8],
[4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0],
[15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13]
],
[
[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10],
[3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5],
[0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15],
[13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9]
],
[
[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8],
[13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1],
[13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7],
[1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12]
],
[
[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15],
[13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9],
[10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4],
[3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14]
],
[
[2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9],
[14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6],
[4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14],
[11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3]
],
[
[12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11],
[10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8],
[9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6],
[4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13]
],
[
[4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1],
[13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6],
[1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2],
[6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12]
],
[
[13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7],
[1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2],
[7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8],
[2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11]
]
];
sub E_P16
{
my ($p14) = @_;
my $sp8 = [0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25];
my $p7 = substr($p14, 0, 7);
my $p16 = smbhash($sp8, $p7);
$p7 = substr($p14, 7, 7);
$p16 .= smbhash($sp8, $p7);
return $p16;
}
sub E_P24
{
my ($p21, $c8_str) = @_;
my @c8 = map {ord($_)} split(//, $c8_str);
my $p24 = smbhash(\@c8, substr($p21, 0, 7));
$p24 .= smbhash(\@c8, substr($p21, 7, 7));
$p24 .= smbhash(\@c8, substr($p21, 14, 7));
}
sub permute
{
my ($out, $in, $p, $n) = @_;
my $i;
foreach $i (0..($n-1))
{
$out->[$i] = $in->[$p->[$i]-1];
}
}
sub lshift
{
my ($d, $count, $n) = @_;
my (@out, $i);
foreach $i (0..($n-1))
{
$out[$i] = $d->[($i+$count)%$n];
}
foreach $i (0..($n-1))
{
$d->[$i] = $out[$i];
}
}
sub xor
{
my ($out, $in1, $in2, $n) = @_;
my $i;
foreach $i (0..($n-1))
{
$out->[$i] = $in1->[$i]^$in2->[$i];
}
}
sub dohash
{
my ($out, $in, $key) = @_;
my ($i, $j, $k, @pk1, @c, @d, @cd,
@ki, @pd1, @l, @r, @rl);
&permute(\@pk1, $key, $perm1, 56);
foreach $i (0..27)
{
$c[$i] = $pk1[$i];
$d[$i] = $pk1[$i+28];
}
foreach $i (0..15)
{
my @array;
&lshift(\@c, $sc->[$i], 28);
&lshift(\@d, $sc->[$i], 28);
@cd = (@c, @d);
&permute(\@array, \@cd, $perm2, 48);
$ki[$i] = \@array;
}
&permute(\@pd1, $in, $perm3, 64);
foreach $j (0..31)
{
$l[$j] = $pd1[$j];
$r[$j] = $pd1[$j+32];
}
foreach $i (0..15)
{
local (@er, @erk, @b, @cb, @pcb, @r2);
permute(\@er, \@r, $perm4, 48);
&xor(\@erk, \@er, $ki[$i], 48);
foreach $j (0..7)
{
foreach $k (0..5)
{
$b[$j][$k] = $erk[$j*6+$k];
}
}
foreach $j (0..7)
{
local ($m, $n);
$m = ($b[$j][0]<<1) | $b[$j][5];
$n = ($b[$j][1]<<3) | ($b[$j][2]<<2) | ($b[$j][3]<<1) | $b[$j][4];
foreach $k (0..3)
{
$b[$j][$k] = ($sbox->[$j][$m][$n] & (1<<(3-$k)))? 1: 0;
}
}
foreach $j (0..7)
{
foreach $k (0..3)
{
$cb[$j*4+$k] = $b[$j][$k];
}
}
&permute(\@pcb, \@cb, $perm5, 32);
&xor(\@r2, \@l, \@pcb, 32);
foreach $j (0..31)
{
$l[$j] = $r[$j];
$r[$j] = $r2[$j];
}
}
@rl = (@r, @l);
&permute($out, \@rl, $perm6, 64);
}
sub str_to_key
{
my ($str) = @_;
my $i;
my @key;
my $out;
my @str = map {ord($_)} split(//, $str);
$key[0] = $str[0]>>1;
$key[1] = (($str[0]&0x01)<<6) | ($str[1]>>2);
$key[2] = (($str[1]&0x03)<<5) | ($str[2]>>3);
$key[3] = (($str[2]&0x07)<<4) | ($str[3]>>4);
$key[4] = (($str[3]&0x0f)<<3) | ($str[4]>>5);
$key[5] = (($str[4]&0x1f)<<2) | ($str[5]>>6);
$key[6] = (($str[5]&0x3f)<<1) | ($str[6]>>7);
$key[7] = $str[6]&0x7f;
foreach $i (0..7)
{
$key[$i] = 0xff&($key[$i]<<1);
}
return \@key;
}
sub smbhash
{
my ($in, $key) = @_;
my $key2 = &str_to_key($key);
my ($i, $div, $mod, @in, @outb, @inb, @keyb, @out);
foreach $i (0..63)
{
$div = int($i/8); $mod = $i%8;
$inb[$i] = ($in->[$div] & (1<<(7-($mod))))? 1: 0;
$keyb[$i] = ($key2->[$div] & (1<<(7-($mod))))? 1: 0;
$outb[$i] = 0;
}
&dohash(\@outb, \@inb, \@keyb);
foreach $i (0..7)
{
$out[$i] = 0;
}
foreach $i (0..63)
{
$out[int($i/8)] |= (1<<(7-($i%8))) if ($outb[$i]);
}
my $out = pack("C8", @out);
return $out;
}
1;

View File

@ -0,0 +1,197 @@
#!/usr/local/bin/perl
#
# This is a partial implentation of the MD4 checksum code.
#
# NOTE
#
# The function &add() in this module is required as we need to be
# able to add 32bit integers ignoring overflow. The C code this is
# based on does this because it uses the underlying hardware to
# perform the required addition however we need to be more careful
# as Perl will overflow an int and produce a result of 0xffffffff
# which is not very useful. The &add() function splits its arguments
# into two shorts and adds these carrying overflow from the low short
# to the high short and ignoring carry from the high short. Not
# exactly efficient, but it works and is fast enough for the purposes
# of this implementation
#
package Authen::NTLM::MD4;
use vars qw($VERSION @ISA @EXPORT);
require Exporter;
$VERSION = "1.02";
@ISA = qw(Exporter);
@EXPORT = qw(mdfour);
my ($A, $B, $C, $D);
my (@X, $M);
sub mdfour
{
my ($in) = @_;
my ($i, $pos);
my $len = length($in);
my $b = $len * 8;
$in .= "\0"x128;
$A = 0x67452301;
$B = 0xefcdab89;
$C = 0x98badcfe;
$D = 0x10325476;
$pos = 0;
while ($len > 64)
{
&copy64(substr($in, $pos, 64));
&mdfour64;
$pos += 64;
$len -= 64;
}
my $buf = substr($in, $pos, $len);
$buf .= sprintf "%c", 0x80;
if ($len <= 55)
{
$buf .= "\0"x(55-$len);
$buf .= pack("V", $b);
$buf .= "\0"x4;
&copy64($buf);
&mdfour64;
}
else
{
$buf .= "\0"x(120-$len);
$buf .= pack("V", $b);
$buf .= "\0"x4;
&copy64(substr($buf, 0, 64));
&mdfour64;
&copy64(substr($buf, 64, 64));
&mdfour64;
}
my $out = pack("VVVV", $A, $B, $C, $D);
return $out;
}
sub F
{
my ($X, $Y, $Z) = @_;
my $res = ($X&$Y) | ((~$X)&$Z);
return $res;
}
sub G
{
my ($X, $Y, $Z) = @_;
return ($X&$Y) | ($X&$Z) | ($Y&$Z);
}
sub H
{
my ($X, $Y, $Z) = @_;
return $X^$Y^$Z;
}
sub lshift
{
my ($x, $s) = @_;
$x &= 0xffffffff;
return (($x<<$s)&0xffffffff) | ($x>>(32-$s));
}
sub ROUND1
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &F($b, $c, $d), $X[$k]);
return &lshift($e, $s);
}
sub ROUND2
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &G($b, $c, $d), $X[$k], 0x5a827999);
return &lshift($e, $s);
}
sub ROUND3
{
my ($a, $b, $c, $d, $k, $s) = @_;
my $e = &add($a, &H($b, $c, $d), $X[$k], 0x6ed9eba1);
return &lshift($e, $s);
}
sub mdfour64
{
my ($i, $AA, $BB, $CC, $DD);
@X = unpack("N16", $M);
$AA = $A;
$BB = $B;
$CC = $C;
$DD = $D;
$A = &ROUND1($A,$B,$C,$D, 0, 3); $D = &ROUND1($D,$A,$B,$C, 1, 7);
$C = &ROUND1($C,$D,$A,$B, 2,11); $B = &ROUND1($B,$C,$D,$A, 3,19);
$A = &ROUND1($A,$B,$C,$D, 4, 3); $D = &ROUND1($D,$A,$B,$C, 5, 7);
$C = &ROUND1($C,$D,$A,$B, 6,11); $B = &ROUND1($B,$C,$D,$A, 7,19);
$A = &ROUND1($A,$B,$C,$D, 8, 3); $D = &ROUND1($D,$A,$B,$C, 9, 7);
$C = &ROUND1($C,$D,$A,$B,10,11); $B = &ROUND1($B,$C,$D,$A,11,19);
$A = &ROUND1($A,$B,$C,$D,12, 3); $D = &ROUND1($D,$A,$B,$C,13, 7);
$C = &ROUND1($C,$D,$A,$B,14,11); $B = &ROUND1($B,$C,$D,$A,15,19);
$A = &ROUND2($A,$B,$C,$D, 0, 3); $D = &ROUND2($D,$A,$B,$C, 4, 5);
$C = &ROUND2($C,$D,$A,$B, 8, 9); $B = &ROUND2($B,$C,$D,$A,12,13);
$A = &ROUND2($A,$B,$C,$D, 1, 3); $D = &ROUND2($D,$A,$B,$C, 5, 5);
$C = &ROUND2($C,$D,$A,$B, 9, 9); $B = &ROUND2($B,$C,$D,$A,13,13);
$A = &ROUND2($A,$B,$C,$D, 2, 3); $D = &ROUND2($D,$A,$B,$C, 6, 5);
$C = &ROUND2($C,$D,$A,$B,10, 9); $B = &ROUND2($B,$C,$D,$A,14,13);
$A = &ROUND2($A,$B,$C,$D, 3, 3); $D = &ROUND2($D,$A,$B,$C, 7, 5);
$C = &ROUND2($C,$D,$A,$B,11, 9); $B = &ROUND2($B,$C,$D,$A,15,13);
$A = &ROUND3($A,$B,$C,$D, 0, 3); $D = &ROUND3($D,$A,$B,$C, 8, 9);
$C = &ROUND3($C,$D,$A,$B, 4,11); $B = &ROUND3($B,$C,$D,$A,12,15);
$A = &ROUND3($A,$B,$C,$D, 2, 3); $D = &ROUND3($D,$A,$B,$C,10, 9);
$C = &ROUND3($C,$D,$A,$B, 6,11); $B = &ROUND3($B,$C,$D,$A,14,15);
$A = &ROUND3($A,$B,$C,$D, 1, 3); $D = &ROUND3($D,$A,$B,$C, 9, 9);
$C = &ROUND3($C,$D,$A,$B, 5,11); $B = &ROUND3($B,$C,$D,$A,13,15);
$A = &ROUND3($A,$B,$C,$D, 3, 3); $D = &ROUND3($D,$A,$B,$C,11, 9);
$C = &ROUND3($C,$D,$A,$B, 7,11); $B = &ROUND3($B,$C,$D,$A,15,15);
$A = &add($A, $AA); $B = &add($B, $BB);
$C = &add($C, $CC); $D = &add($D, $DD);
$A &= 0xffffffff; $B &= 0xffffffff;
$C &= 0xffffffff; $D &= 0xffffffff;
map {$_ = 0} @X;
}
sub copy64
{
my ($in) = @_;
$M = pack("V16", unpack("N16", $in));
}
# see note at top of this file about this function
sub add
{
my (@nums) = @_;
my ($r_low, $r_high, $n_low, $l_high);
my $num;
$r_low = $r_high = 0;
foreach $num (@nums)
{
$n_low = $num & 0xffff;
$n_high = ($num&0xffff0000)>>16;
$r_low += $n_low;
($r_low&0xf0000) && $r_high++;
$r_low &= 0xffff;
$r_high += $n_high;
$r_high &= 0xffff;
}
return ($r_high<<16)|$r_low;
}
1;

View File

View File

View File

@ -0,0 +1,281 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "NTLM 3pm"
.TH NTLM 3pm "2008-06-18" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
Authen::NTLM \- An NTLM authentication module
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 10
\& use Mail::IMAPClient;
\& use Authen::NTLM;
\& my $imap = Mail::IMAPClient\->new(Server=>\(aqimaphost\(aq);
\& ntlm_user($username);
\& ntlm_password($password);
\& $imap\->authenticate("NTLM", Authen::NTLM::ntlm);
\& :
\& $imap\->logout;
\& ntlm_reset;
\& :
.Ve
.PP
or
.PP
.Vb 5
\& ntlmv2(1);
\& ntlm_user($username);
\& ntlm_host($host);
\& ntlm_password($password);
\& :
.Ve
.PP
or
.PP
.Vb 10
\& my $ntlm = Authen::NTLM\-> new(
\& host => $host,
\& user => $username,
\& domain => $domain,
\& password => $password,
\& version => 1,
\& );
\& $ntlm\-> challenge;
\& :
\& $ntlm\-> challenge($challenge);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.Vb 5
\& This module provides methods to use NTLM authentication. It can
\& be used as an authenticate method with the Mail::IMAPClient module
\& to perform the challenge/response mechanism for NTLM connections
\& or it can be used on its own for NTLM authentication with other
\& protocols (eg. HTTP).
.Ve
.PP
.Vb 5
\& The implementation is a direct port of the code from F<fetchmail>
\& which, itself, has based its NTLM implementation on F<samba>. As
\& such, this code is not especially efficient, however it will still
\& take a fraction of a second to negotiate a login on a PII which is
\& likely to be good enough for most situations.
.Ve
.Sh "\s-1FUNCTIONS\s0"
.IX Subsection "FUNCTIONS"
.IP "\fIntlm_domain()\fR" 4
.IX Item "ntlm_domain()"
.Vb 3
\& Set the domain to use in the NTLM authentication messages.
\& Returns the new domain. Without an argument, this function
\& returns the current domain entry.
.Ve
.IP "\fIntlm_user()\fR" 4
.IX Item "ntlm_user()"
.Vb 3
\& Set the username to use in the NTLM authentication messages.
\& Returns the new username. Without an argument, this function
\& returns the current username entry.
.Ve
.IP "\fIntlm_password()\fR" 4
.IX Item "ntlm_password()"
.Vb 3
\& Set the password to use in the NTLM authentication messages.
\& Returns the new password. Without an argument, this function
\& returns the current password entry.
.Ve
.IP "\fIntlm_reset()\fR" 4
.IX Item "ntlm_reset()"
.Vb 2
\& Resets the NTLM challenge/response state machine so that the next
\& call to C<ntlm()> will produce an initial connect message.
.Ve
.IP "\fIntlm()\fR" 4
.IX Item "ntlm()"
.Vb 5
\& Generate a reply to a challenge. The NTLM protocol involves an
\& initial empty challenge from the server requiring a message
\& response containing the username and domain (which may be empty).
\& The first call to C<ntlm()> generates this first message ignoring
\& any arguments.
.Ve
.Sp
.Vb 5
\& The second time it is called, it is assumed that the argument is
\& the challenge string sent from the server. This will contain 8
\& bytes of data which are used in the DES functions to generate the
\& response authentication strings. The result of the call is the
\& final authentication string.
.Ve
.Sp
.Vb 3
\& If C<ntlm_reset()> is called, then the next call to C<ntlm()> will
\& start the process again allowing multiple authentications within
\& an application.
.Ve
.IP "\fIntlmv2()\fR" 4
.IX Item "ntlmv2()"
.Vb 1
\& Use NTLM v2 authentication.
.Ve
.Sh "\s-1OBJECT\s0 \s-1API\s0"
.IX Subsection "OBJECT API"
.ie n .IP "new %options" 4
.el .IP "new \f(CW%options\fR" 4
.IX Item "new %options"
Creates an object that accepts the following options: \f(CW\*(C`user\*(C'\fR, \f(CW\*(C`host\*(C'\fR,
\&\f(CW\*(C`domain\*(C'\fR, \f(CW\*(C`password\*(C'\fR, \f(CW\*(C`version\*(C'\fR.
.IP "challenge [$challenge]" 4
.IX Item "challenge [$challenge]"
If \f(CW$challenge\fR is not supplied, first-stage challenge string is generated.
Otherwise, the third-stage challenge is generated, where \f(CW$challenge\fR is
assumed to be extracted from the second stage of \s-1NTLM\s0 exchange. The result of
the call is the final authentication string.
.SH "AUTHOR"
.IX Header "AUTHOR"
.Vb 6
\& David (Buzz) Bussenschutt <davidbuzz@gmail.com> \- current maintainer
\& Dmitry Karasik <dmitry@karasik.eu.org> \- nice ntlmv2 patch, OO extensions.
\& Andrew Hobson <ahobson@infloop.com> \- initial ntlmv2 code
\& Mark Bush <Mark.Bush@bushnet.demon.co.uk> \- perl port
\& Eric S. Raymond \- author of fetchmail
\& Andrew Tridgell and Jeremy Allison for SMB/Netbios code
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
perl, Mail::IMAPClient, LWP::Authen::Ntlm
.SH "HISTORY"
.IX Header "HISTORY"
.Vb 4
\& 1.05 \- add OO interface by Dmitry Karasik
\& 1.04 \- implementation of NTLMv2 by Andrew Hobson/Dmitry Karasik
\& 1.03 \- fixes long\-standing 1 line bug L<http://rt.cpan.org/Public/Bug/Display.html?id=9521> \- released by David Bussenschutt 9th Aug 2007
\& 1.02 \- released by Mark Bush 29th Oct 2001
.Ve

View File

0
NTLM-1.05/pm_to_blib Normal file
View File

9
NTLM-1.05/t/01_load.t Normal file
View File

@ -0,0 +1,9 @@
#! /usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use_ok('Authen::NTLM');

48
NTLM-1.05/t/02_ntlm.t Normal file
View File

@ -0,0 +1,48 @@
#! /usr/bin/perl
use strict;
use warnings;
use Test::More tests => 12;
use Authen::NTLM;
use MIME::Base64;
my $user = "test";
my $domain = "test";
my $passwd = "test";
my $msg1 = "TlRMTVNTUAABAAAAB7IAAAQABAAgAAAABAAEACQAAAB0ZXN0dGVzdA==";
my $challenge = "TlRMTVNTUAACAAAABAAEADAAAAAFggEAQUJDREVGR0gAAAAAAAAAAAAAAAAAAAAAdGVzdA==";
my $msg2 = "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAQABABwAAAACAAIAHQAAAAIAAgAfAAAAAAAAABEAAAABYIBAJ7/TlMo4HLg0gOk6iKq4bv2vk35ozHEKKoqG8nTkQ5S82zyqpJzxPDJHUMynnKsBHRlc3R0AGUAcwB0AHQAZQBzAHQA";
# 2: username
ok(ntlm_user($user) eq $user, 'ntlm_user');
# 3: domain
ok(ntlm_domain($domain) eq $domain, 'ntlm_domain');
# 4: password
ok(ntlm_password($passwd) eq $passwd, 'ntlm_password');
# 5: initial message
my $reply1 = ntlm();
ok($reply1 eq $msg1, 'reply 1');
# 6-12: decode challenge - not normally user accessed
my $c = &Authen::NTLM::decode_challenge(decode_base64($challenge));
ok($c->{ident} eq "NTLMSSP", 'header');
ok($c->{type} == 2, 'type');
ok($c->{flags} == 0x00018205, 'flags');
ok($c->{data} eq "ABCDEFGH", 'data');
ok($c->{domain}{len} == 4, 'domain length');
ok($c->{domain}{offset} == 48, 'domain offset');
ok($c->{buffer} eq "test", 'contents');
# 13: challenge response
my $reply2 = ntlm($challenge);
ok($reply2 eq $msg2, 'reply 2');

54
NTLM-1.05/t/03_oo.t Normal file
View File

@ -0,0 +1,54 @@
#! /usr/bin/perl
use strict;
use warnings;
use Test::More tests => 12;
use Authen::NTLM;
use MIME::Base64;
my $user = "test";
my $domain = "test";
my $passwd = "test";
my $msg1 = "TlRMTVNTUAABAAAAB7IAAAQABAAgAAAABAAEACQAAAB0ZXN0dGVzdA==";
my $challenge = "TlRMTVNTUAACAAAABAAEADAAAAAFggEAQUJDREVGR0gAAAAAAAAAAAAAAAAAAAAAdGVzdA==";
my $msg2 = "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAQABABwAAAACAAIAHQAAAAIAAgAfAAAAAAAAABEAAAABYIBAJ7/TlMo4HLg0gOk6iKq4bv2vk35ozHEKKoqG8nTkQ5S82zyqpJzxPDJHUMynnKsBHRlc3R0AGUAcwB0AHQAZQBzAHQA";
my $a = Authen::NTLM-> new(
user => $user,
domain => $domain,
password => $passwd,
);
# 2: username
ok($a->user eq $user, 'ntlm_user');
# 3: domain
ok($a->domain eq $domain, 'ntlm_domain');
# 4: password
ok($a->password eq $passwd, 'ntlm_password');
# 5: initial message
my $reply1 = $a-> challenge;
ok($reply1 eq $msg1, 'reply 1');
# 6-12: decode challenge - not normally user accessed
my $c = &Authen::NTLM::decode_challenge(decode_base64($challenge));
ok($c->{ident} eq "NTLMSSP", 'header');
ok($c->{type} == 2, 'type');
ok($c->{flags} == 0x00018205, 'flags');
ok($c->{data} eq "ABCDEFGH", 'data');
ok($c->{domain}{len} == 4, 'domain length');
ok($c->{domain}{offset} == 48, 'domain offset');
ok($c->{buffer} eq "test", 'contents');
# 13: challenge response
my $reply2 = $a-> challenge($challenge);
ok($reply2 eq $msg2, 'reply 2');

44
NTLM-1.05/t/04_v2.t Normal file
View File

@ -0,0 +1,44 @@
#! /usr/bin/perl
BEGIN { *CORE::GLOBAL::time = sub { CORE::time } };
use strict;
use warnings;
use Test::More tests => 9;
use Authen::NTLM;
use MIME::Base64;
my $user = "test";
my $domain = "test";
my $passwd = "test";
my $msg1 = "TlRMTVNTUAABAAAAB5IIAAAAAAAAAAAABAAEACAAAAB0ZXN0";
my $challenge = "TlRMTVNTUAACAAAABAAEADgAAAAFgokCQUJDREVGR0gAAAAAAAAAAAQABAA8AAAAdGVzdHRlc3R0ZXN0";
my $msg2 = "TlRMTVNTUAADAAAAGAAYAEAAAAAwADAAWAAAAAQABACIAAAACAAIAIwAAAAIAAgAlAAAAAAAAABcAAAABYIIAMAnJRnMkjvahFEZwXRLN9QAAAAAAAAAABmT0B8dzYsVm1/IAPnR5PIBAQAAAAAAAIBgMzwAAAAAAAAAAAAAAAAAAAAAAAAAAHRlc3R0AGUAcwB0AHQAZQBzAHQA";
my $a = Authen::NTLM-> new(
user => $user,
domain => $domain,
password => $passwd,
version => 2,
);
my $reply1 = $a-> challenge;
ok($reply1 eq $msg1, 'reply 1');
# decode challenge - not normally user accessed
my $c = &Authen::NTLM::decode_challenge(decode_base64($challenge));
ok($c->{ident} eq "NTLMSSP", 'header');
ok($c->{type} == 2, 'type');
ok($c->{flags} == 0x02898205, 'flags');
ok($c->{data} eq "ABCDEFGH", 'data');
ok($c->{domain}{len} == 4, 'domain length');
ok($c->{domain}{offset} == 56, 'domain offset');
ok($c->{buffer} eq "testtesttest", 'contents');
# 13: v2 challenge-response uses time()
{
no warnings qw(redefine);
local *CORE::GLOBAL::time = sub { 1_000_000_000 };
my $reply2 = $a-> challenge($challenge);
ok($reply2 eq $msg2, 'reply 2');
}

9
NTLM-1.05/t/99_pod.t Normal file
View File

@ -0,0 +1,9 @@
#! /usr/bin/perl
use strict;
use warnings;
use Test::More;
eval 'use Test::Pod 1.00';
plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@;
all_pod_files_ok(all_pod_files('blib'));

69
README
View File

@ -3,7 +3,7 @@ NAME
Synchronise mailboxes between two imap servers. Good at IMAP migration.
More than 36 different IMAP server softwares supported with success.
$Revision: 1.366 $
$Revision: 1.398 $
SYNOPSIS
To synchronise imap account "foo" on "imap.truc.org" to imap account
@ -22,12 +22,12 @@ INSTALL
imapsync is already available directly on the following distributions
(at least): FreeBSD, Debian, Ubuntu, Gentoo, Fedora, NetBSD, Darwin,
Mandriva and OpenBSD (yeah!).
Mandriva and OpenBSD.
Get imapsync at
http://www.linux-france.org/prj/imapsync/
You'll find a compressed tarball called imapsync-x.xx.tgz
You'll receive a link to a compressed tarball called imapsync-x.xx.tgz
where x.xx is the version number. Untar the tarball where
you want (on Unix):
@ -55,8 +55,10 @@ USAGE
[--user2 <string>] [--passfile2 <string>]
[--ssl1] [--ssl2]
[--tls1] [--tls2]
[--authmech1 <string>] [--authmech2 <string>]
[--noauthmd5]
[--authmech1 <string>] [--authmech2 <string>]
[--proxyauth1] [--proxyauth2]
[--domain1] [--domain2]
[--authmd51] [--authmd52]
[--folder <string> --folder <string> ...]
[--folderrec <string> --folderrec <string> ...]
[--include <regex>] [--exclude <regex>]
@ -67,7 +69,6 @@ USAGE
[--justfolders] [--justfoldersizes] [--justconnect] [--justbanner]
[--syncinternaldates]
[--idatefromheader]
[--buffersize <int>]
[--syncacls]
[--regexmess <regex>] [--regexmess <regex>]
[--maxsize <int>]
@ -76,9 +77,12 @@ USAGE
[--minage <int>]
[--skipheader <regex>]
[--useheader <string>] [--useheader <string>]
[--nouid1] [--nouid1]
[--usecache]
[--skipsize] [--allowsizemismatch]
[--delete] [--delete2]
[--expunge] [--expunge1] [--expunge2] [--uidexpunge2]
[--delete2folders] [--delete2foldersonly] [--delete2foldersbutnot]
[--subscribed] [--subscribe] [--subscribe_all]
[--nofoldersizes]
[--dry]
@ -86,9 +90,11 @@ USAGE
[--timeout <int>] [--fast]
[--split1] [--split2]
[--reconnectretry1 <int>] [--reconnectretry2 <int>]
[--noreleasecheck]
[--pidfile <filepath>]
[--tmpdir <dirpath>]
[--version] [--help]
[--tests] [--tests_debug]
DESCRIPTION
The command imapsync is a tool allowing incremental and recursive imap
@ -110,7 +116,10 @@ DESCRIPTION
You can decide to delete the messages from the source mailbox after a
successful transfer (it is a good feature when migrating). In that case,
use the --delete --expunge1 options.
use the --delete option. Option --delete implies also option --expunge
so all messages marked deleted on host1 will be really deleted. (you can
use --noexpunge to avoid this but I don't see any real world scenario
for the combinaison --delete --noexpunge).
You can also just synchronize a mailbox A from another mailbox B in case
you just want to keep a "live" copy of B in A (--delete2 may help)
@ -165,6 +174,10 @@ SECURITY
with --authuser1 "adminuser", it will not work. Same behavior with the
--authuser2 option.
When working on Sun/iPlanet/Netscape IMAP servers you must use
--proxyauth1 to enable administrative user to masquerade as another
user. Can also be used on destination server with --proxyauth2
EXIT STATUS
imapsync will exit with a 0 status (return code) if everything went
good. Otherwise, it exits with a non-zero status.
@ -177,9 +190,10 @@ EXIT STATUS
done
LICENSE
imapsync is free, gratis and open source software cover by the Do What
The Fuck You Want To Public License (WTFPL). See COPYING file included
in the distribution or the web site http://sam.zoy.org/wtfpl/COPYING
imapsync is free, open source but not always gratis software cover by
the Do What The Fuck You Want To Public License (WTFPL). See COPYING
file included in the distribution or the web site
http://sam.zoy.org/wtfpl/COPYING
MAILING-LIST
The public mailing-list may be the best way to get support.
@ -214,8 +228,8 @@ AUTHOR
imapsync mailing-list (see below).
Gilles LAMIRAL earns his living writing, installing, configuring and
teaching free, open and gratis softwares. Do not hesitate to pay him for
that services.
teaching free, open and often gratis softwares. Do not hesitate to pay
him for that services.
BUG REPORT GUIDELINES
Help us to help you: follow the following guidelines.
@ -238,7 +252,7 @@ BUG REPORT GUIDELINES
visible line).
Don't write imapsync in uppercase in the email title, we'll know you run
windows(tm) and you haven't read the README yet.
Windows and you haven't read this README yet.
Help us to help you: in your report, please include:
@ -271,18 +285,18 @@ BUG REPORT GUIDELINES
it.
IMAP SERVERS
Failure stories reported with the following 4 imap servers:
Failure stories reported with the following 3 imap servers:
- MailEnable 1.54 (Proprietary) http://www.mailenable.com/
- DBMail 0.9, 2.0.7 (GPL). But DBMail 1.2.1 works.
Patient and confident testers are welcome.
- dkimap4 2.39
- Imail 7.04 (maybe).
Success stories reported with the following 36 imap servers (software
Success stories reported with the following 40 imap servers (software
names are in alphabetic order):
- 1und1 H mimap1 84498 [host1]
- a1.net imap.a1.net IMAP4 Ready WARSBL614 00029c23 [host1]
- Archiveopteryx 2.03, 2.04, 2.09, 2.10 [host2], 3.0.0 [host2]
(OSL 3.0) http://www.archiveopteryx.org/
- BincImap 1.2.3 (GPL) (http://www.bincimap.org/)
@ -303,12 +317,15 @@ IMAP SERVERS
- DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy.
- Deerfield VisNetic MailServer 5.8.6 [host1]
- Domino (Notes) 4.61[host1], 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, 7.0.1[host1], 8.0.1[host1]
- dkimap4 [host1]
- Domino (Notes) 4.61[host1], 6.5[host1], 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1,
7.0.1[host1], 8.0.1[host1], 8.5.2[host2]
- Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)
- Eudora WorldMail v2
- GMX IMAP4 StreamProxy.
- Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.
- hMailServer 5.3.3 [host2], 4.4.1 [host1] (see FAQ)
- iPlanet Messaging server 4.15, 5.1, 5.2
- IMail 7.15 (Ipswitch/Win2003), 8.12
- MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)
@ -317,18 +334,19 @@ IMAP SERVERS
6.5.7638.1 [host2], Exchange 2007 SP1 (with Update Rollup 2),
Exchange2007-EP-SP2,
Exchange 2010 RTM (Release to Manufacturing) [host2]
- Mirapoint
- Netscape Mail Server 3.6 (Wintel !)
- Netscape Messaging Server 4.15 Patch 7
- OpenMail IMAP server B.07.00.k0 (Samsung Contact ?)
- OpenWave
- Oracle Beehive [host1]
- Qualcomm Worldmail (NT)
- Rockliffe Mailsite 5.3.11, 4.5.6
- Samsung Contact IMAP server 8.5.0
- Scalix v10.1, 10.0.1.3, 11.0.0.431
- SmarterMail, Smarter Mail 5.0 Enterprise.
- SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1].
- SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)
- Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05
- Sun Messaging Server 6.3
- Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3
- Surgemail 3.6f5-5
- UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
(RedHat uses UW like 2003.338rh), v12.264 Solaris 5.7 (OSI Approved)
@ -350,15 +368,10 @@ IMAP SERVERS
imapsync --host1 imap.troc.org --host2 imap.trac.org --justconnect
Please rate imapsync at http://freshmeat.net/projects/imapsync/ or
better give the author a book, he likes books:
http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/ (or its paypal
account gilles.lamiral@laposte.net)
HUGE MIGRATION
Pay special attention to options --subscribed --subscribe --delete
--delete2 --expunge --expunge1 --expunge2 --uidexpunge2 --maxage
--minage --maxsize --useheader --fast
--delete2 --delete2folders --expunge --expunge1 --expunge2 --uidexpunge2
--maxage --minage --maxsize --useheader --fast
If you have many mailboxes to migrate think about a little shell
program. Write a file called file.csv (for example) containing users and
@ -404,5 +417,5 @@ SIMILAR SOFTWARES
Feedback (good or bad) will often be welcome.
$Id: imapsync,v 1.366 2010/10/25 17:15:52 gilles Exp gilles $
$Id: imapsync,v 1.398 2011/01/18 03:03:24 gilles Exp gilles $

26
TIME
View File

@ -1,3 +1,29 @@
180 Added --authmd51 and --authmd52. --delete2foldersbutnot. Release 1.398 public. Payment in EUR.
60 Added info about biggest messages. --debugimap* implies --debug
130 Added delete2foldersnot option.
420 Ended speedup with cache.
350 Continue speedup with cache.
360 Continue speedup with cache.
180 Started to speedup with cache.
30 Reading rfc 3501
60 Added help to guess --sep1 and --prefix1 when needed.
90 Added option --delete2foldersonly
105 1 email about subfolder and generic FAQ solution (no separator nor prefix by hand)
65 2 email about subfolder and --delete2folders and Exchange --authuser
150 imapsync 1.384 cleanup. Think about cache and both sync.
60 imapsync 1.383 better default behaviour.
300 paypal_reply: imap server independant
180 paypal_reply: paypal_send
180 paypal_reply: build reply.
150 paypal_reply: parsing received email
120 Started paypal_reply
180 Fix no header => take 2k body.
30 Fix ps -o on Solaris.
60 folderrec_blank_bug. Pricing includes updates?
120 dkimap support.
240 NTLM support. --domain1 --domain2 options. 1.377 release
240 New imapsync distribution policy: pay first.
260 New imapsync.exe 1.366 with --link libeay32_.dll --link ssleay32_.dll (better names ending_?). New index.shtml, imapsync.exe sold 15 USD.
90 Permit host* to change the case of headers. 1.366 release.
120 Fix tls capability. 1.365 release.
150 1.363 public release.

53
TODO
View File

@ -1,5 +1,5 @@
#!/bin/cat
# $Id: TODO,v 1.86 2010/10/08 00:43:09 gilles Exp gilles $
# $Id: TODO,v 1.92 2011/01/18 02:38:48 gilles Exp gilles $
TODO file for imapsync
----------------------
@ -15,6 +15,8 @@ Add a best practice migration tips document.
Write a Mail::imapsync package and use it.
write a comment to http://blog.migrationwiz.com/2010/12/09/imapsync-vs-migrationwiz/
Fix the mailing-list archive bug with From at
the beginning of a line
http://www.linux-france.org/prj/imapsync_list/msg00307.html
@ -28,8 +30,6 @@ funny during the sync. It would be great - and presumably easy to code -
to have an option to have imapsync display e.g. the subject of an
e-mail when it gets synced, rather than just the message ID and the date/time.
Add --noauthmd51 --noauthmd52 to permit noauthmd5 by host
Add a well described problem for each problem detected
and counted in error counter statistics.
@ -39,9 +39,6 @@ http://www.bwebcentral.com/utils/imapsync-yahoo
See patches/imapsync-yahoo
Add NTLM authentification support
http://cpansearch.perl.org/src/BUZZ/NTLM-1.05/NTLM.pm
http://curl.haxx.se/rfc/ntlm.html
Add "output to reflect everything that imapsync was doing".
Not everything but flag synchronization will be nice"
@ -60,11 +57,6 @@ their ACLs. Syncing ACLs vom Cyrus to Dovecot (at least 1.2) doesn't
work. Cyrus uses c and d, Dovecot uses k and x instead."
Peer Heinlein.
Add a --delete2folders option
"When syncing mailboxes with imapsync, is there a way to delete folders in the
target account? The --delete2 option only seems to delete individual
messages, not folders."
Add different levels of output to see clearly the
problem by default.
@ -72,13 +64,6 @@ Add option --exclude_messages_with_flag
Add more information about skipped messages.
There was a time imapsync took the whole message when the
header was bad (empty). But it was bad for speed with big
messages (nowadays there are always big messages in
mailboxes). May be the best is to take a part of the
body. Have to code this.
Add Rick Romero patch with
--quiet No output at all
@ -161,10 +146,38 @@ http://www.washington.edu/imap/documentation/commndmt.txt.html
Add cyrus link about INBOX. namespace
http://asg.web.cmu.edu/cyrus/download/imapd/altnamespace.html
Explain expunge behavior.
===========================================================================
DONE. Explain expunge behavior in help message.
DONE. Add --authmd51 --authmd52 to permit authmd5 by host.
DONE. Write option --delete2foldersonly regex.
Example: to permit a sync in a subfolder with --delete2folder
--regextrans2 's#(.*)#NEW/$1#' --delete2foldersonly /^NEW/
DONE. Write option --delete2foldersnot regex.
Example: to permit a sync but not deleting folder OLD
--delete2foldersnot /^OLD/
DONE. Add cache to speed up transfer. Option --usecache
DONE. There was a time imapsync took the whole message when the
header was bad (empty). But it was bad for speed with big
messages (nowadays there are always big messages in
mailboxes). May be the best is to take a part of the
body. Have to code this.
DONE. Add a --delete2folders option
"When syncing mailboxes with imapsync, is there a way to delete folders in the
target account? The --delete2 option only seems to delete individual
messages, not folders."
DONE. Add NTLM authentification support. Mail-IMAPClient-3.25
support it.
http://cpansearch.perl.org/src/BUZZ/NTLM-1.05/NTLM.pm
http://curl.haxx.se/rfc/ntlm.html
DONE. Evaluate memory consumption with (or better):
print qx{ ps o pid,pcpu,comm,vsz,rss,size $$ }, "\n"
Search memory leaks with

View File

@ -1 +1 @@
1.366
1.398

View File

@ -1 +1 @@
1.366
1.398

BIN
ab_jlh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,10 +1,10 @@
REM $Id: build_exe.bat,v 1.6 2010/10/24 23:51:48 gilles Exp gilles $
REM $Id: build_exe.bat,v 1.8 2010/11/09 01:22:29 gilles Exp gilles $
echo Building imapsync.exe
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mFile::Spec -mDigest::HMAC_MD5 -e ''
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mFile::Spec -mDigest::HMAC_MD5 -mAuthen::NTLM -e ''
pp -o imapsync.exe -M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL -M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey imapsync
pp -o imapsync.exe --link libeay32_.dll --link libssl32_.dll -M Mail::IMAPClient -M IO::Socket -M IO::Socket::SSL -M Digest::MD5 -M Digest::HMAC_MD5 -M Term::ReadKey -M Authen::NTLM imapsync
echo Done building imapsync.exe

View File

@ -12,4 +12,4 @@ RELEASE_FOCUS="Minor feature enhancements"
#TEXT_BODY="Syntax cleanup"
#TEXT_BODY="Updated documentation"
TEXT_BODY="Since last public release 1.350: Added --minsize option to transfer messages bigger than a given size. Added memory consumption to know how much concurent imapsync can run in parallel on a system. Thanks to the freshmeat guy who corrects my bad and poorly English!"
TEXT_BODY="Several improvements to reach better usability. Authentication cram-md5 is not used by default (too few server support it). Issues from servers changing or adding header are avoided. Now imapsync has a way to handle efficiently no header in messages. The imap server dkimap is supported (dkimap isn't a uid capability server). Added NTLM authentication with domain. Added --minsize option to transfer messages bigger than a given size. Added memory consumption measurement to compute how much concurrent imapsync can run in parallel on a system. Imapsync is no longer gratis from the home page."

View File

@ -1,9 +1,9 @@
{
"release": {
"tag_list": "stable, Minor feature enhancements",
"version": "1.359",
"version": "1.383",
"hidden_from_frontpage": false,
"changelog": "Since last public release 1.350: Added --minsize option to transfer messages bigger than a given size.Added memory consumption to know how much concurent imapsync can run in parallel on a system. Many thanks to the freshmeat folk that correct my bad and poorly English!"
"changelog": "Since last public release 1.350 several improvements have been made to reach a better usability. By default, authentication cram-md5 is not used (too few server support it) so --noauthmd5 option becomes useless. To avoid issues from servers changing or adding header option --useheader Message-Id is on by default too. Now imapsync has a way to handle efficiently no headers in messages (take first 2KB body). The imap server dkimap is now supported (it was not because dkimap is not a uid capability server). NTLM authentication with domain is supported. Added --minsize option to transfer messages bigger than a given size. Added memory consumption measurement to compute how much concurrent imapsync can run in parallel on a system. Imapsync is no longer gratis from the home page. Imapsync license has not changed, it is still a WTFPL software. Thanks again to the freshmeat guy who corrects my bad and poorly English!"
}
}

887
imapsync

File diff suppressed because it is too large Load Diff

BIN
imapsync.exe Executable file

Binary file not shown.

4383
imapsync_1.383 Executable file

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
<title>imapsync <!--#exec cmd="cat VERSION" --> </title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2010-10-25T01:49:57+0200"/>
<meta name="date" content="2011-01-18T04:57:45+0100"/>
<meta name="copyright" content="None"/>
<meta name="keywords" content="imap, transfert, migration"/>
<meta name="description" content="imap migration tool"/>
@ -14,15 +14,13 @@
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="expires" content="0"/>
<link rel="icon" type="image/png" href="logo_imapsync_s.png" />
<link href="style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
color: black;
background-color: #ccdddd
}
div.center {
text-align: center;
.none
{
list-style-type: none;
}
</style>
@ -31,14 +29,20 @@ text-align: center;
<body>
<ul class="none">
<li>Buy <a href="#buy_source">imapsync <b>source code</b></a> (any OS)</li>
<li>Buy <a href="#buy_exe"><b>standalone win32</b></a> imapsync.exe</li>
<li>Are your <a href="#imap_server_success">imap servers <b>supported</b></a> by imapsync?</li>
</ul>
<div class="center">
<img src="logo_imapsync.png" width="486" height="309" alt="imapsync logo"/>
<a href="http://www.linux-france.org/prj/imapsync/"><img src="logo_imapsync.png" width="486" height="309" alt="imapsync logo"/></a>
<h1>Welcome to the imapsync web site!</h1>
</div>
<h1><a href="http://www.linux-france.org/prj/imapsync/">imapsync web site</a></h1>
<h2>What is imapsync?</h2>
<p><b>imapsync</b> software is a command line tool allowing incremental and
@ -49,103 +53,163 @@ or in your local network.
<p><b>imapsync</b> is useful for imap account <b>migration</b> or imap account <b>backup</b>.
</p>
<p><b>imapsync</b> is <b>not adequat</b> for maintening two active imap accounts in synchronization
<p><b>imapsync</b> is <b>not adequate</b> for maintaining two active imap accounts in synchronization
where the user plays independently on both sides. Use <b>offlineimap</b>
(written by John Goerzen) for this purpose.
</p>
<h2><a id="AUTHOR"></a> AUTHOR</h2>
<h2><a id="AUTHOR"></a>Who is the author?</h2>
<p>Gilles LAMIRAL<br/>
Email: <b>gilles.lamiral@laposte.net</b></p>
<p>Good feedback is always welcome, bad feedback is often welcome.</p>
<p>A nice place to talk about imapsync is the public
imapsync mailing-list (see below).</p>
<h2><a id="WHERE_TALK"></a>Where to talk about imapsync?</h2>
<p>If you <b>use imapsync</b> as a <b>professionnal worker</b> you may
<b><a href="http://www.linux-france.org/prj/imapsync_list/msg00470.html">read this call</a></b>
for rewarding.
<p>A nice place to talk about imapsync is the public
imapsync mailing-list (see below section <a href="#MAILING-LIST">Mailing-List</a>).
</p>
<p>Other ways to consider the situation:</p>
<ul>
<li>stop beeing a
<a href="http://en.wikipedia.org/wiki/Leech_%28computing%29">leech</a>.
</li>
<li>think about
<a href="http://en.wikipedia.org/wiki/Free_rider_problem">helping back</a>
a software developper and helper.
</li>
</ul>
<!--
<h2><a id="PROFESSIONAL"></a>Professional user?</h2>
<p>If you <b>use imapsync</b> as a <b>professional worker</b> you may
consider the following argument:<br/>
consider the <b>time or money</b> imapsync made your company
<b>gain</b> among <b>all</b> other solutions. <br/>
Divide this gain by 2 or 4 or 8, depending on your mood.<br/>
Then send me the result by paypal, cheque or books, I deserve and <b>need</b> it.<br/>
More about this argument <a href="http://www.linux-france.org/prj/imapsync_list/msg00470.html">here</a>
</p>
-->
<h2><a id="donation"></a> imapsync call for donation</h2>
<p>Are you happy with this <b>free</b>, <b>open</b> and <b>gratis</b> software?<br/></p>
<p>Then <b>you</b> can help me back to <b>maintain</b> imapsync
and <b>support you!</b> <br/>
I will personally thank each donation
with an email and add an entry in the imapsync <a href="CREDITS">CREDITS</a> file.</p>
<h2><a id="latest"></a>Latest release is imapsync
<!--#exec cmd="cat VERSION" -->
</h2>
<p>Written on <!--#flastmod file="VERSION" --></p>
<p>See <a href="ChangeLog">ChangeLog</a> to know what's new.</p>
<p>New features since previous release 1.383:</p>
<ul>
<li>new option <b>--usecache</b> to speedup transfers when using multiple runs.</li>
<li>new option <b>--delete2foldersonly</b> to select which host2 folder hierarchy can be removed if it is away from host1.</li>
<li>new option <b>--delete2foldersbutnot</b> to avoid removing host2 folder hierarchy even if it is away from host1.</li>
<li>Added info about the biggest messages (imapsync uses about 18 times in RAM the size of the biggest transfered message)</li>
</ul>
<p>The next imapsync release should see:</p>
<ul>
<li>An option to sync to and from files (local backup)</li>
</ul>
<h2><a id="buy_source"></a>Buy imapsync source code</h2>
<p>
The Perl <b>imapsync</b> source code will run anywhere a <b>Perl interpreter can run</b>: any Unix, Linux, Windows, or Mac OS operating system.
</p>
<p>Buy <b>latest</b> imapsync Perl <b>source code</b> <br/>
+ standalone <b>imapsync.exe</b> for win32 <br/>
+ standalone x86_elf binary for <b>30 EUR (~40 USD)</b>:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
</p>
<table>
<tr><td><input type="hidden" name="on0" value="Technical support option (+ 80 EUR)"/>Technical support option (+ 80 EUR)</td></tr><tr><td><select name="os0">
<option value="imapsync source">imapsync source €30,00</option>
<option value="imapsync source + technical support">imapsync source + technical support €110,00</option>
</select> </td></tr>
</table>
<p>
<input type="hidden" name="currency_code" value="EUR"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" name="submit" alt="PayPal"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link in few minutes (contact me if the delay is over 20 minutes).<br/>
<b>30 days money-back guarantee.</b></p>
<h2><a id="buy_exe"></a>Standalone imapsync.exe for win32</h2>
<p>Struggle free from source code and Perl installation by<br/>
buying the latest win32 <b>standalone imapsync.exe</b> for <b>22 EUR</b> (~29 USD):</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
You can also offer me a book on my imapsync amazon
<a href="http://www.amazon.com/gp/registry/wishlist/1C9UNDIH3P7R7/"><b>wishlist</b></a><br/>
<input type="hidden" name="cmd" value="_s-xclick"/>
</p>
<table>
<tr><td><input type="hidden" name="on0" value="Technical support option (+ 80 EUR)"/>Technical support option (+ 80 EUR)</td></tr><tr><td><select name="os0">
<option value="imapsync.exe">imapsync.exe €22,00</option>
<option value="imapsync.exe + technical support">imapsync.exe + technical support €102,00</option>
</select> </td></tr>
</table>
<p>
If you prefer making your donation with cash or cheque then my postal address is:<br/>
<b>Gilles LAMIRAL<br/>
4 La Billais<br/>
35580 Baulon<br/>
FRANCE<br/></b>
<input type="hidden" name="currency_code" value="EUR"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>You will receive a download link in few minutes (contact me if the delay is over 20 minutes).<br/>
<b>30 days money-back guarantee.</b></p>
<!--
<p>
My phone numbers are:<br/>
<b>+33 951 84 42 42</b> (home/work)<br/>
<b>+33 620 79 76 06</b> (mobile)<br/>
<b>+33 956 84 42 42</b> (fax)<br/>
</p>
<p><b><i>Thanks in advance!</i></b></p>
<h2><a id="latest"></a><a href="imapsync">Latest release
<!--#exec cmd="cat VERSION" -->
(<!--#flastmod file="imapsync" -->)
</a></h2>
<p>See <a href="ChangeLog">ChangeLog</a> to know what's new.</p>
<h2><a href="dist/?C=M;O=D">imapsync source download</a></h2>
<p><b>Standalone</b>
<a href="imapsync.exe"><b>imapsync <!--#exec cmd="cat VERSION_EXE" --> executable for win32</b></a>,
thanks to Strawberry Perl 5.12 and Par::Packer module.<br/>
The imapsync.exe built time is <!--#flastmod file="imapsync.exe" -->.<br/>
The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 Mo RAM.
The imapsync.exe built time is .<br/>
The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 Mo RAM. </p>
-->
<h2>Documentation</h2>
<p>Read the <a href="INSTALL">INSTALL</a> file to know how to install imapsync on your system.
</p>
<h2><a href="INSTALL">imapsync installation</a></h2>
<p>The <a href="README">README</a> file has many tips to understand imapsync and succeed in your migration or backup.
</p>
<h2><a href="README">README</a></h2>
<p>The <a href="FAQ">FAQ</a> file presents Frequently Asked Questions (and not so frequently asked ones).
</p>
<h2><a href="FAQ">Frequently Asked Questions</a></h2>
<p>The <a href="TODO">TODO</a> file list what may be coded or done in the future.<br/>
See also the <a href="#WANTED">wanted</a> section.
</p>
<p>All the people I thank are in the <a href="CREDITS">CREDITS</a> file.
</p>
<p>What you can do with imapsync is listed in <a href="COPYING">COPYING</a>.
</p>
<h2><a id="MAILING-LIST"></a>MAILING-LIST</h2>
<h2><a id="MAILING-LIST"></a>The imapsync mailing list</h2>
<p>
The public mailing-list may be the best way to get free support.<br/>
@ -194,47 +258,152 @@ The build system for imapsync.exe is XP Pro SP2 on a Intel Celeron 400 MHz 256 M
</p>
<h2><a id="TODO"></a>
<a id="WANTED"></a>
<a href="TODO">WANTED</a></h2>
<h2><a id="WANTED"></a>WANTED!</h2>
<p>I code new features and fix bugs for free when I have time and when I find it useful.<br/>
If you really want a feature or a fix you can donate money and my next development time
will be to code it or fix it.<br/>
</p>
<p>Some features and their time/money to be done evaluation</p>
<p>On january 2011: <b>1 EUR ~ 1.3 USD</b>.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>Some features and their time/money to be done evaluation:</p>
<table cellpadding="10" cellspacing="0" border="1">
<tr align="right"><th>DONE</th><th>Feature </th><th>Time guessed</th><th>Time spent</th><th>Money received</th><th>Money needed</th></tr>
<tr align="right"><td> No</td><td>Efficient Gmail backup </td><td> 8 hours </td><td> 80 min </td><td> 0 $ </td><td>240 $ </td></tr>
<tr align="right"><td> No</td><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td> 10 $ </td><td>300 $ </td></tr>
<tr align="right"><td> No</td><td>Backup to files </td><td> 8 hours </td><td> 60 min </td><td> 0 $ </td><td>240 $ </td></tr>
<tr align="right"><td><b>Yes</b></td><td>--delete2folders </td><td> 3 hours </td><td>270 min </td><td> 90 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> No</td><td>NTLM auth </td><td> 3 hours </td><td> 60 min </td><td> 0 $ </td><td> 90 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 imapsync.exe </td><td> 8 hours </td><td>520 min </td><td> 0 $ </td><td>240 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 bug fixes </td><td> various </td><td>370 min </td><td>100 $ </td><td> 85 $ </td></tr>
<tr align="right"><td> Yes</td><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td> 30 $ </td></tr>
<tr align="right"><td> Yes</td><td>Large mailbox --maxage </td><td> 4 hours </td><td>270 min </td><td> 0 $ </td><td>120 $ </td></tr>
<tr align="right"><td> No</td><td>Backup to files </td><td>20 hours </td><td> 60 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> No</td><td>Efficient Gmail backup </td><td>20 hours </td><td> 80 min </td><td> 0 $ </td><td>800 $ </td></tr>
<tr align="right"><td> Yes</td><td>Add cache </td><td>10 hours </td><td>1310 min </td><td>400 $ </td><td>400 $ </td></tr>
<tr align="right"><td> Yes</td><td>Speedup 50% </td><td>10 hours </td><td> 80 min </td><td> 10 $ </td><td>400 $ </td></tr>
<tr align="right"><td> Yes</td><td>--delete2folders </td><td> 3 hours </td><td> 270 min </td><td> 90 $ </td><td> 0 $ </td></tr>
<tr align="right"><td> Yes</td><td>NTLM auth </td><td> 3 hours </td><td> 300 min </td><td> 15 $ </td><td>150 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 imapsync.exe </td><td> 8 hours </td><td> 520 min </td><td> 45 $ </td><td>240 $ </td></tr>
<tr align="right"><td> Yes</td><td>Win32 bug fixes </td><td> various </td><td> 370 min </td><td>100 $ </td><td> 85 $ </td></tr>
<tr align="right"><td> Yes</td><td>Fix capability changes </td><td> 1 hour </td><td> 80 min </td><td> 0 $ </td><td> 40 $ </td></tr>
<tr align="right"><td> Yes</td><td>Large mailbox --maxage </td><td> 4 hours </td><td> 270 min </td><td> 0 $ </td><td>160 $ </td></tr>
<tr align="right"><td> Yes</td><td>dkimap support </td><td> 3 hours </td><td> 120 min </td><td> 0 $ </td><td>120 $ </td></tr>
<tr align="right"><td> No</td><td>gratis from here </td><td> 4 hours </td><td> 0 min </td><td> 0 $ </td><td>120000 $ </td></tr>
</table>
<h2><a href="COPYING">COPYING</a></h2>
<h2><a id="imap_server_success"></a>Lists of imap server software failures and success stories</h2>
<h2><a href="ChangeLog">ChangeLog</a></h2>
<p>Let's start with reported <b>failure stories</b> over the past
(maybe new imapsync release can run successfully with them).
</p>
<h2><a href="CREDITS">CREDITS</a></h2>
<ul>
<li>DBMail 0.9, 2.0.7 (GPL). But most other DBMail releases work (see below)</li>
<li>Imail 7.04 (maybe).</li>
<li>MailEnable 1.54 (Proprietary) http://www.mailenable.com/</li>
</ul>
<p>Now the long reported <b>success stories</b> list
([host1] means "source server",
[host2] means "destination server"):
</p>
<ul>
<li>1und1 H mimap1 84498 [host1]</li>
<li>Archiveopteryx 2.03, 2.04, 2.09, 2.10 [host2], 3.0.0 [host2]
(OSL 3.0) http://www.archiveopteryx.org/</li>
<li>BincImap 1.2.3 (GPL) (http://www.bincimap.org/)</li>
<li>CommuniGatePro server (Redhat 8.0) (Solaris), CommuniGate Pro 5.2.17[host2] (CentOS 5.4)</li>
<li>Courier IMAP 1.5.1, 2.2.0, 2.1.1, 2.2.1, 3.0.8, 3.0.3, 4.1.1 (GPL)
(http://www.courier-mta.org/)</li>
<li>Critical Path (7.0.020)</li>
<li>Cyrus IMAP 1.5, 1.6, 2.1, 2.1.15, 2.1.16, 2.1.18
2.2.1, 2.2.2-BETA, 2.2.10, 2.2.12,
v2.2.3-Invoca-RPM-2.2.3-8,
2.3-alpha (OSI Approved),
v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1,
2.2.13,
v2.3.1-Invoca-RPM-2.3.1-2.7.fc5,
v2.3.7,
(http://asg.web.cmu.edu/cyrus/)
</li>
<li>David Tobit V8 (proprietary Message system).</li>
<li>DBMail 1.2.1, 2.0.4, 2.0.9, 2.2rc1 (GPL) (http://www.dbmail.org/).
2.0.7 seems buggy.</li>
<li>Deerfield VisNetic MailServer 5.8.6 [host1]</li>
<li>dkimap4 [host1]</li>
<li>Domino (Notes) 4.61[host1], 6.5, 5.0.6, 5.0.7, 7.0.2, 6.0.2CF1, 7.0.1[host1], 8.0.1[host1]</li>
<li>Dovecot 0.99.10.4, 0.99.14, 0.99.14-8.fc4, 1.0-0.beta2.7,
1.0.0 [dest/source] (LGPL) (http://www.dovecot.org/)</li>
<li>Eudora WorldMail v2</li>
<li>GMX IMAP4 StreamProxy.</li>
<li>Groupwise IMAP (Novell) 6.x and 7.0. Buggy so see the FAQ.</li>
<li>hMailServer 5.3.3 [host2], 4.4.1 [host1]</li>
<li>iPlanet Messaging server 4.15, 5.1, 5.2</li>
<li>IMail 7.15 (Ipswitch/Win2003), 8.12</li>
<li>MDaemon 7.0.1, 8.0.2, 8.1, 9.5.4 (Windows server 2003 R2 platform)</li>
<li>Mercury 4.1 (Windows server 2000 platform)</li>
<li>Microsoft Exchange Server 5.5, 6.0.6249.0[host1], 6.0.6487.0[host1],
6.5.7638.1 [host2], Exchange 2007 SP1 (with Update Rollup 2),
Exchange2007-EP-SP2,
Exchange 2010 RTM (Release to Manufacturing) [host2]</li>
<li>Mirapoint server</li>
<li>Netscape Mail Server 3.6 (Wintel)</li>
<li>Netscape Messaging Server 4.15 Patch 7</li>
<li>OpenMail IMAP server B.07.00.k0</li>
<li>OpenWave</li>
<li>Oracle Beehive [host1]</li>
<li>Qualcomm Worldmail (NT)</li>
<li>Rockliffe Mailsite 5.3.11, 4.5.6</li>
<li>Samsung Contact IMAP server 8.5.0</li>
<li>Scalix v10.1, 10.0.1.3, 11.0.0.431</li>
<li>SmarterMail, Smarter Mail 5.0 Enterprise, Smarter Mail 5.5 [host1].</li>
<li>SunONE Messaging server 5.2, 6.0 (SUN JES - Java Enterprise System)</li>
<li>Sun Java(tm) System Messaging Server 6.2-2.05, 6.2-7.05, 6.3</li>
<li>Surgemail 3.6f5-5</li>
<li>UW-imap servers (imap-2000b) rijkkramer IMAP4rev1 2000.287
(RedHat uses UW like 2003.338rh), v12.264 Solaris 5.7 (OSI Approved)
(http://www.washington.edu/imap/)</li>
<li>UW - QMail v2.1</li>
<li>VMS, Imap part of TCP/IP suite of VMS 7.3.2</li>
<li>Zimbra-IMAP 3.0.1 GA 160, 3.1.0 Build 279, 4.0.5, 4.5.2, 4.5.6, 5.5, 6.x</li>
</ul>
<hr/>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer">
<img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
alt="CSS Valide !" />
</a>
<a href="http://www.anybrowser.org/campaign/">
<img style="border:0;width:88px;height:31px"
src="http://www.anybrowser.org/campaign/bvgraphics/ab_jlh.png"
alt="Viewable With Any Browser" />
</a>
</p>
<hr/>
<p>
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
This document last modified <!--#echo var="LAST_MODIFIED" --> <br/>
$Id: index.shtml,v 1.31 2010/10/25 00:05:35 gilles Exp gilles $
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
($Id: index.shtml,v 1.50 2011/01/18 04:01:20 gilles Exp gilles $)
</p>
</body>

54
learn/fetch_with_size Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/perl
use warnings;
use strict;
use English;
use Mail::IMAPClient;
$ARGV[3] or die "usage: $0 host user password folder uid\n";
my $host = $ARGV[0];
my $user = $ARGV[1];
my $password = $ARGV[2];
my $folder = $ARGV[3];
my $uid = $ARGV[4];
my $imap = Mail::IMAPClient->new();
$imap->Debug(0);
$imap->Server($host);
$imap->connect() or die;
$imap->User($user);
$imap->Password($password);
$imap->login() or die;
$imap->Uid(1);
$imap->Peek(1);
$imap->Clear(1);
#print map {"$_\n"} $imap->folders();
$imap->select($folder) or die;
my @msgs = $imap->messages or die "Could not messages: $@\n";
print "@msgs\n";
foreach my $msg (@msgs) {
$imap->fetch($msg, "BODY.PEEK[TEXT]<0.3000>");
my $text = $imap->_transaction_literals;
print '#' x 72, " $msg TEXT = \n$text\n";
my $part = $imap->bodypart_string($msg, '', 3000, 0);
print '#' x 72, " $msg PART = \n$part\n";
}
$imap->close();
package Mail::IMAPClient;
sub _transaction_literals() {
my $self = shift;
my $string = "";
foreach my $result (@{$self->{"History"}{$self->Transaction}}) {
$string .= $result->[DATA]
if defined($result) and $self->_is_literal($result) ;
}
return $string;
}

View File

@ -20,4 +20,4 @@ $imap->login() or die;
$imap->Uid(1);
$imap->Peek(1);
$imap->select($folder) or die;
$imap->close();
$imap->logout();

View File

@ -3,10 +3,15 @@
use warnings;
use strict;
use IO::Socket;
use English ;
use POSIX qw(uname SIGALRM);
use lib ( '../Mail-IMAPClient-3.25/lib' ) ;
use Mail::IMAPClient;
sub last_release {
my $host = shift || 'linux-france.org' ;
my $sock = new IO::Socket::INET (
PeerAddr => 'linux-france.org',
PeerAddr => $host,
PeerPort => '80',
Proto => 'tcp');
return('unknown') if not $sock;
@ -44,5 +49,67 @@ sub not_long {
}
}
print last_release(), "\n";
print not_long('last_release'), "\n";
sub not_long2 {
#print "Entering not_long\n";
my ( $func ) = shift ;
my ( @argv ) = @_ ;
my $val ;
# Doesn't work with gethostbyname (see perlipc)
#local $SIG{ALRM} = sub { die "alarm\n" };
if ('MSWin32' eq $OSNAME) {
local $SIG{ALRM} = sub { die "alarm\n" };
}else{
POSIX::sigaction(SIGALRM,
POSIX::SigAction->new(sub { die "alarm" }))
or warn "Error setting SIGALRM handler: $!\n";
}
eval {
alarm(3);
print "$func @argv", "\n";
{
no strict "refs";
#print "Calling $func\n";
$val = &$func( @argv ) ;
#print "End of $func\n";
}
alarm(0);
};
if ( $@ ) {
#print "$@";
if ($@ =~ /alarm/) {
# timed out
return('timeout');
}else{
alarm(0);
return('unknown'); # propagate unexpected errors
}
}else {
# didn't
return($val);
}
}
sub connect_test {
my $host = 'localhost' ;
my $imap = Mail::IMAPClient->new( ) ;
$imap->Debug( 1 ) ;
$imap->Server( $host ) ;
$imap->connect( ) or die ;
$imap->IsUnconnected( ) ;
$imap->logout( ) ;
}
#print last_release(), "\n" ;
#print not_long('last_release'), "\n" ;
connect_test( ) ;
print not_long2( 'last_release', ), "\n" ;
#print not_long2( 'last_release' ), "\n" ;
connect_test( ) ;

1226
learn/zzz Normal file

File diff suppressed because it is too large Load Diff

20
memo
View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: memo,v 1.23 2010/10/24 23:49:28 gilles Exp gilles $
# $Id: memo,v 1.29 2010/12/14 15:14:46 gilles Exp gilles $
software_version() {
@ -9,15 +9,15 @@ software_version() {
}
statistics_lfo() {
# 62.147.165.21 - - [31/Oct/2010:23:45:28 +0100] "GET /prj/imapsync/VERSION HTTP/1.0" 200 6 "-" "imapsync/1.368 (linux system, perl 5.8.8, Mail::IMAPClient 2.2.9 imapsync)"
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
cat <<EOFF
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|sort -n|cut -d ' ' -f 1,12,13|uniq -c|sort -n # list ip
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|grep MSWin32|cut -d ' ' -f 1,12,13|sort -n|uniq -c| sort -n # Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|grep -v MSWin32|cut -d ' ' -f 1,12,13|sort -n|uniq -c| sort -n # No Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n # list ip
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32 # Win32
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13|sort -n|uniq -c| sort -n # OS usage
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12|sort -n|uniq -c| sort -n # imapsync release
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n # OS usage+basename
grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n # imapsync release
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency'
@ -27,19 +27,19 @@ EOFF
niouzes_compil() {
DIR_SAVE=`pwd`
cd /home/gilles/public_html/www.linux-france.org/html/
(
cd /g/public_html/www.linux-france.org/html/
m4 niouzes.m4 > niouzes.xml
python ./niouzes/getmynews.py --neuf niouzes.xml > niouzes-neuf.html
python ./niouzes/getmynews.py --html niouzes.xml > niouzes-html.html
cd $DIR_SAVE
)
}
lfo_announce() {
software_version
NEWS_FILE="/home/gilles/public_html/www.linux-france.org/html/niouzes/niouzes_imapsync.xml"
NEWS_FILE="/g/public_html/www.linux-france.org/html/niouzes/niouzes_imapsync.xml"
if ! newer VERSION $NEWS_FILE; then
echo "$VERSION already announced"
else

View File

@ -0,0 +1,168 @@
diff -urN imapsync-1.366.orig/FAQ imapsync-1.366/FAQ
--- imapsync-1.366.orig/FAQ 2010-10-30 12:24:10.951674625 +0200
+++ imapsync-1.366/FAQ 2010-10-31 14:12:40.447361182 +0100
@@ -514,6 +514,34 @@
--exclude '^user\.'
======================================================================
+Q: How to migrate from Sun Java Enterprise System / Sun One / iPlanet /
+Netscape servers with an admin account?
+
+R: Those imap servers don't allow the typical use of --authuser1 to use an
+administrative account. They expect the use of an IMAP command called
+proxyauth that is issued after login in as an administrative account.
+
+For example, consider the administrative account 'administrator' and your
+real user 'real_user'. The IMAP sequence would be:
+
+ OK [CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS
+ CHILDREN BINARY UNSELECT LANGUAGE STARTTLS XSENDER X-NETSCAPE XSERVERINFO
+ AUTH=PLAIN] imap.server IMAP4 service (Sun Java(tm) System Messaging
+ Server ...))
+ 1 LOGIN administrator password
+ 1 OK User logged in
+ 2 PROXYAUTH real_user
+ 2 OK Completed
+
+In imapsync, you can achieve this by using the following options:
+
+ --host1 source.imap.server \
+ --user1 real_user \
+ --authuser1 administrator \
+ --proxyauth1 \
+ --passfile admin.txt
+
+======================================================================
Q. Is there anyway of making imapsync purge the destination folder
when the source folder is deleted?
diff -urN imapsync-1.366.orig/imapsync imapsync-1.366/imapsync
--- imapsync-1.366.orig/imapsync 2010-10-30 12:24:10.965674761 +0200
+++ imapsync-1.366/imapsync 2010-10-31 13:09:59.922679699 +0100
@@ -204,6 +204,9 @@
with --authuser1 "adminuser", it will not work.
Same behavior with the --authuser2 option.
+When working on Sun/iPlanet/Netscape IMAP servers you must use
+--proxyauth1 to enable administrative user to masquerade as another user.
+Can also be used on destination server with --proxyauth2
=head1 EXIT STATUS
@@ -560,6 +563,7 @@
$ssl1, $ssl2,
$tls1, $tls2,
$authuser1, $authuser2,
+ $proxyauth1, $proxyauth2,
$authmech1, $authmech2,
$split1, $split2,
$reconnectretry1, $reconnectretry2,
@@ -680,6 +684,14 @@
$authmech1 = uc($authmech1);
$authmech2 = uc($authmech2);
+if (defined $proxyauth1 && !$authuser1) {
+ missing_option("With --proxyauth1, --authuser1");
+}
+
+if (defined $proxyauth2 && !$authuser2) {
+ missing_option("With --proxyauth2, --authuser2");
+}
+
$authuser1 ||= $user1;
$authuser2 ||= $user2;
@@ -721,12 +733,14 @@
$debugimap1 and print "Host1 connection\n";
$imap1 = login_imap($host1, $port1, $user1, $password1,
$debugimap1, $timeout, $fastio1, $ssl1, $tls1,
- $authmech1, $authuser1, $reconnectretry1);
+ $authmech1, $authuser1, $reconnectretry1,
+ $proxyauth1);
$debugimap2 and print "Host2 connection\n";
$imap2 = login_imap($host2, $port2, $user2, $password2,
$debugimap2, $timeout, $fastio2, $ssl2, $tls2,
- $authmech2, $authuser2, $reconnectretry2);
+ $authmech2, $authuser2, $reconnectretry2,
+ $proxyauth2);
# history
@@ -1551,7 +1565,8 @@
sub login_imap {
my($host, $port, $user, $password,
$debugimap, $timeout, $fastio,
- $ssl, $tls, $authmech, $authuser, $reconnectretry) = @_;
+ $ssl, $tls, $authmech, $authuser, $reconnectretry,
+ $proxyauth) = @_;
my ($imap);
$imap = Mail::IMAPClient->new();
@@ -1591,13 +1606,25 @@
}
}
- $imap->Authmechanism($authmech) unless ($authmech eq 'LOGIN');
+ if ($proxyauth) {
+ $imap->Authmechanism("");
+ } else {
+ $imap->Authmechanism($authmech) unless ($authmech eq 'LOGIN');
+ }
+
$imap->Authcallback(\&plainauth) if $authmech eq "PLAIN";
- $imap->User($user);
- $imap->Authuser($authuser);
- $imap->Password($password);
+ if ($proxyauth) {
+ $imap->User($authuser);
+ $imap->Authuser($authuser);
+ $imap->Password($password);
+ } else {
+ $imap->User($user);
+ $imap->Authuser($authuser);
+ $imap->Password($password);
+ }
+
unless ($imap->login()) {
my $info = "Error login: [$host] with user [$user] auth";
my $einfo = $imap->LastError || @{$imap->History}[-1];
@@ -1610,6 +1637,8 @@
$imap->login() or
die_clean("$info [LOGIN]: ", $imap->LastError, "\n");
}
+ $proxyauth && $imap->proxyauth($user);
+
print "Success login on [$host] with user [$user] auth [$authmech]\n";
return($imap);
}
@@ -2423,6 +2452,8 @@
"authmech2=s" => \$authmech2,
"authuser1=s" => \$authuser1,
"authuser2=s" => \$authuser2,
+ "proxyauth1" => \$proxyauth1,
+ "proxyauth2" => \$proxyauth1,
"split1=i" => \$split1,
"split2=i" => \$split2,
"reconnectretry1=i" => \$reconnectretry1,
@@ -2722,12 +2753,18 @@
--user1 <string> : user to login on host1. Mandatory.
--authuser1 <string> : user to auth with on host1 (admin user).
Avoid using --authmech1 SOMETHING with --authuser1.
+--proxyauth1 : Use proxyauth on host1. Requires --authuser1.
+ Required by Sun/iPlanet/Netscape IMAP servers to
+ be able to use an administrative user
--password1 <string> : password for the user1. Dangerous, use --passfile1
--passfile1 <string> : password file for the user1. Contains the password.
--host2 <string> : "destination" imap server. Mandatory.
--port2 <int> : port to connect on host2. Default is 143.
--user2 <string> : user to login on host2. Mandatory.
--authuser2 <string> : user to auth with on host2 (admin user).
+--proxyauth2 : Use proxyauth on host2. Requires --authuser2.
+ Required by Sun/iPlanet/Netscape IMAP servers to
+ be able to use an administrative user
--password2 <string> : password for the user2. Dangerous, use --passfile2
--passfile2 <string> : password file for the user2. Contains the password.
--noauthmd5 : don't use MD5 authentification.

View File

@ -0,0 +1,111 @@
diff -urN imapsync-1.366.orig/imapsync imapsync-1.366/imapsync
--- imapsync-1.366.orig/imapsync 2010-10-30 12:24:10.965674761 +0200
+++ imapsync-1.366/imapsync 2010-10-30 14:13:31.456674582 +0200
@@ -204,6 +204,9 @@
with --authuser1 "adminuser", it will not work.
Same behavior with the --authuser2 option.
+When working on Sun/iPlanet/Netscape IMAP servers you must use
+--proxyauth1 to enable administrative user to masquerade as another user.
+Can also be used on destination server with --proxyauth2
=head1 EXIT STATUS
@@ -560,6 +563,7 @@
$ssl1, $ssl2,
$tls1, $tls2,
$authuser1, $authuser2,
+ $proxyauth1, $proxyauth2,
$authmech1, $authmech2,
$split1, $split2,
$reconnectretry1, $reconnectretry2,
@@ -680,6 +684,14 @@
$authmech1 = uc($authmech1);
$authmech2 = uc($authmech2);
+if (defined $proxyauth1 && !$authuser1) {
+ missing_option("With --proxyauth1, --authuser1");
+}
+
+if (defined $proxyauth2 && !$authuser2) {
+ missing_option("With --proxyauth2, --authuser2");
+}
+
$authuser1 ||= $user1;
$authuser2 ||= $user2;
@@ -721,12 +733,14 @@
$debugimap1 and print "Host1 connection\n";
$imap1 = login_imap($host1, $port1, $user1, $password1,
$debugimap1, $timeout, $fastio1, $ssl1, $tls1,
- $authmech1, $authuser1, $reconnectretry1);
+ $authmech1, $authuser1, $reconnectretry1,
+ $proxyauth1);
$debugimap2 and print "Host2 connection\n";
$imap2 = login_imap($host2, $port2, $user2, $password2,
$debugimap2, $timeout, $fastio2, $ssl2, $tls2,
- $authmech2, $authuser2, $reconnectretry2);
+ $authmech2, $authuser2, $reconnectretry2,
+ $proxyauth2);
# history
@@ -1551,7 +1565,8 @@
sub login_imap {
my($host, $port, $user, $password,
$debugimap, $timeout, $fastio,
- $ssl, $tls, $authmech, $authuser, $reconnectretry) = @_;
+ $ssl, $tls, $authmech, $authuser, $reconnectretry,
+ $proxyauth) = @_;
my ($imap);
$imap = Mail::IMAPClient->new();
@@ -1591,13 +1606,25 @@
}
}
- $imap->Authmechanism($authmech) unless ($authmech eq 'LOGIN');
+ if ($proxyauth) {
+ $imap->Authmechanism("");
+ } else {
+ $imap->Authmechanism($authmech) unless ($authmech eq 'LOGIN');
+ }
+
$imap->Authcallback(\&plainauth) if $authmech eq "PLAIN";
- $imap->User($user);
- $imap->Authuser($authuser);
- $imap->Password($password);
+ if ($proxyauth) {
+ $imap->User($authuser);
+ $imap->Authuser($authuser);
+ $imap->Password($password);
+ } else {
+ $imap->User($user);
+ $imap->Authuser($authuser);
+ $imap->Password($password);
+ }
+
unless ($imap->login()) {
my $info = "Error login: [$host] with user [$user] auth";
my $einfo = $imap->LastError || @{$imap->History}[-1];
@@ -1610,6 +1637,8 @@
$imap->login() or
die_clean("$info [LOGIN]: ", $imap->LastError, "\n");
}
+ $proxyauth && $imap->proxyauth($user);
+
print "Success login on [$host] with user [$user] auth [$authmech]\n";
return($imap);
}
@@ -2423,6 +2452,8 @@
"authmech2=s" => \$authmech2,
"authuser1=s" => \$authuser1,
"authuser2=s" => \$authuser2,
+ "proxyauth1" => \$proxyauth1,
+ "proxyauth2" => \$proxyauth1,
"split1=i" => \$split1,
"split2=i" => \$split2,
"reconnectretry1=i" => \$reconnectretry1,

View File

@ -1,18 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<body>
<h1>imapsync donation</h1>
Help the author to maintain imapsync:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form>
Thanks in advance!
</body>

73
paypal.shtml Normal file
View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>imapsync donation</title>
<meta name="generator" content="Bluefish 1.0.7"/>
<meta name="author" content="Gilles LAMIRAL"/>
<meta name="date" content="2011-01-18T03:51:50+0100"/>
<meta name="copyright" content=""/>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="expires" content="0"/>
<style type="text/css">
body {
color: black;
background-color: #ccdddd
}
div.center {
text-align: center;
}
img{
border:0px;
}
</style>
</head>
<body>
<h1>imapsync donation</h1>
<p>Help the author to maintain imapsync:<br/>
(<b>1 EUR ~ 1.3 USD</b> on 01/2011)
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1"/>
</p>
</form>
<p>Thanks in advance!</p>
<hr/>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
alt="CSS Valide !" />
</a>
<!--#config timefmt="%D" -->
<!--#config timefmt="%A %B %d, %Y" -->
<b>This document last modified on <!--#echo var="LAST_MODIFIED" --></b>
($Id: paypal.shtml,v 1.4 2011/01/18 02:54:01 gilles Exp gilles $)
</p>
</body>
</html>

13
paypal_reply/8859_utf8 Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/perl -w
# $Id: 8859_utf8,v 1.1 2010/10/01 13:00:09 gilles Exp gilles $
use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);
die unless (utf8_supported_charset('ISO-8859-1'));
while (<>) {
print to_utf8({ -string => $_, -charset => 'ISO-8859-1' });
}

6
paypal_reply/TODO Normal file
View File

@ -0,0 +1,6 @@
Rewrite all with less scripts
use Email::Simple module

140
paypal_reply/paypal_build_reply Executable file
View File

@ -0,0 +1,140 @@
#!/usr/bin/perl
# $Id: paypal_build_reply,v 1.8 2010/12/29 23:51:23 gilles Exp gilles $
use warnings;
use strict;
my ($msg_id_file, $msg_id);
my ($amount, $name, $email);
my (
$buyer, $object, $support, $description,
$url_source, $url_exe, $url, $release,
);
$msg_id_file = $ARGV[1];
$msg_id = firstline($msg_id_file);
while(<>) {
next if ( ! /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*) \((.*)\)/);
($amount, $name, $email) = ($1, $2, $3);
last;
}
$url_source = firstline('/g/var/paypal_reply/url_source');
$url_exe = firstline('/g/var/paypal_reply/url_exe');
$release = firstline('/g/var/paypal_reply/url_release');
# source code wanted
if (('$35,00 USD' eq $amount) or ('$50,00 USD' eq $amount)) {
$object = 'imapsync source code';
$support = '';
$url = $url_source;
}
# win32 binary wanted
if (('$25,00 USD' eq $amount) or ('$15,00 USD' eq $amount)) {
$object = 'imapsync.exe binary';
$support = '';
$url = $url_exe;
}
# source code + technical support wanted
if ('$135,00 USD' eq $amount) {
$object = 'imapsync source code';
$support = "\nI'm ready to help you by email until success (I hope).\n";
$url = $url_source;
}
# win32 binary + technical support wanted
if ('$125,00 USD' eq $amount) {
$object = 'imapsync.exe binary';
$support = "\nI'm ready to help you by email until success (I hope).\n";
$url = $url_exe;
}
while(<>) {
next if ( ! /^Acheteur/ );
$buyer .= "===== Acheteur =====\n";
last;
}
while(<>) {
$buyer .= $_ if ( ! /^Instructions/ );
last if ( /^Instructions/ );
}
while(<>) {
next if ( ! /^Description :(.*)/ );
$description = "===== Details =====\n";
$description .= $_;
last;
}
while(<>) {
$description .= $_;
last if ( /^Paiement envoy/ );
}
my $address = 'gilles.lamiral@laposte.net';
my $address2 = 'gilles@lamiral.info';
my $rcstag = '$Id: paypal_build_reply,v 1.8 2010/12/29 23:51:23 gilles Exp gilles $';
my $message = <<EOM
X-Comment: $rcstag
In-Reply-To: $msg_id
From: Gilles LAMIRAL <$address>
To: <$email>
Bcc: Gilles LAMIRAL <$address>, <$address2>
Subject: [imapsync download] $object release $release [$email]
Hello $name,
You will find the latest $object release $release at the following link:
$url
I thank you for buying and using imapsync,
I wish you successful transfers!
$support
$buyer
$description
==== Vendeur ====
Gilles LAMIRAL
4 La Billais
35580 Baulon
FRANCE
Tel: +33 951 84 42 42
Mob: +33 620 79 76 06
Fax: +33 956 84 42 42
email: $address
--
Au revoir, 09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
EOM
;
=pod
=cut
print $message;
#print "[$amount] [$name] [$email] [$object]\n";
sub firstline {
# extract the first line of a file (without \n)
my($file) = @_;
my $line = "";
open FILE, $file or die("error [$file]: $! ");
chomp($line = <FILE>);
close FILE;
$line = ($line) ? $line: "error !EMPTY! [$file]";
return $line;
}

182
paypal_reply/paypal_functions Executable file
View File

@ -0,0 +1,182 @@
#!/bin/sh
# $Id: paypal_functions,v 1.10 2011/01/11 01:41:31 gilles Exp gilles $
paypal_prerequisites() {
perl -mMIME::Lite -e '' || echo 'sudo aptitude install libmime-lite-perl'
perl -mMIME::Parser -e '' || echo 'sudo aptitude install libmime-tools-perl'
perl -mUnicode::MapUTF8 -e '' || echo 'sudo aptitude install libunicode-maputf8-perl'
}
paypal_init_laposte() {
user=gilles.lamiral
passfile=/g/var/pass/secret.gilles_laposte
host=imap.laposte.net
tmpdir=/g/var/paypal_reply
folder=INBOX
}
paypal_init_petite() {
user=gilles@est.belle
passfile=/g/var/pass/secret.gilles_mbox
host=p
tmpdir=/g/var/paypal_reply
folder='INBOX.03_imapsync.imapsync_paypal'
}
paypal_init_petite_INBOX() {
user=gilles@est.belle
passfile=/g/var/pass/secret.gilles_mbox
host=p
tmpdir=/g/var/paypal_reply
folder='INBOX'
}
paypal_init_test() {
user=gilles@est.belle
passfile=/g/var/pass/secret.gilles_mbox
host=p
tmpdir=/g/var/paypal_reply_test
folder='INBOX.03_imapsync.imapsync_paypal'
}
get_mail() {
# creation des répertoires
mkdir -p $tmpdir/msg_in/
mkdir -p $tmpdir/msg_id/
(
cd $tmpdir/msg_in/
# recuperation des messages de la boite sans destruction des messages
# transférés
paypal_imapget --host $host --user $user --passfile $passfile \
--folder $folder
)
}
extract_mail() {
test -z "`ls $tmpdir/msg_in/`" && echo no mail && return
mkdir -p $tmpdir/msg_out/
(
cd $tmpdir/msg_out/
test -z "`ls .`" || rm -rf *_d
paypal_mimeexplode ../msg_in/*
)
#ls -d $tmpdir/msg_out/
}
extract_mail_test() {
test -z "`ls $tmpdir/msg_in/`" && echo no mail && return
mkdir -p $tmpdir/msg_out/
(
cd $tmpdir/msg_out/
test -z "`ls .`" || rm -rf *_d
paypal_mimeexplode ../msg_in/*
)
#ls -d $tmpdir/msg_out/
}
convert_utf8() {
test -z "`ls $tmpdir/msg_out/`" && echo no mail && return
mkdir -p $tmpdir/msg_out_utf8/
for f in $tmpdir/msg_out/*_d/*.txt; do
b=`basename "$f"`
d=`dirname "$f"`
bd=`basename "$d"`
d_utf8="$tmpdir/msg_out_utf8/$bd"
f_utf8="$d_utf8/$b"
test -d "$d_utf8" && continue
echo converting "$f" to "$f_utf8"
mkdir "$d_utf8"
8859_utf8 "$f" > "$f_utf8"
done
}
troncate_last_2_chars() {
length=`expr length "$1"`
length_2=`expr $length - 2`
expr substr "$1" 1 $length_2
}
build_reply() {
mkdir -p $tmpdir/msg_reply/
for f in $tmpdir/msg_out_utf8/*/*.txt; do
#echo "$f"
d=`dirname "$f"`
bd=`basename "$d"`
file_id=`troncate_last_2_chars $bd`
d_reply="$tmpdir/msg_reply/$file_id"
test -f "$d_reply/$file_id.txt" && continue
mkdir -p "$d_reply"
echo building "$d_reply/$file_id.txt"
paypal_build_reply "$f" "$tmpdir/msg_id/$file_id" > "$d_reply/$file_id.txt"
done
}
send_reply() {
mkdir -p $tmpdir/msg_sent/
for f in $tmpdir/msg_reply/*/*.txt; do
b=`basename "$f"`
d=`dirname "$f"`
bd=`basename "$d"`
d_sent="$tmpdir/msg_sent/$bd"
test -f "$d_sent/$b" && continue
mkdir -p "$d_sent"
test X"--send" = X"$1" && paypal_send --send "$f" && touch "$d_sent/$b"
test X"" = X"$1" && paypal_send "$f"
done
}
paypal_all() {
paypal_prerequisites
echo "Will get messages in $tmpdir/msg_in/"
get_mail
echo "Done get messages in $tmpdir/msg_in/"
echo "Will extract_mail in $tmpdir/msg_out/"
extract_mail
echo "Done extract_mail in $tmpdir/msg_out/"
echo "Will converting to utf8 in $tmpdir/msg_out_utf8/"
convert_utf8
echo "Done converting to utf8 in $tmpdir/msg_out_utf8/"
echo "Will build_reply in $tmpdir/msg_reply/"
build_reply
echo "Done build_reply in $tmpdir/msg_reply/"
echo "Will send_reply $@"
send_reply "$@"
echo "Done send_reply $@"
}
#echo 'paypal_reply_petite'
paypal_reply_petite() {
echo "Doing paypal_reply_petite"
echo paypal_init_petite
paypal_init_petite
paypal_all "$@"
echo paypal_init_petite_INBOX
paypal_init_petite_INBOX
paypal_all "$@"
echo "Done paypal_reply_petite"
}
#echo 'paypal_reply_laposte'
paypal_reply_laposte() {
echo "Doing paypal_reply_laposte"
echo paypal_init_laposte
paypal_init_laposte
paypal_all "$@"
echo "Done paypal_reply_laposte"
}

129
paypal_reply/paypal_imapget Executable file
View File

@ -0,0 +1,129 @@
#!/usr/bin/perl -w
# $Id: paypal_imapget,v 1.6 2010/12/29 23:50:45 gilles Exp gilles $
use Getopt::Long;
use Mail::IMAPClient;
use FileHandle;
my $host;
my $port = 143;
my $debugimap = 0;
my $debug = 0;
my $user;
my $password;
my $passfile;
my $folder = 'INBOX';
my $help;
my $numopt = scalar(@ARGV);
my $opt_ret = GetOptions(
"host=s" => \$host,
"user=s" => \$user,
"password=s" => \$password,
"passfile=s" => \$passfile,
"folder=s" => \$folder,
"help" => \$help,
"delete!" => \$delete,
"expunge!" => \$expunge,
"debugimap!" => \$debugimap,
"debug!" => \$debug,
);
usage() and exit if ($help or ! $numopt) ;
$password = (defined($passfile)) ? firstline ($passfile) : $password;
my $imap = Mail::IMAPClient->new();
$imap->Server($host);
$imap->Port($port);
$imap->Uid(1);
$imap->Peek(1);
$imap->Debug($debugimap);
$imap->connect()
or die "Can not open imap connection on [$host] with user [$user] : $@\n";
$imap->User($user);
$imap->Password($password);
$imap->login() or die "Error login : [$host] with user [$user] : $@";
$imap->select($folder) or die "Error select folder [$folder] host [$host] user [$user] : $@";
#my @uids = $imap->search('HEADER', 'SUBJECT',"=?windows-1252?Q?Avis_de_r=E9ception_d=27un_paiement?=");
#my @uids = $imap->search('HEADER', 'Sender','sendmail@paypal.com');
my @uids = $imap->search('TEXT', 'PP341');
print "Search: [@uids]\n";
foreach $msg (@uids) {
my $msg_id = $imap->get_header( $msg, "Message-Id" );
$debug and print "$msg_id\n";
my $msg_code = format_msg_id($msg_id);
my $file = "$msg_code";
if (-f $msg_code and -f "../msg_id/$msg_code") {
$debug and print "Already have $msg_code $msg\n";
next;
}
print "writing message $msg to $file\n";
unlink($file);
if ($imap->message_to_file($file, $msg)) {
$imap->delete_message($msg) if $delete;
$imap->expunge() if $expunge;
}else{
print "Error writing $file: $@\n";
}
write_to_file("../msg_id/$msg_code", $msg_id);
}
$imap->logout();
sub usage {
print <<EOF;
usage: $0 [options]
Several options are mandatory.
--host <string> : imap server. Mandatory.
--user <string> : user to login. Mandatory.
--password <string> : password for the user1. Mandatory.
--delete : mark messages well dumped as deleted
--expunge : expunge folder.
Example:
$0 \\
--host imap.troc.org --user foo --password secret
EOF
}
sub firstline {
# extract the first line of a file (without \n)
my($file) = @_;
my $line = "";
open FILE, $file or die("error [$file]: $! ");
chomp($line = <FILE>);
close FILE;
$line = ($line) ? $line: "error !EMPTY! [$file]";
return $line;
}
sub format_msg_id {
my $msg_id = shift;
$msg_id =~ tr/a-zA-Z0-9/_/cs;
$debug and print "$msg_id\n";
return($msg_id);
}
sub write_to_file {
my $file = shift;
my $string = shift;
$fh = FileHandle->new("> $file");
if (defined $fh) {
print $fh $string;
$fh->close;
}
}

187
paypal_reply/paypal_mimeexplode Executable file
View File

@ -0,0 +1,187 @@
#!/usr/bin/perl -w
# $Id: paypal_mimeexplode,v 1.1 2010/11/23 01:26:24 gilles Exp gilles $
=head1 NAME
mimeexplode - explode one or more MIME messages
=head1 SYNOPSIS
mimeexplode <mime-msg-file> <mime-msg-file> ...
someprocess | mimeexplode -
=head1 DESCRIPTION
Takes one or more files from the command line that contain MIME
messages, and explodes their contents out into subdirectories
of the current working directory. The subdirectories are
just called C<msg0>, C<msg1>, C<msg2>, etc. Existing directories are
skipped over.
The message information is output to the stdout, like this:
Message: msg3 (inputfile1.msg)
Part: msg3/filename-1.dat (text/plain)
Part: msg3/filename-2.dat (text/plain)
Message: msg5 (input-file2.msg)
Part: msg5/dir.gif (image/gif)
Part: msg5/face.jpg (image/jpeg)
Message: msg6 (infile3)
Part: msg6/filename-1.dat (text/plain)
This was written as an example of the MIME:: modules in the
MIME-parser package I wrote. It may prove useful as a quick-and-dirty
way of splitting a MIME message if you need to decode something, and
you don't have a MIME mail reader on hand.
=head1 COMMAND LINE OPTIONS
None yet.
=head1 AUTHOR
Eryq C<eryq@zeegee.com>, in a big hurry...
=cut
BEGIN { unshift @INC, ".." } # to test MIME:: stuff before installing it!
require 5.001;
use strict;
use Getopt::Long;
use vars qw($Msgno);
use MIME::Parser;
use Getopt::Std;
use File::Basename;
my $numopt = scalar(@ARGV);
my $help;
my $debug;
my $opt_ret = GetOptions(
"help" => \$help,
"debug!" => \$debug,
);
usage() and exit if ($help or ! $numopt) ;
sub usage {
print <<EOF;
Usage: $0 [options] email_1 email_2 ...
Options:
--help : print this message
--debug : verbose output
Example:
$0 email_1 email_2
EOF
}
#------------------------------------------------------------
# make_msg - make and return the name of a msgXXX directory
#------------------------------------------------------------
$Msgno = 1;
sub make_msg {
while (-d "msg$Msgno") {
++$Msgno;
die "self-imposed limit reached" if $Msgno == 256;
}
mkdir "msg$Msgno",0755 or die "couldn't make msg$Msgno: $!";
"msg$Msgno";
}
#------------------------------------------------------------
# make_msg_dir - make and return the name of a output directory
#------------------------------------------------------------
sub make_msg_dir {
my ($file) = @_;
if ("-" ne "$file") {
my $basefile = basename($file) . "_d";
-d $basefile and return($basefile);
mkdir $basefile or do {
warn "can not create directory $basefile: $!";
return undef;
};
return($basefile);
}else{
return(make_msg());
}
}
#------------------------------------------------------------
# dump_entity - dump an entity's file info
#------------------------------------------------------------
sub dump_entity {
my $ent = shift;
my @parts = $ent->parts;
if (@parts) { # multipart...
map { dump_entity($_) } @parts;
}
else { # single part...
$debug and print " Part: ", $ent->bodyhandle->path,
" (", scalar($ent->head->mime_type), ")\n";
}
}
#------------------------------------------------------------
# main
#------------------------------------------------------------
sub main {
my $file;
my $entity;
# Sanity:
(-w ".") or die "cwd not writable, you naughty boy...";
# Go through messages:
@ARGV or unshift @ARGV, "-";
while (defined($file = shift @ARGV)) {
my $msgdir = make_msg_dir($file);
next if not $msgdir;
$debug and print "Message: $msgdir ($file)\n";
# Create a new parser object:
my $parser = new MIME::Parser;
### $parser->parse_nested_messages('REPLACE');
# Optional: set up parameters that will affect how it extracts
# documents from the input stream:
$parser->output_dir($msgdir);
# Parse an input stream:
open FILE, $file or die "couldn't open $file";
$entity = $parser->read(\*FILE) or
print STDERR "Couldn't parse MIME in $file; continuing...\n";
close FILE;
# Congratulations: you now have a (possibly multipart) MIME entity!
dump_entity($entity) if $entity;
### $entity->dump_skeleton if $entity;
}
1;
}
exit (&main ? 0 : -1);
#------------------------------------------------------------
1;

30
paypal_reply/paypal_run_laposte Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# $Id: paypal_run_laposte,v 1.2 2010/11/28 05:27:12 gilles Exp gilles $
set -e
#set -x
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \
&& . /g/public_html/imapsync/paypal_reply/paypal_functions
DATE_1=`date`
echo "==== paypal_reply_laposte ===="
paypal_reply_laposte "$@"
echo
DATE_2=`date`
echo "Debut : $DATE_1"
echo "Fin : $DATE_2"
echo "Yo Bery GOOD !"

30
paypal_reply/paypal_run_petite Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# $Id: paypal_run_petite,v 1.4 2010/12/14 15:40:13 gilles Exp gilles $
set -e
#set -x
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \
&& . /g/public_html/imapsync/paypal_reply/paypal_functions
DATE_1=`date`
echo "==== paypal_reply_petite ===="
paypal_reply_petite "$@"
echo
DATE_2=`date`
echo "Debut : $DATE_1"
echo "Fin : $DATE_2"
echo "Yo Bery GOOD !"

30
paypal_reply/paypal_run_test Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# $Id: paypal_run_test,v 1.1 2010/11/28 01:00:45 gilles Exp gilles $
set -e
#set -x
# Add path to commands at home
PATH=$PATH:/g/public_html/imapsync/paypal_reply
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.25/lib
export PERL5LIB
test -f /g/public_html/imapsync/paypal_reply/paypal_functions \
&& . /g/public_html/imapsync/paypal_reply/paypal_functions
DATE_1=`date`
echo "==== paypal_reply_test ===="
paypal_reply_test
echo
DATE_2=`date`
echo "Debut : $DATE_1"
echo "Fin : $DATE_2"
echo "Yo Bery GOOD !"

71
paypal_reply/paypal_send Executable file
View File

@ -0,0 +1,71 @@
#!/usr/bin/perl
# $Id: paypal_send,v 1.3 2010/12/29 23:50:24 gilles Exp gilles $
use strict;
use warnings;
use Getopt::Long;
use MIME::Lite;
my (
$help,
$debug,
$send,
);
my $numopt = scalar(@ARGV);
my $opt_ret = GetOptions(
"help" => \$help,
"debug!" => \$debug,
"send!" => \$send,
);
usage() and exit if ($help or ! $numopt or ! $opt_ret) ;
my @reply = <>;
my %header;
while (my $line = shift @reply) {
#print $line;
chomp($line);
last if ($line =~ /^$/) ;
my($blank, $key, $value) = split /^(.+?:)\s*/, $line;
#print "[$key] [$value]\n";
$header{$key} = $value;
}
my $data = join('', @reply);
#print "[", $data, "]\n";
my $message = MIME::Lite->new();
$message->attr("content-type" => "text/plain");
$message->attr("content-type.charset" => "UTF-8");
$message->build(%header);
$message->build(Data => $data);
$message->print(\*STDOUT);
if ($send) {
$message->send;
print "Sent to ", $header{'To:'},"\n";
}
sub usage {
print <<EOF;
usage: $0 [options] file
--help : print this help message
--debug : verbose output
--send : send message
Examples:
$0 file
$0 --send file
EOF
}

14
style.css Normal file
View File

@ -0,0 +1,14 @@
body {
color: black;
background-color: #eeffff
}
div.center {
text-align: center;
}
img{
border:0;
}
/* $Id: style.css,v 1.4 2010/11/19 23:57:16 gilles Exp gilles $ */

View File

@ -1,10 +1,11 @@
REM $Id: test.bat,v 1.7 2010/10/08 01:43:35 gilles Exp gilles $
REM $Id: test.bat,v 1.8 2011/01/15 06:30:33 gilles Exp gilles $
cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mDate::Manip -mFile::Spec -mDigest::HMAC_MD5 -e ''
perl ./imapsync
perl ./imapsync --host1 l --user1 toto --passfile1 secret.toto --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
perl ./imapsync --host1 l --user1 tata --passfile1 secret.tata --host2 l --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX --nofoldersizes
perl ./imapsync --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX --nofoldersizes --usecache

View File

@ -4,6 +4,8 @@ cd C:\msys\1.0\home\Admin\imapsync
perl -mMail::IMAPClient -mDigest::MD5 -mTerm::ReadKey -mIO::Socket::SSL -mFile::Spec -mDigest::HMAC_MD5 -e ''
.\imapsync.exe
.\imapsync.exe --host1 p --user1 toto --passfile1 secret.toto --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --ssl1 --ssl2 --justconnect
.\imapsync.exe --host1 p --user1 toto --passfile1 secret.toto --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2
.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX
.\imapsync.exe --host1 p --user1 tata --passfile1 secret.tata --host2 p --user2 titi --passfile2 secret.titi --noauthmd5 --delete2 --expunge2 --folder INBOX --usecache

313
tests.sh
View File

@ -1,6 +1,6 @@
#!/bin/sh
# $Id: tests.sh,v 1.127 2010/10/25 17:59:09 gilles Exp gilles $
# $Id: tests.sh,v 1.143 2011/01/18 02:40:36 gilles Exp gilles $
# Example 1:
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
@ -162,7 +162,6 @@ first_sync() {
locallocal() {
if can_send; then
#echo3 Here is plume
sendtestmessage
else
:
@ -239,6 +238,28 @@ ll_folder() {
--folder INBOX.yop --folder INBOX.Trash
}
ll_folder_noexist() {
! $CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.noexist --folder INBOX.noexist2
}
# Way to check it each time:
# sh -x tests.sh 3 ll_folder_create ll_delete2folders
ll_folder_create() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop --regextrans2 's/yop/newyop/' \
--justfolders
}
ll_oneemail() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
@ -248,6 +269,14 @@ ll_oneemail() {
--folder INBOX.oneemail
}
ll_debugimap() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail --debugimap
}
ll_few_emails() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
@ -267,6 +296,33 @@ ll_folderrec() {
--folderrec INBOX.yop
}
ll_folderrec_blank_bug() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec "INBOX.blanc "
}
ll_folderrec_blank_bug_2() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec "INBOX.blanc"
}
ll_folderrec_blank_bug_3() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folderrec '"INBOX.blanc "'
}
ll_buffersize() {
@ -290,6 +346,44 @@ ll_justfolders() {
}
ll_delete2foldersonly() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}NEW${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}NEW${h2_sep}INBOX,' \
--delete2foldersonly '/${h2_prefix}NEW/'
}
ll_delete2foldersonly_tmp() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}NEW_2${h2_sep}$1,' \
--regextrans2 's,^INBOX$,${h2_prefix}NEW_2${h2_sep}INBOX,' \
--delete2foldersonly '/${h2_prefix}NEW_2/'
}
ll_delete2foldersbutnot() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--delete2foldersbutnot '/NEW_2/' \
--dry
}
ll_delete2folders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
@ -457,6 +551,26 @@ ll_authmd5()
--justlogin --authmd5
}
ll_authmd51()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --authmd51
}
ll_authmd52()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin --authmd52
}
ll_noauthmd5()
{
$CMD_PERL ./imapsync \
@ -589,9 +703,18 @@ ll_exclude()
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--exclude '^INBOX.yop'
--exclude '^INBOX.yop' --justfolders --nofoldersizes
}
ll_exclude_INBOX()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--exclude '^INBOX$' --justfolders --nofoldersizes --dry
}
ll_regextrans2()
@ -628,6 +751,21 @@ ll_regextrans2_slash()
}
ll_regextrans2_subfolder()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
--nofoldersize \
--folder 'INBOX.yop.yap' \
--regextrans2 's,${h1_prefix}(.*),${h2_prefix}FOO${h2_sep}$1,' --dry
}
ll_regextrans2_remove_space()
{
@ -702,6 +840,19 @@ ll_useheader()
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
ll_useheader_noheader()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--useheader 'NoExist' \
--debug --delete2 --expunge2
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
}
ll_regexmess()
{
@ -894,6 +1045,39 @@ ll_authmech_PLAIN() {
}
ll_authmech_NTLM() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin \
--debug --authmech1 NTLM
}
ll_authmech_NTLM_domain() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin \
--authmech1 NTLM --domain1 freshgrillfoods.com --debugimap1
}
ll_authmech_NTLM_2() {
$CMD_PERL -I./NTLM-1.05/blib/lib ./imapsync \
--host1 mail.freshgrillfoods.com --user1 ktraster \
--passfile1 ../../var/pass/secret.ktraster \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--authmech1 NTLM --dry
}
ll_authuser() {
$CMD_PERL ./imapsync \
@ -950,7 +1134,7 @@ ll_delete() {
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
--delete --expunge
--delete
}
@ -961,7 +1145,7 @@ ll_bigmail() {
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
--folder INBOX.bigmail
echo 'sudo rm -v /home/vmail/big2/.bigmail/cur/*'
echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
}
ll_memory_consumption() {
@ -972,7 +1156,7 @@ ll_memory_consumption() {
--passfile2 ../../var/pass/secret.big2 \
--folder INBOX.bigmail2 \
--nofoldersizes
echo 'sudo rm -v /home/vmail/big2/.bigmail2/cur/*'
echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail2/cur/*"'
}
@ -1009,7 +1193,7 @@ msw2() {
gmail() {
$CMD_PERL ./imapsync \
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--authmech1 LOGIN \
@ -1025,7 +1209,7 @@ gmail() {
gmail_gmail() {
$CMD_PERL ./imapsync \
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
@ -1043,7 +1227,7 @@ gmail_gmail() {
}
gmail_gmail2() {
$CMD_PERL ./imapsync \
! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
@ -1095,6 +1279,16 @@ archiveopteryx_1() {
--folder INBOX --regextrans2 's/INBOX/copy/'
}
dkimap_1() {
$CMD_PERL ./imapsync \
--host1 Mail.fourfrontsales.com --user1 dktest \
--passfile1 ../../var/pass/secret.dktest \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX/dkimap --regextrans2 's/INBOX.INBOX./INBOX./' \
--noauthmd5 --foldersize --nouid1
}
ll_justlogin() {
# Look in the file ../../var/pass/secret.tptp to see
# strange \ character behavior
@ -1118,10 +1312,96 @@ ll_justlogin_backslash_char() {
}
ll_usecache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--usecache --nofoldersizes \
--folder INBOX
}
ll_nousecache() {
if can_send; then
sendtestmessage
else
:
fi
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--nousecache --nofoldersizes \
--folder INBOX
}
##########################
# specific tests
##########################
gigamail_1() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi \
--sep1 . --prefix1 ''
}
gigamail_2() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi
}
gigamail_3() {
$CMD_PERL ./imapsync \
--host1 mail.gigamail.nl --user1 testbox@gigamail.nl --passfile1 ../../var/pass/secret.gigamail \
--host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi --sep1 .
}
sunone_gmail()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 mailhost.marymount.edu --ssl1 --user1 adoe \
--passfile1 ../../var/pass/secret.adoe \
--host2 imap.googlemail.com --ssl2 --user2 adoe@marymount.edu \
--passfile2 ../../var/pass/secret.adoegmail \
--useheader Message-ID --no-authmd5 \
--exclude Trash
}
date2=`date`
echo3 "[$date1] [$date2]"
}
sunone_gmail_2()
{
date1=`date`
{ $CMD_PERL ./imapsync \
--host1 mailhost.marymount.edu --ssl1 --user1 jharsh@marymount.edu \
--passfile1 ../../var/pass/secret.jharsh \
--host2 imap.googlemail.com --ssl2 --user2 jharsh@marymount.edu \
--passfile2 ../../var/pass/secret.jharsh \
--useheader Message-ID --no-authmd5 \
--folder bug
}
date2=`date`
echo3 "[$date1] [$date2]"
}
big_transfert()
{
date1=`date`
@ -1205,7 +1485,7 @@ dprof_bigmail()
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.bigmail
echo 'sudo rm -v /home/vmail/titi/.bigmail/cur/*' || \
echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
true
}
date2=`date`
@ -1241,7 +1521,8 @@ gmail_gmail2
ll_ask_password
ll_bug_folder_name_with_blank
ll_timeout
ll_folder
ll_folder
ll_folder_noexist
ll_oneemail
ll_buffersize
ll_justfolders
@ -1253,6 +1534,8 @@ ll_subscribed
ll_subscribe
ll_justfoldersizes
ll_authmd5
ll_authmd51
ll_authmd52
ll_noauthmd5
ll_maxage
ll_maxsize
@ -1260,12 +1543,15 @@ ll_skipsize
ll_skipheader
ll_include
ll_exclude
ll_exclude_INBOX
ll_regextrans2
ll_regextrans2_subfolder
ll_sep2
ll_bad_login
ll_bad_host
ll_bad_host_ssl
ll_useheader
ll_useheader_noheader
ll_regexmess
ll_regexmess_scwchu
ll_flags
@ -1290,6 +1576,11 @@ allow3xx
noallow3xx
ll_memory_consumption
ll_newmessage
ll_usecache
ll_nousecache
ll_delete2foldersonly
ll_delete2foldersonly_tmp
ll_delete2foldersbutnot
ll_delete2folders
'

0
tmp/cache/F1/F2/100_200 vendored Normal file
View File

0
tmp/cache/F1/F2/101_201 vendored Normal file
View File

0
tmp/cache/F1/F2/120_220 vendored Normal file
View File

0
tmp/cache/F1/F2/142_242 vendored Normal file
View File

0
tmp/cache/F1/F2/143_243 vendored Normal file
View File

0
tmp/cache/F1/F2/155_255 vendored Normal file
View File

0
tmp/cache/F1/F2/177_277 vendored Normal file
View File

0
tmp/cache/F1/F2/177_377 vendored Normal file
View File

0
tmp/cache/F1/F2/177_777 vendored Normal file
View File

0
tmp/cache/G1/G2/142_242 vendored Normal file
View File

0
tmp/cache/G1/G2/177_777 vendored Normal file
View File