12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733 |
- #!/bin/sh
- # $Id: tests.sh,v 1.374 2022/09/15 08:43:20 gilles Exp gilles $
- # To run these tests, you need a running imap server somewhere
- # with several accounts. And be on Linux or Unix.
- #
- # Tests will break as they are home specific, they depend on the content
- # of the mailboxes, which are not given here.
- #
- # Anyway, those tests are good as imapsync examples.
- #
- # All mandatory tests are run with:
- #
- # sh tests.sh
- #
- # Specific tests can be run by using them as arguments to tests.sh:
- #
- # sh tests.sh ll_ssl_justconnect ll_bad_host ...
- HOST1=${HOST1:-'localhost'}
- echo HOST1=$HOST1
- HOST2=${HOST2:-'localhost'}
- echo HOST2=$HOST2
- # most tests use:
- CMD_PERL='perl -I./W/Mail-IMAPClient-3.43/lib'
- #### Shell pragmas
- #### functions definitions
- # File handle 3 is redirected to STDERR so that echo3 prints
- # on the terminal even with "sh test.sh > /dev/null"
- # I want to see the names of the tests and their count while
- # they're running but I don't want to see their output, it's too noisy.
- exec 3>&2
- echo3() {
- #echo '#####################################################' >&3
- echo "$@" >&3
- }
- #
- echolog() {
- echo "`date_ymdhms` : $@" >> W/.tests.errors.txt
- echo3 Last errors listed in W/.tests.errors.txt
- }
- run_test() {
- echo3 "#### $tests_count $1"
- setxon
- # do not run anything between the two following instructions
- $1; run_test_status=$?
- # now you can run
- setxback 2> /dev/null
- if test x"$run_test_status" = x"0"; then
- echo "$1 passed"
- else
- echo3 "$1 failed"
- fi
- return $run_test_status
- }
- setxon() {
- if ! { echo $-|grep x ; } ; then
- #echo 'set -x was off'
- setx_restore_cmd='set +x'
- set -x
- else
- echo 'set -x already on'
- setx_restore_cmd=""
- fi
- }
- setxback() {
- $setx_restore_cmd
- }
- run_tests() {
- for t in "$@"; do
- tests_count=`expr 1 + $tests_count`
- #
- if ! run_test "$t"; then
- tests_failed_count=`expr 1 + $tests_failed_count`
- tests_failed_list="$tests_failed_list $t"
- fi
- sleep 0
- done
- if test 0 -eq $tests_failed_count; then
- echo3 "ALL $tests_count TESTS SUCCESSFUL"
- echolog "ALL $tests_count TESTS SUCCESSFUL"
- return 0
- else
- # At least one failed
- echo3 "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list"
- echolog "FAILED $tests_failed_count/$tests_count TESTS: $tests_failed_list"
- return 1
- fi
- }
- #### Variable definitions
- tests_count=0
- tests_failed_count=0
- ##### The tests functions
- perl_syntax() {
- $CMD_PERL -c ./imapsync
- }
- no_args() {
- $CMD_PERL ./imapsync
- }
- # list of accounts on petite :
- # mailboxes toto -> titi used on first_sync()
- # mailboxes tata -> titi used on ll()
- # mailboxes tata -> titi on most ll_*() tests
- # mailbox tete@est.belle used on big folder size tests:
- # huge_folder()
- # huge_folder_sizes_only()
- # dprof()
- # mailbox big1 big2 used on bigmail message tests
- # ll_bigmail()
- # ll_memory_consumption
- # mailboxes toto -> delme -> delme used on ll_delself
- sendtestmessage() {
- email=${1:-"tata"}
- rand=${2:-"`pwgen 16 1`"}
- mess='test: '"$rand"
- cmd="echo $mess""| mail -s '""$mess""' $email"
- echo $cmd
- eval "$cmd"
- }
- sendtestmessage_titi() {
- email=${1:-"titi"}
- rand=${2:-"`pwgen 16 1`"}
- mess='test: '"$rand"
- cmd="echo $mess""| mail -s '""$mess""' $email"
- echo $cmd
- eval "$cmd"
- }
- can_send() {
- # no send at all
- #return 1
- test X`hostname` = X"petite" && return 0;
- test X`hostname` = X"plume" && return 0;
- test X`hostname` = X"vadrouille" && return 0;
- return 1
- }
- at_home() {
- test X`hostname` = X"petite" && return 0;
- return 1
- }
- zzzz() {
- $CMD_PERL -V
- }
- set_return_code_variables()
- {
- # Copy from imapsync
- EX_OK=0 #/* successful termination */
- EX_USAGE=64 #/* command line usage error */
- EX_NOINPUT=66 #/* cannot open input */
- EX_UNAVAILABLE=69 #/* service unavailable */
- EX_SOFTWARE=70 #/* internal software error */
-
- EXIT_CATCH_ALL=1 # Any other error
-
- EXIT_BY_SIGNAL=6
- EXIT_BY_SIGQUIT=131 # 128+3
- EXIT_BY_SIGKILL=137 # 128+9
- EXIT_BY_SIGTERM=143 # 128+15
-
- EXIT_BY_FILE=7
- EXIT_PID_FILE_ERROR=8
-
- EXIT_CONNECTION_FAILURE=10
- EXIT_CONNECTION_FAILURE_HOST1=101
- EXIT_CONNECTION_FAILURE_HOST2=102
- EXIT_TLS_FAILURE=12
- EXIT_AUTHENTICATION_FAILURE=16
- EXIT_AUTHENTICATION_FAILURE_USER1=161
- EXIT_AUTHENTICATION_FAILURE_USER2=162
- EXIT_SUBFOLDER1_NO_EXISTS=21
-
- EXIT_WITH_ERRORS=111
- EXIT_WITH_ERRORS_MAX=112
- EXIT_OVERQUOTA=113
- EXIT_ERR_APPEND=114
- EXIT_ERR_FETCH=115
- EXIT_ERR_CREATE=116
- EXIT_ERR_SELECT=117
- EXIT_TRANSFER_EXCEEDED=118
- EXIT_ERR_APPEND_VIRUS=119
- EXIT_ERR_FLAGS=120
-
- EXIT_TESTS_FAILED=254 # Like Test::More API
- }
- # general tests start
- option_version() {
- $CMD_PERL ./imapsync --version
- }
- option_tests() {
- $CMD_PERL ./imapsync --tests
- }
- option_tests_in_var_tmp_sub() {
- (
- mkdir -p /var/tmp/imapsync_tests
- cd /var/tmp/imapsync_tests
- /g/public_html/imapsync/imapsync --tests
- )
- }
- option_tests_in_var_tmp() {
- (
- cd /var/tmp/
- /g/public_html/imapsync/imapsync --tests
- )
- }
- option_testsdebug() {
- $CMD_PERL ./imapsync --testsdebug
- }
- option_releasecheck() {
- $CMD_PERL ./imapsync --help --releasecheck | egrep 'This imapsync.*local.*official'
- }
- option_noreleasecheck() {
- ! { $CMD_PERL ./imapsync --help --noreleasecheck | egrep 'This imapsync.*local.*official' ; }
- }
- option_bad_delete2() {
- $CMD_PERL ./imapsync --delete 2 --blabla
- test "$?" = "$EX_USAGE"
- }
- option_extra_arguments() {
- $CMD_PERL ./imapsync --testslive blabla
- test "$?" = "$EX_USAGE"
- }
- option_extra() {
- (
- mkdir -p W/tmp/tests/options_extra/ || return 1
- cd W/tmp/tests/options_extra/ || return 1
- echo '--debugimap' > options_extra.txt
- test -f ../../../../imapsync
- ../../../../imapsync --testslive
- test "$?" = "$EX_OK"
- )
- pwd
- }
- passwords_masked() {
- $CMD_PERL ./imapsync --host1 boumboum --password1 secret --justbanner | grep MASKED
- }
- passwords_not_masked() {
- $CMD_PERL ./imapsync --host1 boumboum --password1 secret --justbanner --showpasswords| grep secret
- }
- passwords_dollar() {
- $CMD_PERL ./imapsync --host1 boumboum --user1 ee --password1 '$secret' --host2 boumboum --user2 ee --password2 '$secret' --showpasswords
- }
- passwords_parenthese() {
- #$CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 '( secret' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1
- $CMD_PERL ./imapsync --host1 $HOST1 --user1 ee --password1 'secret )' --host2 $HOST2 --user2 ee --password2 '(secret' --showpasswords --debugimap1
- }
- passfile1_noexist() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 /noexists \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- test "$?" = "$EX_NOINPUT"
- }
- passfile2_noexist() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 /noexists
- test "$?" = "$EX_NOINPUT"
- }
- ll_showpasswords() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --password1 'ami\"seen' \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --showpasswords --debugimap1
- }
- ll_dry()
- {
- # The first is to create INBOX.dry on host2
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --f1f2 INBOX=INBOX.dry --justfolders
- time $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --f1f2 INBOX=INBOX.dry --dry
- }
- ll_dry_nodry1()
- {
- time $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --f1f2 INBOX=INBOX.dry --dry --nodry1
- }
- ll_dry_maxage()
- {
- time $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --f1f2 INBOX=INBOX.dry --dry --maxage 7
- }
- # In mandatory_tests
- ll_justhost1()
- {
- $CMD_PERL ./imapsync --host1 $HOST2
- }
- # In mandatory_tests
- ll_justhost2()
- {
- $CMD_PERL ./imapsync --host2 $HOST2
- }
- # In mandatory_tests
- testslive() {
- $CMD_PERL ./imapsync --testslive
- }
- # In mandatory_tests
- testslive6() {
- $CMD_PERL ./imapsync --testslive6
- }
- first_sync_dry() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 toto \
- --passfile1 ../../var/pass/secret.toto \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --dry
- }
- first_sync() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 toto \
- --passfile1 ../../var/pass/secret.toto \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- ll() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- ll_diff_log_stdout_debugssl() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --debugssl 4 \
- --logfile ll_diff_log_stdout_debugssl_1.txt 2>&1 \
- | tee LOG_imapsync/ll_diff_log_stdout_debugssl_2.txt
- echo
- diff LOG_imapsync/ll_diff_log_stdout_debugssl_1.txt LOG_imapsync/ll_diff_log_stdout_debugssl_2.txt
- }
- ll_INBOX() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX
- }
- ll_daily_digest() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX --dry --nodry1 --maxage 5 \
- --truncmess 1000 --debugcontent --f1f2 INBOX=INBOX.Fake \
- | egrep 'From:|To:|Subject:|Date:|=====|msg '
- }
- ll_acl() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --syncacl # --debugimap # --dry
- }
- l_office365_acl()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX.few_emails --syncacl --dry --debugimap
- }
- ll_namespace_debugimap() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debugimap1 --justfolderlists
- }
- ll_host_sanitize() {
- $CMD_PERL ./imapsync \
- --host1 " local /host " --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 ' loc alhost/ ' --user2 titi \
- --passfile2 ../../var/pass/secret.titi --justlogin
- }
- ll_skipcrossduplicates() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --skipcrossduplicates --debugcrossduplicates
- }
- ll_append_debugimap() {
- sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --maxage 1 --debugimap2 --nofoldersizes
- }
- ll_diff() {
- # sendtestmessage
- CMD_IMAPSYNC=./imapsync_old ll_tee LOG_imapsync/ll_diff_1.txt
- # sendtestmessage
- CMD_IMAPSYNC=./imapsync ll_tee LOG_imapsync/ll_diff_2.txt
-
- diff LOG_imapsync/ll_diff_1.txt LOG_imapsync/ll_diff_2.txt
- }
- ll_tee() {
- logfile=${1:-"LOG_imapsync/ll_tee.txt"}
- $CMD_PERL $CMD_IMAPSYNC \
- --host1 $HOST1 --user1 tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --password1 wrong | tee $logfile
- # --passfile1 ../../var/pass/secret.tata \
- }
- ll_minsize()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --minsize 1000000 --folder INBOX
- }
- ll_nosearch()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 nosearch \
- --passfile1 ../../var/pass/secret.nosearch \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- ll_search_larger() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'LARGER 1000' --folder INBOX
- }
- ll_search_keyword() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'KEYWORD NonJunk' --folder INBOX.flagsetSeen --debugflags --debugimap1
- }
- ll_maxsize() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxsize 1000 --folder INBOX
- }
- ll_search_smaller() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'SMALLER 1000' --folder INBOX
- }
- kk_simulong() {
- $CMD_PERL ./imapsync \
- --testslive --simulong 30
- }
- # In mandatory_tests
- ll_sigreconnect_INT() {
- ( $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --sigreconnect INT --simulong 30 \
- --pidfile /tmp/imapsync_tests_ll_sigreconnect_INT.pid
- echo status code when killing itself: $? # status code when killing itself?
- ) &
- echo ; sleep 2; echo ;
- kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
- echo ; sleep 3; echo ;
- kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
- echo ; sleep 3; echo ;
- kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
- sleepenh 0.1
- kill -INT `head -1 /tmp/imapsync_tests_ll_sigreconnect_INT.pid`
- wait
- }
- ll_sigreconnect_CACA() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --sigreconnect CACA --simulong 30
- }
- ll_sigreconnect_none() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --sigreconnect '' --simulong 30
- }
- ll_sigignore_INT() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --sigignore 'INT' --simulong 10
- }
- ll_sigignore_TERM() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --sigignore 'TERM' --simulong 10
- }
- # ABORT tests
- # In mandatory_tests
- ll_abort_pidfile_no_exist()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort --pidfile /noexist \
- --logfile ll_abort_pidfile_no_exist.log
- grep 'Can not read pidfile /noexist' LOG_imapsync/ll_abort_pidfile_no_exist.log
- }
- # In mandatory_tests
- ll_abort_noprocess()
- {
- # The process does not exist so the pidfile is removed so the abort is not done
- # and that is ok.
- echo 99998 > /tmp/imapsync_fake.pid
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort --pidfile /tmp/imapsync_fake.pid \
- --logfile ll_abort_noprocess.log
- grep 'Removing old /tmp/imapsync_fake.pid since its PID 99998 is not running anymore' LOG_imapsync/ll_abort_noprocess.log
- }
- # In mandatory_tests
- ll_abort_not_a_pid_number()
- {
- echo 12345678 > /tmp/imapsync_fake.pid
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort --pidfile /tmp/imapsync_fake.pid \
- --logfile ll_abort_not_a_pid_number.log
- grep 'pid 12345678 in /tmp/imapsync_fake.pid is not a pid number' LOG_imapsync/ll_abort_not_a_pid_number.log
- }
- # In mandatory_tests
- ll_abort_basic()
- {
- rm -f LOG_imapsync/imapsync_abortme.log
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/imapsync_abortme.pid \
- --logfile imapsync_abortme.log --simulong 4 &
-
- pid_imapsync_abortme=$!
- sleep 2
- # --abort send QUIT signal
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort --pidfile /tmp/imapsync_abortme.pid \
- --logfile imapsync_aborter.log
-
- egrep 'Process PID .* ended.' LOG_imapsync/imapsync_aborter.log || return 1
- wait $pid_imapsync_abortme
- STATUS_pid_imapsync_abortme="$?"
- #test "$?" = "$EXIT_BY_SIGNAL" || return 1
- test "$STATUS_pid_imapsync_abortme" = "$EXIT_BY_SIGQUIT" || test "$STATUS_pid_imapsync_abortme" = "$EXIT_BY_SIGKILL" || return 1
- grep 'Killing myself with signal QUIT' LOG_imapsync/imapsync_abortme.log || return 1
- }
- # In mandatory_tests
- ll_abort_byfile_hand_made()
- {
- rm -f LOG_imapsync/imapsync_abortme.log
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_byfile_hand_made.pid --pidfilelocking \
- --logfile ll_abort_byfile_hand_made.log --simulong 4 &
- pid_imapsync_background=$!
- sleep 4
- touch "/tmp/ll_abort_byfile_hand_made.pidabort$pid_imapsync_background"
- wait $pid_imapsync_background
- test "$?" = "$EXIT_BY_FILE" || return 1
- ! test -f "/tmp/ll_abort_byfile_hand_made.pidabort$pid_imapsync_background" || return 1
- }
- # In mandatory_tests
- ll_abort_byfile_imapsync_made()
- {
- rm -f LOG_imapsync/ll_abort_byfile_imapsync_made.log
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_byfile_imapsync_made.pid --pidfilelocking \
- --logfile ll_abort_byfile_imapsync_made.log --simulong 6 --justbanner &
- pid_imapsync_background_2=$!
- sleep 3
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_byfile_imapsync_made.pid --pidfilelocking \
- --logfile ll_abort_byfile_imapsync_made_aborter.log --abortbyfile
- wait $pid_imapsync_background_2
- test "$?" = "$EXIT_BY_FILE" || return 1
- ! test -f "/tmp/imapsync_abortme_byfile.pidabort$pid_imapsync_background_2" || return 1
- }
- # In mandatory_tests
- ll_abort_byfile_normal_run()
- {
- rm -f LOG_imapsync/ll_abort_byfile_normal_run.log
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_byfile_normal_run.pid --pidfilelocking \
- --logfile ll_abort_byfile_normal_run.log --folder INBOX &
- pid_imapsync_background_3=$!
- sleep 3
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_byfile_normal_run.pid --pidfilelocking \
- --logfile ll_abort_byfile_normal_run_aborter.log --abortbyfile
- wait $pid_imapsync_background_3
- test "$?" = "$EXIT_BY_FILE" || return 1
- ! test -f "/tmp/imapsync_abortme_byfile.pidabort$pid_imapsync_background_3" || return 1
- }
- # In mandatory_tests
- ll_abort_cgi_context_tail() {
- # --tail mechanism will not be executed because --pidfile is not already created when tail is called.
- rm -f LOG_imapsync/imapsync_abortme.log
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --pidfile /tmp/ll_abort_cgi_context_tail.pid --pidfilelocking --tail \
- --logfile ll_abort_cgi_context_tail.log --simulong 4 &
-
- sleep 2
- # --tail will be ignored because of --abort
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort --pidfile /tmp/ll_abort_cgi_context_tail.pid --pidfilelocking --tail \
- --logfile ll_abort_cgi_context_tail_aborter.log
-
- egrep 'Process PID .* ended.' LOG_imapsync/ll_abort_cgi_context_tail_aborter.log || return 1
- grep 'Killing myself with signal QUIT' LOG_imapsync/ll_abort_cgi_context_tail.log || return 1
- }
- # In mandatory_tests
- ll_abort_no_pidfile_option() {
- # The final grep has to be fresh
- rm -f LOG_imapsync/ll_abort_no_pidfile_option.log
-
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --logfile ll_abort_no_pidfile_option.log &
-
- sleep 10
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --abort \
- --logfile ll_abort_no_pidfile_option_aborter.log
-
-
- egrep 'Process PID .* ended.' LOG_imapsync/ll_abort_no_pidfile_option_aborter.log || return 1
- grep 'Killing myself with signal QUIT' LOG_imapsync/ll_abort_no_pidfile_option.log || return 1
- }
- abort_tests()
- {
- ll_abort_pidfile_no_exist \
- && ll_abort_noprocess \
- && ll_abort_not_a_pid_number \
- && ll_abort_basic \
- && ll_abort_cgi_context_tail \
- && ll_abort_no_pidfile_option \
- && ll_abort_byfile_hand_made \
- && ll_abort_byfile_imapsync_made \
- && ll_abort_byfile_normal_run
- }
- ll_simulong() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justbanner --simulong 5
- }
- ll_nouid1() {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nouid1 --folder INBOX # --debugimap1
- }
- ll_eta() {
- can_send && sendtestmessage
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX
- }
- ll_final_diff() {
- can_send && sendtestmessage
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --f1f2 INBOX=INBOX.final_diff --maxage 30
- }
- ll_with_flags_errors() {
- can_send && sendtestmessage
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --maxage 300 \
- --regexflag 's/.*/PasGlop \\PasGlopRe/' --errorsmax 5
- test "$EXIT_ERR_FLAGS" = "$?"
- }
- ll_errorsmax() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes --folder INBOX.errors --regexflag 's/.*/PasGlop \\PasGlopRe/' --errorsmax 5 \
- | grep 'Maximum number of errors 5 reached'
- #--pipemess 'grep lalalala' --nopipemesscheck --dry --debugcontent --debugflags
- #test "$EXIT_WITH_ERRORS_MAX" = "$?" # no longer used since errors classification
- #test "$EXIT_ERR_FLAGS" = "$?"
- }
- ll_debug()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debug
- }
- ll_debugcontent() {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debugcontent --maxage 1 --folder INBOX --dry --nodry1
- }
- ll_debug_FETCH_BODY() {
- #can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debugimap1 --maxage 1 --folder INBOX --dry --nodry1
- }
- ll_debugmemory() {
- sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debugmemory --nofoldersizes --folder INBOX
- }
- ll_justfolderlists()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --checkselectable --justfolderlists
- }
- ll_checkselectable()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --checkselectable --debugimap1 --justfolderlists \
- | grep 'is selectable'
- }
- ll_nocheckselectable()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nocheckselectable --justfolderlists \
- | grep 'Not checking that .*wanted folders are selectable'
- }
- ll_checkselectable_nb_folders()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolderlists | grep 'Not checking that .* wanted folders are selectable'
- }
-
- ll_checkfoldersexist()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --checkfoldersexist --debug --justfolderlists \
- | grep -i 'checking'
- }
- ll_nocheckfoldersexist()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nocheckfoldersexist --justfolderlists \
- | grep -i 'Not checking that wanted folders exist'
- }
- ll_nofoldersizes()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes --folder INBOX
- }
- ll_nofoldersizes_foldersizesatend()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes --foldersizesatend --folder INBOX
- }
- pidfile_well_removed() {
- $CMD_PERL ./imapsync \
- --justbanner \
- --pidfile /var/tmp/imapsync.pid
- test "$?" = "$EX_OK" || return 1
- ! test -f /var/tmp/imapsync.pid
- }
- pidfile_bad() {
- $CMD_PERL ./imapsync \
- --justbanner \
- --pidfile /var/tmp/noexist/imapsync.pid
- test "$?" = "$EXIT_PID_FILE_ERROR"
- }
- ll_skipcrossduplicates_usecache() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --skipcrossduplicates --usecache
- test "$?" = "$EX_USAGE"
- }
- test_tail() {
- $CMD_PERL ./imapsync \
- --justbanner --simulong 15 \
- --pidfile /var/tmp/imapsync_tail_tests.pid \
- --pidfilelocking &
-
- sleep 1
-
- $CMD_PERL ./imapsync \
- --justbanner \
- --pidfile /var/tmp/imapsync_tail_tests.pid \
- --pidfilelocking --tail
- }
- ll_pidfilelocking() {
- rm -f /var/tmp/imapsync_test_pidfilelocking.pid
- echo ll_pidfilelocking 01 lockfile is not previously there
- $CMD_PERL ./imapsync --justbanner \
- --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
- --pidfilelocking || return 1
- echo ll_pidfilelocking 02 lockfile normally removed
- ! test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
- echo ll_pidfilelocking 03 lockfile created before
- touch /var/tmp/imapsync_test_pidfilelocking.pid || return 1
-
- echo ll_pidfilelocking 04 lockfile already there but not with a PID number
- ! $CMD_PERL ./imapsync --justbanner \
- --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
- --pidfilelocking || return 1
- echo ll_pidfilelocking 05 lockfile still there
- test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
-
- echo ll_pidfilelocking 06 filling lockfile with 33333
- echo 33333 > /var/tmp/imapsync_test_pidfilelocking.pid
-
- echo ll_pidfilelocking 07 lockfile already there with fake PID in it, imapsync will remove it and generate a new one.
- $CMD_PERL ./imapsync --justbanner \
- --pidfile /var/tmp/imapsync_test_pidfilelocking.pid \
- --pidfilelocking || return 1
-
- echo ll_pidfilelocking 08 lockfile should be removed now
- ! test -f /var/tmp/imapsync_test_pidfilelocking.pid || return 1
- }
- justbanner() {
- $CMD_PERL ./imapsync \
- --justbanner
- }
- nomodules_version() {
- $CMD_PERL ./imapsync \
- --justbanner \
- --nomodules_version
- }
- ll_ask_password() {
- {
- sleep 2; cat ../../var/pass/secret.tata;
- sleep 2; cat ../../var/pass/secret.titi;
- } | \
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --host2 $HOST2 --user2 titi \
- --justlogin
- }
- ll_env_password() {
- set +x
- IMAPSYNC_PASSWORD1=`cat ../../var/pass/secret.tata` \
- IMAPSYNC_PASSWORD2=`cat ../../var/pass/secret.titi` \
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --host2 $HOST2 --user2 titi --passfile2 ../../var/pass/secret.titi \
- --justlogin
- }
- ll_authmech_PREAUTH() {
- # No PREAUTH on my box
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata --authmech1 PREAUTH \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --debugimap1
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE"
- }
- ll_unknow_option() {
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --unknow_option
- }
- ll_timeout() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --timeout 4.99 --justlogin
- }
- ll_timeout1_timeout2() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --timeout1 1.99 --timeout2 1.95 --justlogin
- }
- ll_timeout_timeout1() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --timeout1 5 --timeout 4 --justlogin
- }
- ll_timeout_very_small() {
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --timeout 0.001 --nossl1 --nossl2 --notls1 --notls2 --justlogin
- }
- ll_folder() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.yop --folder INBOX.Trash
- }
- ll_backstar() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder 'INBOX.backstar\*' --dry --justfolders --debugimap1 --regextrans2 's#\\|\*#_#g'
- }
- ll_star() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder 'INBOX.star*' --justfolders --debugimap
- }
- ll_star_ch() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folderrec 'INBOX.Z_ch' --justfolders --debugimap
- }
- ll_tr() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --dry --justfolders --include a --regextrans2 'tr/a/_/'
- }
- ll_tr_delete() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --dry --justfolders --folder INBOX.lalala --regextrans2 'tr/a//d'
- }
- ll_regextrans2_d() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --dry --justfolders --regextrans2 's,INBOX\.,,'
- }
- lks_trailing_space() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 ks.lamiral.info --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --justfolders --ssl1 --ssl2
- }
- lks_doublequote() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 ks.lamiral.info --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder 'INBOX."uni"' --debugimap2 --nofoldersizes --justfolders --ssl1 --ssl2
- }
- lks_doublequote_rev() {
- $CMD_PERL ./imapsync \
- --host1 ks.lamiral.info --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --foldersizes --ssl1 --ssl2 --justfolders
- }
- ksks_password_doublequote() {
- $CMD_PERL ./imapsync \
- --host1 ks.lamiral.info --user1 test1 \
- --password1 'secret1' \
- --host2 ks.lamiral.info --user2 test1 \
- --password2 '"secret1"' \
- --debugimap --justlogin --showpasswords
- }
- ksks_empty_test1()
- {
- $CMD_PERL ./imapsync \
- --host1 test1.lamiral.info --user1 test1 \
- --password1 'secret1' \
- --host2 test1.lamiral.info --user2 test1 \
- --password2 'secret1' \
- --delete1 --delete1emptyfolders
- }
- ksks_init_test1()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 test1.lamiral.info --user2 test1 \
- --password2 'secret1' \
- --folder INBOX.init --f1f2 INBOX.init=INBOX \
- --folderrec 'INBOX.init'
- }
- # In mandatory_tests
- ksks_reset_test1()
- {
- ksks_empty_test1
- ksks_init_test1
- }
- ksks_empty_test2() {
- $CMD_PERL ./imapsync \
- --host1 test2.lamiral.info --user1 test2 \
- --password1 'secret2' \
- --host2 test2.lamiral.info --user2 test2 \
- --password2 'secret2' \
- --delete1 --delete1emptyfolders
- }
- 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
- }
- ll_folder_mixfolders() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --mixfolders --justfolders --nofoldersizes
- }
- # Way to check it each time:
- # sh -x tests.sh ll_folder_create ll_delete2folders
- # In mandatory_tests
- 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/new.nested.yop/' \
- --justfolders
- }
- # In mandatory_tests
- ll_folder_create_INBOX_Inbox() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --regextrans2 's/INBOX/Inbox/' \
- --justfolders --nofoldersizes
- }
- ll_folder_create_backslash_backslash() {
- $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.yip --regextrans2 's/yop/newyop/' \
- --sep2 '\\' \
- --justfolders --nofoldersizes --dry
- }
- ll_folder_domino() {
- $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.yip --regextrans2 's/yop/newyop/' \
- --sep2 '\' --prefix2 '' --prefix1 '' \
- --regextrans2 's,^Inbox\\(.*),$1,i' \
- --justfolders --dry --debug
- }
- ll_folder_domino_sub() {
- $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.yip --regextrans2 's/yop/newyop/' \
- --sep2 '\' --prefix2 '' \
- --subfolder2 'OLDBOX' \
- --justfolders --dry --debug
- }
- # In mandatory_tests
- ll_domino2() {
- $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.yip --regextrans2 's/yop/newyop/' \
- --domino2 \
- --subfolder2 'OLDBOX' \
- --justfolders --dry --debug
- }
- # In mandatory_tests
- ll_domino1_domino2() {
- $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.yip --regextrans2 's/yop/newyop/' \
- --domino1 --domino2 \
- --subfolder2 'OLDBOX' \
- --justfolders --dry
- }
- ll_oneemail() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --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 --justlogin
- }
- ll_few_emails() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails
- }
- ll_few_emails_dev() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --nofoldersizes
- }
- ll_pipemess() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --pipemess 'cat' --pipemess 'reformime -r7'
- cmd_status=$?
- echo "sudo rm -rf /home/vmail/titi/.few_emails/"
- return $cmd_status
- }
- ll_pipemess_catcat() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --pipemess '(cat|cat)' --pipemess 'reformime -r7'
- cmd_status=$?
- echo "sudo rm -rf /home/vmail/titi/.few_emails/"
- return $cmd_status
- }
- ll_pipemess_nocmd() {
-
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --pipemess 'nocat'
-
- echo "sudo rm -rf /home/vmail/titi/.few_emails/"
- }
- ll_pipemess_false() {
-
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --pipemess '/bin/false' --nopipemesscheck
-
- echo "sudo rm -rf /home/vmail/titi/.few_emails/"
- }
- ll_pipemess_true() {
-
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --pipemess '/bin/true'
-
- echo "sudo rm -rf /home/vmail/titi/.few_emails/"
- }
- ll_size_null() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.size_null
- }
- # In mandatory_tests
- ll_noheader() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --useheader '' --debug
- }
- # In mandatory_tests
- ll_noheader_force() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails \
- --useheader '' \
- --skipheader 'Message-Id|Date'
- }
- ll_addheader() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.addheader --delete2
-
- # destination should be empty
- ! ls /home/vmail/titi/.addheader/cur/* || return 1
-
-
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.addheader --delete2 --addheader
-
- # Now it should be not empty
- ls /home/vmail/titi/.addheader/cur/* || return 1
- }
- ll_addheader_minage() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.addheader --delete2
-
- # destination should be empty
- ! ls /home/vmail/titi/.addheader/cur/* || return 1
-
-
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.addheader --delete2 --addheader --minage 365 --debugimap
-
- # Now it should be not empty
- ls /home/vmail/titi/.addheader/cur/* || return 1
- }
- ll_usecachemaxage() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --useuid --maxage 3
- }
- ll_folderrec() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folderrec INBOX.yop --justfolders
- }
- ll_folderrec_INBOX() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folderrec INBOX --justfolders
- }
- ll_folderrec_star() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folderrec 'INBOX.yop.*' --justfolders
- }
- ll_change_blank() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes --folder "INBOX. blanc_begin" --regextrans2 "s,(\.|^) +,\$1,g"
- }
- 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() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --buffersize 8
- }
- ll_automap() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justautomap --automap
- }
- ll_justautomap() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justautomap
- }
- l_ks_automap() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 test2.lamiral.info --user2 test2 \
- --password2 secret2 \
- --justautomap --automap
- }
- l_gmail_automap() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justautomap --automap --dry
- }
- gmail_l_automap() {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justautomap --automap --dry
- }
- ll_justfolders() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders
- echo "sudo rm -rf /home/vmail/titi/.new_folder/"
- }
- ll_create_folder_New1()
- {
- ./W/learn/create_folder localhost tata `cat ../../var/pass/secret.tata` INBOX.New1 INBOX.New1.New1 INBOX.New1.New1.New1
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --include New1 --folderfirst INBOX.New1.New1
- }
- ll_delete_folder_New1()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --include New1 --folderfirst INBOX.New1.New1 --delete1emptyfolders --delete1
-
- }
- ll_create_folder_encoding_accent()
- {
- ./W/learn/create_folder localhost tata `cat ../../var/pass/secret.tata` INBOX.New1 'INBOX.New1.E&AwE-le&AwE-ments envoye&AwE-s' 'INBOX.New1.&AMk-l&AOk-ments envoy&AOk-s'
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --include New1
- }
- ll_create_folder_encoding_accent_365()
- {
- #./W/learn/create_folder localhost tata `cat ../../var/pass/secret.tata` 'INBOX.E&AwE-le&AwE-ments envoye&AwE-s' 'INBOX.&AMk-l&AOk-ments envoy&AOk-s'
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justfolders --include 'ments envoy' --automap --exclude New1
- }
- ll_justfolders_delete1emptyfolders() {
- ./W/learn/create_folder localhost tata `cat ../../var/pass/secret.tata` INBOX.Empty INBOX.Empty.Empty INBOX.Empty.Empty.Empty
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --delete1emptyfolders --include Empty --folder INBOX --folderfirst INBOX.Empty.Empty --foldersizes
- }
- ll_delete1_delete1emptyfolders() {
- ./W/learn/create_folder localhost tata `cat ../../var/pass/secret.tata` INBOX.Empty INBOX.Empty.Empty INBOX.Empty.Empty.Empty
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --delete1emptyfolders --delete1 --include Empty --folder INBOX --folderfirst INBOX.Empty.Empty --dry
- }
- ll_justfolders_skipemptyfolders() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --skipemptyfolders \
- --folder INBOX.empty --folder INBOX.notempty
- }
- ll_justfolders_folderfirst_noexist() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes --justfolders --folderfirst noexist --debug
- }
- ll_justfolders_foldersizes()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders
- echo "sudo rm -rf /home/vmail/titi/.new_folder/"
- }
- # In mandatory_tests
- ll_delete2foldersonly_dry()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes \
- --subfolder2 NEW --delete2foldersonly NEW --dry
- }
- # In mandatory_tests
- ll_delete2foldersonly_subfolder2()
- {
- ./W/learn/create_folder localhost titi `cat /g/var/pass/secret.titi` INBOX.NEW_2
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes \
- --subfolder2 NEW_2 \
- --delete2foldersonly NEW_2 --folder INBOX --debug
- # NEW_2 should be still there because of --subfolder2 NEW_2
- test -d /home/vmail/titi/.NEW_2/ || return 1
- }
- # In mandatory_tests
- 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 'm{NEW_2|NEW_3|\[abc\]}' \
- --dry
- }
- # In mandatory_tests
- ll_delete2foldersonly_NEW_3()
- {
- $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,^INBOX.oneemail$,INBOX.NEW_3.oneemail,' \
- --regextrans2 's,^INBOX.oneemail2$,INBOX.NEW_3.oneemail2,'
- test -d /home/vmail/titi/.NEW_3.oneemail/ || return 1
- test -d /home/vmail/titi/.NEW_3.oneemail2/ || return 1
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes \
- --include 'rrrrr' \
- --delete2foldersonly '/^INBOX.NEW_3.oneemail$/'
- ! test -d /home/vmail/titi/.NEW_3.oneemail/ || return 1
- test -d /home/vmail/titi/.NEW_3.oneemail2/ || return 1
- }
- ll_delete2foldersonly_bug() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes \
- --include 'rrrrr' \
- --delete2foldersonly '/INBOX.Archive/' --dry
- # --delete2foldersonly '/^INBOX.Archive$/' --dry
- }
- # In mandatory_tests
- ll_delete2folders()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --nofoldersizes \
- --delete2folders
- ! test -d /home/vmail/titi/.NEW_3/ || return 1
- }
- ll_bug_folder_name_with_blank() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --fast
- echo "rm -rf /home/vmail/titi/.bugs/"
- }
- ll_bug_folder_name_with_backslash() {
- # Bug with Mail-IMAPClient-2.2.9
- # Fixed using Mail-IMAPClient-3.28
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --fast
- # --folder "INBOX.yop.jj\\kk"
- # --folder '"INBOX.yop.jj\kk"' --debug --debugimap --regextrans2 's,\\,_,g'
- # --folder "INBOX.yop.jj\\kk" --debug --debugimap1
- echo "sudo rm -rf '/home/vmail/titi/.yop.jj\\kk'"
- }
- ll_prefix12() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.qqq \
- --prefix1 INBOX.\
- --prefix2 INBOX.
- }
- ll_nosyncinternaldates() {
- can_send && sendtestmessage toto
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 toto \
- --passfile1 ../../var/pass/secret.toto \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --nosyncinternaldates --delete2
- }
- # bug:
- # $d=""; # no bug with $d=undef
- # $imap2->append_string($h2_fold,$string, $h1_flags, $d);
- # 3.25 idate : Sending: 16 APPEND INBOX () "16-Jul-2010 22:09:42 +0200" {428}
- # 2.xx idate : Sending: 62 APPEND INBOX "16-Jul-2010 22:14:00 +0200" {428}
- # 3.25 noidate: Sending: 16 APPEND INBOX () "" {428} # Fails: NO IMAP!
- # 2.xx noidate: Sending: 62 APPEND INBOX {428}
- ll_idatefromheader() {
- # can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.oneemail2 \
- --idatefromheader --debug --dry
- }
- ll_idatefromheader_barker() {
- # can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.europe.secureserver.net --user2 test@alicebarkertest.com \
- --passfile2 ../../var/pass/secret.barker \
- --folder INBOX.oneemail2 --nofoldersizes \
- --debug --useheader ALL
- }
- ll_folder_rev() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX.yop
- }
- ll_subscribed()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --subscribed
- }
- ll_nosubscribe()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --subscribed --nosubscribe
- }
- ll_justconnect()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --justconnect --debugimap
- }
- ll_justconnect_ipv6()
- {
- $CMD_PERL ./imapsync \
- --host1 "::1" \
- --host2 "::1" \
- --justconnect
- }
- ll_justconnect_ipv6_nossl()
- {
- $CMD_PERL ./imapsync \
- --host1 "::1" --nossl1 \
- --host2 "::1" --nossl2 \
- --justconnect
- }
- ks_justconnect_ipv6()
- {
- $CMD_PERL ./imapsync \
- --host1 ks2ipv6.lamiral.info \
- --host2 ks2ipv6.lamiral.info \
- --justconnect
- }
- ks_justconnect_ipv6_nossl()
- {
- $CMD_PERL ./imapsync \
- --host1 ks2ipv6.lamiral.info --nossl1 \
- --host2 ks2ipv6.lamiral.info --nossl2 \
- --justconnect
- }
- ll_justfoldersizes()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --nocheckfoldersexist --nocheckselectable \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes # --folder INBOX
- }
- ll_justfoldersizes_all_to_INBOX()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --nocheckfoldersexist --nocheckselectable \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --regextrans2 's/.*/INBOX/'
- }
- ll_justfoldersizes_case_different()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nocheckfoldersexist --nocheckselectable \
- --justfoldersizes --folder NoExist --folder INBOX --regextrans2 's,^INBOX$,iNbOx,'
- }
- ll_justfoldersizes_case_different_2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --folder INBOX.yop --regextrans2 's,yop,YoP,'
- }
- ll_justfoldersizes_noexist()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --folder NoExist --folder AnotherNoExist \
- --nocheckfoldersexist --errorsmax 2
- }
- ll_reconnect_on_signal_debugimap()
- {
- # in another terminal:
- #
- : <<'EOF'
- while echo ENTER TO STOP; read a ; do
- killall --signal STOP -v -u vmail imapd
- echo ENTER to CONT; read a
- killall --signal CONT -v -u vmail imapd
- done
- EOF
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --debugsleep 3.5 --debugimap
- }
- ll_reconnect_on_signal()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- ll_dev_reconnect_none()
- {
- # in another terminal:
- #
- : <<'EOF'
- while :; do
- killall -v -u vmail imapd;
- RAND_WAIT=`numrandom .1..5i.1`
- echo sleeping $RAND_WAIT
- sleepenh $RAND_WAIT
- done
- # or
- while read y; do
- killall -v -u vmail imapd
- done
- EOF
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --useuid \
- --reconnectretry2 0 --reconnectretry1 0
- }
- ll_dev_reconnect_one()
- {
- # in another root terminal:
- #
- : <<'EOF'
- while read y; do
- killall -v -u vmail imapd
- done
- EOF
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --useuid \
- --reconnectretry2 1 --reconnectretry1 1
- }
- ll_dev_reconnect_ssl_tls()
- {
- # in another terminal:
- #
- : <<'EOF'
- while :; do
- killall -v -u vmail imapd;
- RAND_WAIT=`numrandom .1..5i.1`
- echo sleeping $RAND_WAIT
- sleepenh $RAND_WAIT
- done
- # or
- while read y; do
- echo ENTER to kill all imapd
- killall -v -u vmail imapd;
- done
- EOF
- can_send && sendtestmessage
- # can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --ssl1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --tls2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --useuid \
- --delete2
- }
- ll_dev_reconnect_tls()
- {
- # in another terminal:
- #
- : <<'EOF'
- while :; do
- killall -v -u vmail imapd;
- RAND_WAIT=`numrandom .1..5i.1`
- echo sleeping $RAND_WAIT
- sleepenh $RAND_WAIT
- done
- # or
- while read y; do
- echo ENTER to kill all imapd
- killall -v -u vmail imapd;
- done
- EOF
- can_send && sendtestmessage
- # can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --tls1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --tls2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --useuid \
- --delete2 --debugsleep 5 --debugimap
- }
- ll_authmd5()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --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 \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --noauthmd5
- }
- ll_maxage()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 1 --folder INBOX
- }
- ll_maxage_0()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 0 --folder INBOX
- }
- ll_maxage_0_float_1min()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 0.0006944 --folder INBOX --noabletosearch
- }
- ll_minage_0()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --minage 0 --folder INBOX
- }
- ll_maxage_10000_minage_9999()
- {
- # INTERSECTION: 0 messages
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 10000 --minage 9999 \
- --folder INBOX --justfoldersizes
- }
- ll_maxage_9999_minage_10000()
- {
- # UNION: all messages
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 9999 --minage 10000 \
- --folder INBOX --justfoldersizes
- }
- ll_maxage_10000_minage_9999_noabletosearch()
- {
- # INTERSECTION: 0 messages
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 10000 --minage 9999 \
- --folder INBOX --justfoldersizes --noabletosearch
- }
- ll_maxage_9999_minage_10000_noabletosearch()
- {
- # UNION: all messages
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 9999 --minage 10000 \
- --folder INBOX --justfoldersizes --noabletosearch
- }
- ll_maxage_10000()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 10000 --folder INBOX
- }
- ll_maxage_0_debugimap2()
- {
- #can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 0 --folder INBOX --debugimap2 --nofoldersizes
- }
- ll_search_ALL()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'ALL' --folder INBOX
- }
- ll_search1_NOT_OR_OR_UID()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search1 'NOT OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
- }
- ll_search1_OR_OR_UID()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search1 'OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
- }
- ll_search2_NOT_OR_OR_UID()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search2 'NOT OR OR UID 20000 UID 20002 UID 20004' --folder INBOX
- }
- ll_search_FLAGGED()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'FLAGGED' --folder INBOX
- }
- ll_search_NOT_DELETED()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'NOT DELETED' --folder INBOX
- }
- ll_search_SENTSINCE()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'SENTSINCE 11-Jul-2011' --folder INBOX
- }
- ll_search_BEFORE_delete2_useuid()
- {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'BEFORE 29-Sep-2011' --folder INBOX --delete2 --useuid
- }
- ll_search_SENTBEFORE()
- {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'SENTBEFORE 31-Dec-2013' --folder INBOX --delete2
- }
- ll_search_SENTSINCE_and_BEFORE()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2013' --folder INBOX --delete2 --dry
- }
- ll_search_SENTSINCE_and_BEFORE_search2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search 'SENTSINCE 1-Jan-2010 SENTBEFORE 31-Dec-2013' \
- --search2 'ALL' --folder INBOX --delete2
- }
- ll_search_HEADER_attachment()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "OR HEADER Content-Disposition attachment HEADER Content-Type multipart/mixed" \
- --folder INBOX
- }
- ll_search_NOT_HEADER_attachment()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "NOT OR HEADER Content-Disposition attachment HEADER Content-Type multipart/mixed" \
- --folder INBOX
- }
- ll_search_HEADER_attachment_multipart()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "HEADER Content-Type multipart/mixed" \
- --folder INBOX
- }
- ll_search_NOT_SUBJECT()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "NOT SUBJECT test:" \
- --folder INBOX
- }
- ll_search_UNSEEN_SENTSINCE()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "UNSEEN SENTSINCE 23-Aug-2015" \
- --folder INBOX --dry
- }
- ll_search_FROM_TO_CC()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --dry --search 'OR FROM gilles@localhost (OR TO gilles@localhost (CC gilles@localhost))'
- }
- ll_search_FROM()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --dry --search 'FROM gilles@localhost'
- }
- ll_maxage_nonew()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 1 --nofoldersizes \
- --folder INBOX.few_emails
- }
- ll_noabletosearch()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --noabletosearch
- # --debugdev --debugimap
- }
- ll_fetch_hash_set()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --justfoldersizes --noabletosearch --fetch_hash_set '1:*'
- # --debugdev --debugimap
- }
- ll_fetch_hash_set_abletosearch()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --justfoldersizes --abletosearch --fetch_hash_set '1:*'
- # --debugdev --debugimap
- }
- ll_noabletosearch1()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --noabletosearch1 --debugimap
- }
- ll_noabletosearch2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.few_emails --noabletosearch2 --debugimap
- }
- ll_newmessage()
- {
- can_send && sendtestmessage
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 1 --folder INBOX --nofoldersizes \
- --debugLIST
- }
- ll_debugLIST()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofoldersizes \
- --debugLIST
- }
- ll_search_UID()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofoldersizes \
- --debugLIST --search1 "UID 10000:20000"
- }
- ll_exitwhenover()
- {
- sendtestmessage
- sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 1 --folder INBOX --nofoldersizes \
- --exitwhenover 100
- test "$EXIT_TRANSFER_EXCEEDED" = "$?"
- }
- ll_exitwhenover_noerrorsdump()
- {
- sendtestmessage
- sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxage 1 --folder INBOX --nofoldersizes \
- --exitwhenover 100 --noerrorsdump
- test "$EXIT_TRANSFER_EXCEEDED" = "$?"
- }
- ll_folder_INBOX()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --noreleasecheck --usecache --delete2
- }
- ll_dry_folder_missing()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --dry --regextrans2 "s,^INBOX$,noexit,"
- }
- ll_maxage_9999()
- {
- # can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --folder INBOX \
- --maxage 9999
- }
- ll_maxlinelength()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxlinelength 8 --nofoldersizes --folder INBOX
- }
- ll_maxlinelengthcmd()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxlinelength 8 --maxlinelengthcmd cat --nofoldersizes --folder INBOX
- }
- ll_minmaxlinelength()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --minmaxlinelength 1000 --nofoldersizes --folder INBOX
- }
- ll_maxlinelength_prepa_1()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --folderrec INBOX.Junk --foldersizes --justfolders \
- --usecache --tmpdir /var/tmp --minmaxlinelength 8000 --debugmaxlinelength
- }
- ll_maxlinelength_prepa_2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tete@est.belle \
- --passfile1 ../../var/pass/secret.tete \
- --host2 ks.lamiral.info --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --ssl2 \
- --include INBOX.Junk.20 --foldersizes --nojustfolders \
- --useuid --tmpdir /var/tmp --minmaxlinelength 10 --delete2 --nofastio1 --nofastio2
- }
- ll_maxsize()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxsize 10 --folder INBOX
- }
- ll_maxsize_useuid()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --maxsize 10 --folder INBOX \
- --useuid --debugcache
- }
- ll_minsize_useuid()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --useuid --debugLIST --minsize 500 --maxage 1
- }
- ll_skipsize()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --skipsize --folder INBOX.yop.yap
- }
- ll_skipheader()
- {
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --useheader ALL \
- --skipheader '^X-.*|^Date' --folder INBOX.yop.yap \
- --debug --dry
- }
- ll_include()
- {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage
- else
- :
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --include '^INBOX.yop'
- }
- ll_include_include()
- {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage
- else
- :
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes \
- --include '^INBOX.yop' --include '^INBOX.'
- }
- ll_include_exclude()
- {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage
- else
- :
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes \
- --include '^INBOX.yop' --exclude '^INBOX.'
- }
- ll_exclude()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --exclude '^(?i)INBOX.YOP' --justfolders --nofoldersizes
- }
- ll_exclude_2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --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_exclude_blanc_middle()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --exclude '^INBOX.blanc\smiddle' --justfolders --nofoldersizes --dry
- }
- ll_f1f2_01()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --folder 'INBOX.yop.yap' --f1f2 'INBOX.yop.yap=INBOX/rha/lovely' --f1f2 'lalala=lululu' --debugfolders
- test "$EXIT_ERR_CREATE" = "$?"
- }
- ll_regextrans2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --regextrans2 's/yop/yoX/' \
- --folder 'INBOX.yop.yap' --debug
- }
- ll_add_suffix()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --regextrans2 's,$,\@easterngraphics.com,' \
- --folderrec 'INBOX.yop' --dry --justfolders
- }
- ll_regextrans2_ucfirst_downcase_last_folder()
- {
- # lowercase the last basename part
- # [INBOX.yop.YAP] -> [INBOX.yop.Yap] using re
- # [INBOX.yop.YAP] -> [INBOX.yop.Yap]
- # \l lowercase next char (think vi)
- # \u uppercase next char (think vi)
- # \L lowercase till \E (think vi)
- # \U uppercase till \E (think vi)
- # \E end case modification (think vi)
- # \Q quote (disable) pattern metacharacters till \E
- $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,(.*)\.(.+)$,$1.\u\L$2\E,' \
- --folder 'INBOX.yop.YAP' --justfolders --debug --dry
- }
- ll_regextrans2_ucfirst_downcase_all_folders()
- {
- # lowercase the last basename part
- $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,([^.]+),\u\L$1\E,g' \
- --folder 'INBOX.yop.YAP' --justfolders --debug --dry
- }
- ll_regextrans2_slash()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --nofoldersizes \
- --folder 'INBOX.yop.yap' \
- --sep1 '/' \
- --regextrans2 's,/,_,'
- }
- ll_regextrans2_dot()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --folder 'INBOX.yop.yap' \
- --regextrans2 "s,\.,_,g" --dry
- }
- ll_subfolder2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --foldersizesatend \
- --subfolder2 SUB
- }
- ll_subfolder1()
- {
- # reverse of ll_subfolder2
- $CMD_PERL ./imapsync \
- --host1 $HOST2 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST1 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --justfolders \
- --subfolder1 SUB --dry
- }
- ll_subfolder1_INBOX_SUB()
- {
- # reverse of ll_subfolder2
- $CMD_PERL ./imapsync \
- --host1 $HOST2 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST1 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --justfolders \
- --subfolder1 INBOX.SUB --dry
- }
- ll_subfolder1_DOES_NOT_EXIST()
- {
- # --subfolder1 does not exist
- ! $CMD_PERL ./imapsync \
- --host1 $HOST2 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST1 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --justfolders \
- --subfolder1 DOES_NOT_EXIST --dry
- }
- ll_nochildren()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 w00d0310.kasserver.com --user2 m0331832 \
- --passfile2 ../../var/pass/secret.kasserver \
- --folderrec INBOX.A --subfolder2 inferior_top_level
- }
- ll_regextrans2_remove_space()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders \
- --nofoldersizes \
- --folder 'INBOX.yop.y p' \
- --regextrans2 's, ,,' \
- --dry
- }
- ll_regextrans2_archive_per_month()
- {
- # Bad behavior on Courier
- # SENTBEFORE 31-Apr returns nothing
- # SENTBEFORE 30 Apr returns messages
- year=2012
- month=Apr
- month_n=04
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes \
- --search "SENTSINCE 1-$month-$year SENTBEFORE 30-$month-$year" \
- --regextrans2 "s{.*}{INBOX.Archive.$year.$month_n}"
- }
- ll_regextrans2_archive_per_year_flat_hard_year()
- {
- year=
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes \
- --search "SENTSINCE 1-1-$year SENTBEFORE 30-12-2018" \
- --sep2 _ --regextrans2 's{(.*)}{Archive_$1_2018}' --justfolders --dry
- }
- ll_regextrans2_archive_per_year_flat_variable_year()
- {
- year=2018
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --nofoldersizes \
- --search "SENTSINCE 1-1-$year SENTBEFORE 30-12-$year" \
- --sep2 _ --regextrans2 's{(.*)}{Archive_$1_'"$year}" --justfolders --dry
- }
- ll_regextrans2_ALLIN()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --regextrans2 's/.*/INBOX.ALLIN/' \
- --folderrec 'INBOX.yop' --delete2
- }
- ll_regextrans2_ALLIN_usecache()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --regextrans2 's/.*/INBOX.ALLIN/' \
- --folderrec 'INBOX.yop' --delete2 --usecache --nodelete2duplicates
- }
- ll_regextrans2_ALLIN_fake()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --regextrans2 's/.*/INBOX.ALLIN/' \
- --foldersizes \
- --folderrec 'INBOX.yop' --delete2
- }
- ll_regextrans2_ALLIN_useuid()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --foldersizes \
- --regextrans2 's/.*/INBOX.ALLIN/' \
- --folderrec 'INBOX.yop' --delete2 --useuid
- }
- ll_sep2()
- {
- $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 \
- --sep2 '\\' --dry
- }
- ll_bad_login()
- {
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.toto \
- --host2 $HOST2 --user2 notiti \
- --passfile2 ../../var/pass/secret.titi
-
- }
- ll_authentication_failure_user1() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --password1 wrong \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE_USER1"
- }
- ll_authentication_failure_user2() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --password2 wrong
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE_USER2"
- }
- ll_authentication_failure_user12() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --password1 wrong \
- --host2 $HOST2 --user2 titi \
- --password2 wrong
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE_USER1"
- }
- ll_bad_host1()
- {
- $CMD_PERL ./imapsync \
- --host1 badhostkaka --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- test "$EXIT_CONNECTION_FAILURE_HOST1" = "$?"
-
- }
- ll_bad_host2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 badhostkiki --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- test "$EXIT_CONNECTION_FAILURE_HOST2" = "$?"
- }
- ll_bad_host12()
- {
- $CMD_PERL ./imapsync \
- --host1 badhostkaka --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 badhostkiki --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- test "$EXIT_CONNECTION_FAILURE_HOST1" = "$?"
- }
- ll_bad_host_ssl()
- {
- ! $CMD_PERL ./imapsync \
- --host1 badhost --user1 toto \
- --passfile1 ../../var/pass/secret.toto \
- --host2 badhost --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --ssl2
- }
- ll_useheader()
- {
- $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 'Message-ID' \
- --dry --debug
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_useheader_Received()
- {
- $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 'Received' \
- --dry --debug
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_useheader_Message_ID_Received()
- {
- $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 'Received' --useheader 'Message-ID' \
- --dry --debug
- 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 --addheader
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_skipmess()
- {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage tata
- fi
- sendtestmessage tata
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofoldersizes \
- --skipmess 'm{.*}ism'
- }
- ll_skipmess_8bits()
- {
- if can_send; then
- #echo3 Here is plume
- SUBJ="`echo -e 'xFF:\0277'`"
- sendtestmessage tata "$SUBJ"
- fi
- #return
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofoldersizes --noreleasecheck \
- --skipmess 'm/[\x80-\xff]/'
- }
- ll_skipmess_Content_Type_Message_partial()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.partial --nofoldersizes --noreleasecheck \
- --skipmess 'm{\A((?:[^\n]+\r\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\r\n|.*\r\n\r\n)}ism' --dry --addheader
- echo "sudo rm -rf /home/vmail/titi/.partial/cur/*"
- # --skipmess 'm{\A((?:[^\n]+\n)+|)^Content-Type: Message/Partial;[^\n]*\n(?:\r?\n|.*\r?\n\r?\n)}ism' --dry --addheader
- }
- ll_skipmess_not_From()
- {
- sendtestmessage tata
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofoldersizes \
- --skipmess 'm{\A(?!.*^From:[^\n]*tartanpion\@machin\.truc)}xms'
- }
- ll_regexmess()
- {
- if can_send; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
-
- # \157 is octal for o
- $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 \
- --regexmess 's/\157/O/g' \
- --regexmess 's/p/Z/g' \
- --debug
-
- if can_send; then
- file=`ls -t /home/vmail/titi/.yop.yap/cur/* | tail -1`
- diff ../../var/imapsync/tests/ll_regexmess/dest_01 $file
- echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
- fi
- }
- ll_regexmess_8bit_X()
- {
- if can_send; then
- rm -f /home/vmail/titi/.oneemail/cur/*
- fi
-
- # All f should become X
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.oneemail \
- --regexmess 'tr [f] [\x99]' \
- --regexmess 'tr [\x80-\xff] [X]' \
- --debug
- }
- ll_regexmess_add_CRLF_if_needed()
- {
- if can_send; then
- rm -f /home/vmail/titi/.oneemail/cur/*
- fi
-
- # The first one is to be in the case of missing the last \r\n
- # it actually removes it. The second one is the fix.
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.oneemail \
- --regexmess "s{\r\n\z}{}gxms" \
- --regexmess "s{(?<![\n])\z}{\r\n}gxms" \
- --debug
- }
- ll_regexmess_bad_regex()
- {
- ! $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 \
- --regexmess 'I am BAD'
- }
- ll_regexmess_trailing_NUL()
- {
- if can_send; then
- rm -fv /home/vmail/titi/.NUL_char/cur/*
- echo /home/vmail/tata/.NUL_char/cur/*
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.NUL_char \
- --debugcontent \
- --regexmess 's/(\x00)+\Z//g'
-
- if can_send; then
- file=`ls -t /home/vmail/titi/.NUL_char/cur/* | tail -1`
- diff ../../var/imapsync/tests/ll_regexmess/dest_02_null_removed $file
- #echo 'sudo rm -fv /home/vmail/titi/.NUL_char/cur/*'
- fi
- }
- ll_regexmess_add_header()
- {
- if at_home; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
- $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 \
- --regexmess 's/\A/X-migrated-from-foo: 20100617\n/' \
- --search 'SUBJECT add_some_header_please' \
- --debugcontent
-
- if at_home; then
- file=`ls -t /home/vmail/titi/.yop.yap/cur/* | tail -1`
- diff W/t/07_ll_regexmess_add_header.txt $file || return 1
- echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
- fi
- }
- ll_regexmess_add_header_path()
- {
- if at_home; then
- rm -fv "/home/vmail/titi/.yop.blanc blanc/cur/"*
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder "INBOX.yop.blanc blanc" \
- --regexmess 's/\A/X-ImapSync-OriginalPath-$sync->{user1}: $sync->{ h1_current_folder }\n/' \
- --search 'SUBJECT add_some_header_please' \
- --debugcontent
-
- if at_home; then
- file=`ls -t "/home/vmail/titi/.yop.blanc blanc/cur/"* | tail -1`
- diff W/t/08_ll_regexmess_add_header_path.txt "$file" || return 1
- echo 'sudo rm -fv "/home/vmail/titi/.yop.blanc blanc/cur/"*'
- fi
-
- }
- ll_regexmess_add_header_path_verif()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder "INBOX.yop.blanc blanc" \
- --search1 'HEADER X-ImapSync-OriginalPath-tata ""' \
- --debugcontent --dry --useuid --debugimap1
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder "INBOX.yop.blanc blanc" \
- --search1 'HEADER X-ImapSync-OriginalPath-tata "INBOX.yop.blanc blanc"' \
- --debugcontent --dry --useuid --debugimap1
- }
- ll_regexmess_change_header()
- {
- #
- if at_home; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
- $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 \
- --regexmess 's{\A(.*?(?! ^$))^Date:\ \(Invalid\)(.*?)$}{$1Date: Thu, 1 Jun 2017 23:59:59 +0000}xms' \
- --search "HEADER Date Invalid" \
- --debugcontent --dry
-
- }
- ll_regexmess_truncate_long_message_regex()
- {
- #
- if at_home; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
- # Does not work
- ! $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 \
- --regexmess 's/.{40000}\K.*//s' \
- --debugcontent --minsize 100000
- # Quantifier in {,} bigger than 32766 in regex; marked by <-- HERE in m/.{ <-- HERE 40000}
-
- }
- ll_regexmess_truncate_long_message_substr()
- {
- #
- if at_home; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
- # Works well
- $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 \
- --pipemess 'perl -0ne "print substr \$_,0,40000" ' \
- --debugcontent --minsize 100000
-
- }
- ll_regexmess_truncate_long_message_truncmess()
- {
- #
- if at_home; then
- rm -f /home/vmail/titi/.yop.yap/cur/*
- fi
- # Works well
- $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 \
- --truncmess 40000 \
- --debugcontent --minsize 100000
-
- }
- ll_search_not_header() {
- $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 \
- --search "NOT HEADER Date Invalid" --debugcontent --dry
- }
- ll_regexmess_remove_header_Disposition()
- {
- #Disposition-Notification-To: Gilles LAMIRAL <gilles@lamiral.info>
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.regexmess \
- --nofoldersizes \
- --regexmess 's{\A(.*?(?! ^$))(^Disposition-Notification-To:.*?\n)}{$1}gxms' \
- --debugcontent --debug
- echo "sudo sh -c 'rm /home/vmail/titi/.regexmess/cur/*'"
- }
- ll_disarmreadreceipts()
- {
- #Disposition-Notification-To: Gilles LAMIRAL <gilles@lamiral.info>
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.disarm \
- --nofoldersizes \
- --disarmreadreceipts \
- --debugcontent --debug --dry
- echo "sudo sh -c 'rm /home/vmail/titi/.disarm/cur/*'"
- }
- ll_regexmess_scwchu()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.scwchu \
- --regexmess 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nReceived: From; $2}gxms' \
- --skipsize --skipheader 'Received: From;' \
- --debug
- echo 'rm /home/vmail/titi/.scwchu/cur/*'
- }
- ll_regexmess_wong()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.scwchu \
- --regexmess 's{\A}{Content-Type: text/plain; charset="big5"\n}gxms' \
- --debugcontent --debug
- echo "sudo sh -c 'rm /home/vmail/titi/.scwchu/cur/*'"
- }
- ll_regexmess_wong_2()
- {
- #Received: from hkuhp22.hku.hk
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.scwchu \
- --regexmess 's{\A(.*?(?!^$))^(Received: from hkuhp22.hku.hk.*?)$}{$1Content-Type: text/plain; charset="big5"\n$2}gms' \
- --debugcontent --debug --dry
- echo "sudo sh -c 'rm /home/vmail/titi/.scwchu/cur/*'"
- }
- ll_flags()
- {
- $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 \
- --debugflags
-
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_resyncflags()
- {
- $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 \
- --debugflags --resyncflags | grep 'Host1: flags init msg' || return 1
-
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_syncflagsaftercopy()
- {
- # courier doesn't gives the flags just after an copy
- $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 --nofoldersizes \
- --debugflags --syncflagsaftercopy # | grep 'replacing h2 flags' || return 1
- # | grep 'could not get its flags' || return 1
- echo 'sudo rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_noresyncflags()
- {
- $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 \
- --debugflags --noresyncflags | grep 'Host1: flags init msg' && return 1
-
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag()
- {
- $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 \
- --regexflag 's/\\Answered/\$Forwarded/g' --debugflags
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag_remove()
- {
- $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 \
- --regexflag 's/\\Indexed//gi' --debugflags
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag_bad()
- {
- ! $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 \
- --regexflag 'I am bad' --debugflags
-
- echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag2()
- {
- $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 \
- --debug --regexflag s/\\\\Answered/\\\\Flagged/g
-
- echo 'sudo rm -fv /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag3()
- {
- $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 \
- --debug --regexflag s/\\\\Answered//g
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag4()
- {
- $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 --nofoldersizes \
- --regexflag 's/\$label1/\\label1/g' \
- --regexflag "s/\\\$Forwarded//g" --debugflags
-
- echo 'sudo rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag5()
- {
- $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 \
- --debugflags --regexflag "s/Answered/Flagged/g"
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag6_add_SEEN()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX.flagsetSeen \
- --debugflags --regexflag "s/(.*)/\$1 \\\\Seen/" --dry
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag7_add_SEEN()
- {
- $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 \
- --debugflags --regexflag 's,,\\Seen ,' --dry
- # on windows --regexflag "s,,\\Seen ," --dry
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag8_add_SEEN_if_not_here()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.flagsetSeen --nofoldersizes \
- --debugflags --dry --regexflag 's,\\Seen,,' --regexflag 's,,\\Seen ,'
- # On windows: --regexflag "s,((?!\\Seen).*),$1 \\Seen,"
- }
- ll_regex_flag8_add_SEEN_always()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.flagsetSeen --nofoldersizes \
- --debugflags --dry --regexflag "s,,\\\\Seen ,"
- }
- ll_regex_flag_keep_only()
- {
- $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 \
- --debug \
- --regexflag 's/(.*)/$1 jrdH8u/' \
- --regexflag 's/.*?(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)/$1 /g' \
- --regexflag 's/(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u) (?!(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)).*/$1 /g' \
- --regexflag 's/jrdH8u *//'
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_regex_flag_keep_only_phil()
- {
- $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 \
- --debugflags \
- --regexflag 's/(.*)/$1 jrdH8u/' \
- --regexflag 's/.*?(?:(\\(?:Answered|Flagged|Deleted|Seen|Draft)\s?)|$)/defined($1)?$1:q()/eg' \
- --regexflag 's/jrdH8u *//'
-
- echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_tls_justconnect() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --tls1 --tls2 \
- --justconnect --debugimap
- }
- ll_tls_justconnect_SSL_version() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --tls1 --tls2 \
- --justconnect --debugimap --ssl1_SSL_version SSLv3 --ssl2_SSL_version SSLv2
- }
- ll_tls_justlogin() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --tls1 --tls2 \
- --justlogin --debugimap
- }
- ll_tls_devel() {
- ll_justlogin && ll_ssl_justlogin \
- && ll_tls_justconnect && ll_tls_justlogin
- }
- ll_tls() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --tls1 --tls2
- }
- ll_ssl_justconnect() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --ssl2 \
- --justconnect
- }
- ll_ssl_justconnect_SSL_version() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --ssl2 \
- --justconnect --ssl1_SSL_version SSLv3 --ssl2_SSL_version SSLv2
- }
- ll_ssl_justconnect_sslargs() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --ssl2 \
- --justconnect --sslargs1 SSL_version=SSLv23 --sslargs1 SSL_verify_mode=0
- }
- ll_ssl_justconnect_sslargs_SSL_verify_mode1() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --ssl2 \
- --justconnect --sslargs1 SSL_version=SSLv23 --sslargs1 SSL_verify_mode=1
- }
- ll_ssl_justconnect_sslargs_SSL_versionTLSv1_1() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --tls1 \
- --justconnect --sslargs1 SSL_version=TLSv1_1 --sslargs1 SSL_verify_mode=0 --debugssl 4
- }
- ll_ssl1_tls2_justconnect() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --tls2 \
- --justconnect --debugimap
- }
- ll_tls1_ssl2_justconnect() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --tls1 --ssl2 \
- --justconnect --debugimap
- }
- ll_ssl1_tls1_justconnect() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --host2 $HOST2 \
- --ssl1 --tls1 \
- --justconnect --debugimap
- }
- ll_ssl_justconnect_SSL_VERIFY_PEER() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 \
- --ssl1 \
- --justconnect \
- --host2 imap.gmail.com \
- --ssl2 \
- --sslargs2 SSL_verify_mode=1
- #--sslargs2 SSL_ca_file=/etc/ssl/certs/ca-certificates.crt
- }
- ll_justconnect_devel() {
- ll_justconnect && ll_tls_justconnect && ll_ssl_justconnect && ll_ssl1_tls2_justconnect && ll_tls1_ssl2_justconnect && ! ll_ssl1_tls1_justconnect
- }
- ll_ssl_justlogin() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --ssl2 \
- --justlogin
- }
- ll_ssl_justlogin_SSL_version() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --ssl2 \
- --justlogin --ssl1_SSL_version SSLv23 --ssl2_SSL_version SSLv23 --debugssl 4
- }
- ll_ssl_justlogin_sslargs() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --ssl2 \
- --sslargs1 SSL_version=SSLv3 --sslargs1 SSL_verify_mode=1
- }
- ll_tls_justlogin_sslargs_failure_EXIT_TLS_FAILURE() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --tls1 --tls2 \
- --sslargs1 SSL_version=SSLv2
- test "$?" = "$EXIT_TLS_FAILURE"
- }
- ll_ssl_tls_justlogin() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --tls1 --ssl2 --tls2 \
- --justlogin --debug
- test "$?" = "$EXIT_TLS_FAILURE"
- }
- ll_justlogin_devel() {
- ll_justlogin && ll_ssl_justlogin && ll_tls_justlogin && ll_ssl_tls_justlogin
- }
- ll_ssl() {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage
- fi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --ssl1 --ssl2
- }
- ll_authmech_PLAIN() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --nofoldersizes \
- --authmech1 PLAIN --authmech2 PLAIN
- }
- ll_authmech_PLAIN_ssl() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --ssl1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --ssl2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --nofoldersizes \
- --authmech1 PLAIN --authmech2 PLAIN
- }
- ll_authmech_XOAUTH2_gmail() {
- ! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
- --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.xoauth2 \
- --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.xoauth2 \
- --justlogin \
- --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; }
- }
- ll_authmech_xoauth2_gmail() { ll_authmech_XOAUTH2_gmail; }
- ll_authmech_XOAUTH2_json_gmail() {
- ! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
- --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
- --password1 ../../var/pass/secret.xoauth2.json \
- --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
- --password2 ../../var/pass/secret.xoauth2.json \
- --justlogin \
- --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug | grep unauthorized_client ; }
- }
- ll_authmech_xoauth2_json_gmail() { ll_authmech_XOAUTH2_json_gmail; }
- ll_authmech_XOAUTH2_json_gmail_app() {
- ! ping -c1 imap.gmail.com || { $CMD_PERL ./imapsync \
- --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
- --password1 ../../var/pass/secret.xoauth2.json \
- --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
- --password2 ../../var/pass/secret.xoauth2.json \
- --justlogin \
- --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debugimap ; }
- }
- ll_authmech_xoauth2_json_gmail_app() { ll_authmech_XOAUTH2_json_gmail_app; }
- ll_authmech_XOAUTH2_gmail_proxy() {
- ! ping -c1 imap.gmail.com || https_proxy=http://localhost:8080/ $CMD_PERL ./imapsync \
- --host1 imap.gmail.com --ssl1 --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.xoauth2 \
- --host2 imap.gmail.com --ssl2 --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.xoauth2 \
- --justlogin \
- --authmech1 XOAUTH2 --authmech2 XOAUTH2 --debug
- }
- ll_authmech_xoauth2_gmail_proxy() { ll_authmech_XOAUTH2_gmail_proxy; }
- ll_authmech_NTLM() {
- # It fails since I don't have NTLM available
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin \
- --debugimap1 --authmech1 NTLM --notrylogin
- }
- ll_authmech_NTLM_domain() {
- # It fails since I don't have NTLM available
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin \
- --authmech1 NTLM --domain1 freshgrillfoods.com --debugimap1 --notrylogin
- }
- ll_authmech_NTLM_trylogin_ok() {
- # It succeeds because --trylogin is set by default (for now).
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --authmech1 NTLM --trylogin --justlogin
- }
- ll_authmech_NTLM_trylogin_fail() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --password2 'cacakiki' \
- --authmech2 NTLM --trylogin --justlogin
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE_USER2"
- }
- ll_authmech_X_MASTERAUTH()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --authmech1 'X-MASTERAUTH' # --debugimap1
- }
- ll_authuser()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --authuser2 titi --debugimap2
- }
- ll_proxyauth_missing_authuser()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 anything \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --proxyauth2
- test "$?" = "$EX_USAGE"
- }
- ll_proxyauth_authuser()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 anything \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --proxyauth2 --authuser2 titi --debugimap2
- test "$?" = "$EXIT_AUTHENTICATION_FAILURE_USER2"
- }
- ll_authmech_LOGIN() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --nofoldersizes \
- --authmech1 LOGIN --authmech2 LOGIN
- }
- ll_authmech_CRAMMD5() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfoldersizes --nofoldersizes \
- --authmech1 CRAM-MD5 --authmech2 CRAM-MD5
- }
- ll_delete1() {
- # The initial state is a same message on both sides
- ls -ld /home/vmail/tata/.oneemail3/cur/* || return 1
- ls -ld /home/vmail/titi/.oneemail3/cur/* || return 1
- echo 11111111111111111111111 tata titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.oneemail3 --delete1 --debugimap
- #find /home/vmail/titi/.oneemail3/ || :
- echo After first sync, tata has none, titi has one message
- ! test -f /home/vmail/tata/.oneemail3/cur/* || return 1
- test -f /home/vmail/titi/.oneemail3/cur/* || return 1
- echo 222222222222222222222222 back: titi tata
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX.oneemail3 --delete1 --delete2duplicates
-
- echo After second sync reverse, tata has one, titi has no message
- test -f /home/vmail/tata/.oneemail3/cur/* || return 1
- ! test -f /home/vmail/titi/.oneemail3/cur/* || return 1
-
- echo 3333333333333333333333333 initial state
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.oneemail3
- #find /home/vmail/titi/.oneemail3/ || :
- echo ll_delete1 finished
- }
- ll_delete1_twoemails()
- {
- # initial
- ls /home/vmail/tata/.twoemails/cur/* || return 1
- echo 11111111111111111111111 tata titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.twoemails --delete1
- #find /home/vmail/titi/.twoemails/ || :
- echo After first sync, tata has none, titi has two messages
- ! ls /home/vmail/tata/.twoemails/cur/* || return 1
- ls /home/vmail/titi/.twoemails/cur/* || return 1
- echo 222222222222222222222222 back: titi tata
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX.twoemails --delete1
-
- ls /home/vmail/tata/.twoemails/cur/* || return 1
- ! ls /home/vmail/titi/.twoemails/cur/* || return 1
-
- echo 3333333333333333333333333 initial state
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.twoemails
- #find /home/vmail/titi/.twoemails/ || :
- echo ll_delete1_twoemails finished
- }
- ll_delete1_twoemails_dry()
- {
- # initial
- ls /home/vmail/tata/.twoemails/cur/* || return 1
- echo 11111111111111111111111 tata titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.twoemails --delete1 --dry --debug
- }
- ll_delete1_delete2() {
- ! $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --delete1 --delete2
- }
- ll_delete2() {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --delete2
- }
- ll_delete2_reverse() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX \
- --delete2
- }
- ll_delete1_reverse() {
- ll_INBOX
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX \
- --delete1 --minage 10 --maxage 999 # --dry
- }
- ll_delete1_reverse_useuid() {
- ll_INBOX
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST2 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX \
- --delete1 --minage 100 --maxage 600 \
- --useuid
- }
- ll_delself() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 toto \
- --passfile1 ../../var/pass/secret.toto \
- --host2 $HOST2 --user2 delme \
- --passfile2 ../../var/pass/secret.delme
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 delme \
- --passfile1 ../../var/pass/secret.delme \
- --host2 $HOST2 --user2 delme \
- --passfile2 ../../var/pass/secret.delme \
- --delete1 --noexpungeaftereach
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 delme \
- --passfile1 ../../var/pass/secret.delme \
- --host2 $HOST2 --user2 delme \
- --passfile2 ../../var/pass/secret.delme \
- --justfolders --delete2folders --regextrans2 "s/.*/INBOX/" --foldersizes
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 delme \
- --passfile1 ../../var/pass/secret.delme \
- --host2 $HOST2 --user2 delme \
- --passfile2 ../../var/pass/secret.delme \
- --justfoldersizes
- }
- ll_delete2_minage() {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --delete2 --minage 1
- }
- ll_delete2_minage_useuid() {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --delete2 --uidexpunge2 --minage 1 --useuid
- }
- ll_delete2_uidexpunge2_implicit() {
- can_send && sendtestmessage titi
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --delete2 --useuid
- }
- ll_delete1duplicates() {
- can_send && sendtestmessage titi thailah9eem4iHei
- can_send && sendtestmessage tata thailah9eem4iHei
- can_send && sendtestmessage tata thailah9eem4iHei
- can_send && sendtestmessage tata thailah9eem4iHei
- can_send && sendtestmessage tata thailah9eem4iHei
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --maxage 1 --useheader Subject # --delete2duplicates
- }
- ll_delete2duplicates() {
- #can_send && sendtestmessage titi "test ll_delete2duplicates"
- #can_send && sendtestmessage tata "test ll_delete2duplicates"
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --delete2duplicates --uidexpunge2 --useheader Subject --dry
- }
- ll_duplicates_across_folders() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.zz_1 \
- --folder INBOX.zz_2 \
- --folder INBOX.zz_3 \
- --skipcrossduplicates --debugcrossduplicates
- }
- ll_delete2_dev() {
- can_send && sendtestmessage titi
- can_send && sendtestmessage
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --include zz --include ZZ --regextrans2 's,.*,INBOX.z_merge,' \
- --delete2
- }
- ll_maxmessagespersecond() {
- ll_delete1_reverse
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --maxmessagespersecond 3.3
- }
- ll_maxbytespersecond() {
- ll_delete1_reverse
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --maxbytespersecond 2000 --nofoldersizes
- }
- ll_maxbytespersecond_0() {
- ll_delete1_reverse
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --maxbytespersecond 1 --nofoldersizes --maxsleep 0
- }
- ll_maxbytesafter() {
- ll_delete1_reverse
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX \
- --maxbytespersecond 1000 --maxbytesafter 20000 --nofoldersizes
- }
- big2_bigmail_clean()
- {
- echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
- sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"
- }
- ll_bigmail() {
- time -p $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 big1 \
- --passfile1 ../../var/pass/secret.big1 \
- --host2 $HOST2 --user2 big2 \
- --passfile2 ../../var/pass/secret.big2 \
- --folder INBOX.bigmail --debugmemory --nofoldersizes
- echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
- }
- ll_bigmail_fastio() {
- time -p $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 big1 \
- --passfile1 ../../var/pass/secret.big1 \
- --host2 $HOST2 --user2 big2 \
- --passfile2 ../../var/pass/secret.big2 \
- --folder INBOX.bigmail --debugmemory --nofoldersizes --fastio1 --fastio2
- echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail/cur/*"'
- }
- ll_bigmail_fastio_profile()
- {
- test "0" = "`id -u`" || {
- echo Do instead
- echo "sudo sh tests.sh ll_bigmail_fastio_profile"
- return
- }
-
- big2_bigmail_clean
- sync
- echo 3 >/proc/sys/vm/drop_caches
- free
- ll_bigmail_fastio
- echo End of ll_bigmail_fastio
- big2_bigmail_clean
- sync
- echo 3 >/proc/sys/vm/drop_caches
- free
- ll_bigmail
- echo End of ll_bigmail
- free
- }
- # In mandatory_tests
- memory_stress() {
- free
- $CMD_PERL ./imapsync --testsunit tests_memory_stress && free
- }
- ll_memory_consumption() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 big1 \
- --passfile1 ../../var/pass/secret.big1 \
- --host2 $HOST2 --user2 big2 \
- --passfile2 ../../var/pass/secret.big2 \
- --folder INBOX.bigmail2 \
- --nofoldersizes
- echo 'sudo sh -c "rm -v /home/vmail/big2/.bigmail2/cur/*"'
- }
- ll_syncduplicates() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --debug --syncduplicates # --dry
- }
- ll_syncduplicates_delete2() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --syncduplicates --delete2 # --dry
- }
- ll_syncduplicates_delete2_delete2duplicates() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --syncduplicates --delete2 --delete2duplicates # --dry
- }
- ll_syncduplicates_noskipsize() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --debug --syncduplicates --noskipsize # --dry
- }
- ll_syncduplicates_usecache() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --debug --syncduplicates --usecache #--dry
- }
- ll_syncduplicates_reverse() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 titi \
- --passfile1 ../../var/pass/secret.titi \
- --host2 $HOST1 --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX.duplicates --debug --syncduplicates # --dry
- }
- ll_remove_duplicates() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST1 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.duplicates --delete2duplicates # --dry
- }
- msw() {
- if can_send; then
- sendtestmessage toto
- fi
- scp imapsync test.bat test_exe.bat\
- ../../var/pass/secret.toto \
- ../../var/pass/secret.titi \
- ../../var/pass/secret.tata \
- Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
- ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
- scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
- }
- msw2() {
- if can_send; then
- sendtestmessage toto
- fi
- scp imapsync test_exe.bat\
- ../../var/pass/secret.toto \
- ../../var/pass/secret.titi \
- ../../var/pass/secret.tata \
- Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
- ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
- }
- ll_change_characters_doublequotes() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justfolders --dry --nofoldersizes \
- --regextrans2 's,\",_,g'
- }
- ll_change_characters_gmail() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder "INBOX. f g\h\"i'j " --justfolders \
- --regextrans2 "s/['\"\\\\]/_/g" --regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g'
- }
- ll_blanc_vs_hyphen_gmail() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder "INBOX.A-B" --folder "INBOX.A B" --folder "INBOX.A.B" --justfolders
- }
- # Gmail tests
- # A big mess!
- xxxxx_gmail() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g' \
- --exclude 'INBOX.yop.YAP' \
- --regextrans2 "s,^Messages envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," \
- --regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
- --folder 'INBOX.Messages envoy&AOk-s' \
- --folder 'INBOX.Sent'
- }
- xxxxx_gmail_useuid() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --regextrans2 "s,^Sent$,[Gmail]/Sent Mail," \
- --folder 'INBOX.Sent' --useuid --dry
- }
- xxxxx_gmail_02() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --regextrans2 's,(.*),SMS,'
- }
- xxxxx_gmail_03() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --folder INBOX.few_emails --debug --useheader Message-ID --delete2 --dry
- }
- xxxxx_gmail_03_Received() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --folder INBOX.few_emails --debug --useheader Received --delete2 --dry
- }
- xxxxx_gmail_04_Sent() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --folder INBOX.Sent \
- --regextrans2 's{Sent}{[Gmail]/Messages envoy&AOk-s}' \
- --debugflags
- }
- xxxxx_gmail_05_justfolders() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justfolders --nofoldersizes \
- --regextrans2 's,(/|^) +,$1,g' --regextrans2 's, +(/|$),$1,g' \
- --regextrans2 "s/[\^]/_/g" --debug
- }
- xxxxx_gmail_05_justlogin() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justlogin
- }
- xxxxx_gmail_05_justlogin_exe() {
- ! ping -c1 imap.gmail.com || ./imapsync_elf_x86.bin \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justlogin
- }
- xxxxx_gmail_05_justlogin_SSLv3() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justlogin --ssl2_SSL_version SSLv3 --justconnect
- }
- xxxxx_gmail_05_justlogin_SSLv2() {
- ! ping -c1 imap.gmail.com || ! $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justlogin --ssl2_SSL_version SSLv2
- }
- xxxxx_gmail_05_justlogin_SSLv23() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --justlogin --ssl2_SSL_version SSLv23
- }
- xxxxx_gmail_trailing_blanks() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --justfolders \
- --include "[ ]" \
- --regextrans2 's,^ +| +$,,g' --regextrans2 's,/ +| +/,/,g'
- }
- xxxxx_gmail_trailing_blanks_gmail2() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --justfolders \
- --include "[ ]" \
- --gmail2 --dry
- }
- xxxxx_gmail_delete2folders() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --justfolders \
- --include "[ ]" \
- --gmail2 --delete2foldersonly "m, ," --delete2foldersbutnot 'm,Gmail,'
- }
- xxxxx_gmail_07_hierarchy() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --folder INBOX.yop.yup.yip.yap.yep --justfolders
- }
- xxxxx_gmail_07_subfolder() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --nofoldersizes \
- --justfolders --subfolder2 BBB
- }
- xxxxx_gmail_09_via_stunnel() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 $HOST2 \
- --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 localhost \
- --port2 9993 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --foldersizes \
- --folder INBOX
- }
- gmail_xxxxx() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --nofoldersizes \
- --dry --justfolders --exclude "\[Gmail\]/All Mail"
- }
- gmail() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --exclude Gmail --exclude "blanc\ $"
- }
- gmail_l_tata() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --folder INBOX
- }
- gmail_justfolders() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --justfolders --exclude Gmail --exclude "blanc\ $"
- }
- gmail_justfolders_remove_Gmail() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --regextrans2 "s,\[Gmail\].,," --dry --justfolders
- }
- gmail_via_stunnel_ks() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 ks.lamiral.info \
- --port1 243 --nossl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 $HOST2 \
- --user2 tata \
- --passfile2 ../../var/pass/secret.tata \
- --useheader 'Message-Id' \
- --useheader="X-Gmail-Received" \
- --debug --justfolders
- }
- easygmail_gmail1_gmail2() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders
- }
- easygmail_gmail2()
- {
- $CMD_PERL ./imapsync \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host1 imap.gmail.com \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders
- }
- gmail_gl0_justlogin()
- {
- $CMD_PERL ./imapsync \
- --gmail1 --user1 imapsync.gl0@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl0_gmail \
- --gmail2 --user2 imapsync.gl0@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl0_gmail \
- --justlogin
- }
- gmail_gl0_justlogin_oauthdirect()
- {
- cd /home/gilles/public_html/imapsync/W/learn
- pwd
- . ./oauth2.memo
- regenerate_access_token
- access_token=`cat oauth2_access_token.txt`
- echo "$access_token"
-
- generate_oauth2_string_for_imap_from_access_token "$access_token"
- oauth2_string=`cat oauth2_string_for_oauthdirect.txt`
- echo oauth2_string="$oauth2_string"
- cd -
- pwd
- echo "2oauth2_string=$oauth2_string"
- $CMD_PERL ./imapsync \
- --gmail1 --user1 imapsync.gl0@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl0_gmail \
- --gmail2 --user2 imapsync.gl0@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl0_gmail \
- --justlogin --oauthdirect1 "$oauth2_string" --oauthdirect2 "$oauth2_string" --debugimap --showpasswords
- pwd
- }
- gmail_gl0_oauthdirect_failure_login_success()
- {
- oauth2_string="kaka"
- echo "2oauth2_string=$oauth2_string"
- $CMD_PERL ./imapsync \
- --gmail1 --user1 imapsync.gl0@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl0_gmail \
- --gmail2 --user2 imapsync.gl0@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl0_gmail \
- --justlogin --oauthdirect1 "$oauth2_string" --oauthdirect2 "$oauth2_string" --debugimap --showpasswords
- }
- all_login_tests()
- {
- run_tests ll_authmech_PREAUTH \
- ll_authmd5 \
- ll_authmd51 \
- ll_authmd52 \
- ll_noauthmd5 \
- gmail_gl0_justlogin \
- gmail_gl0_justlogin_oauthdirect \
- ll_ssl_justlogin \
- ll_tls_justlogin \
- ll_tls_justlogin_sslargs_failure_EXIT_TLS_FAILURE \
- yahoo_xxxx_login \
- yahoo_xxxx_login_tls \
- yahoo_xxxx_login_tls \
- ll_justlogin \
- ll_justlogin_notls \
- l_office365_SSL_verify_mode \
- office365_justlogin_ssl1_ssl2 \
- office365_justlogin_tls \
- office365_justlogin_tls2_office365 \
- office365_justlogin_ssl2_tls2_office365 \
- ll_ask_password \
- ll_env_password \
-
- }
- gmail_glX_all_justlogin()
- {
- error_list=""
- for X in "" 0 1 2 3; do
- $CMD_PERL ./imapsync \
- --gmail1 --user1 imapsync.gl${X}@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl${X}_gmail \
- --gmail2 --user2 imapsync.gl${X}@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl${X}_gmail \
- --justlogin || { error_list="${error_list}[imapsync.gl${X}@gmail.com] " ; }
- done
- echo3 "error_list=$error_list"
- test "X$error_list" = X;
- }
- gmail_glX_all_justfolderlist()
- {
- error_list=""
- for X in "" 0 1 2 3; do
- $CMD_PERL ./imapsync \
- --gmail1 --user1 imapsync.gl${X}@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl${X}_gmail \
- --gmail2 --user2 imapsync.gl${X}@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl${X}_gmail \
- --no-modulesversion --justfolderlists --nocheckfoldersexist || { error_list="${error_list}[imapsync.gl${X}@gmail.com] " ; }
- done
- echo3 "error_list=$error_list"
- test "X$error_list" = X;
- }
- gmail_gmail_slash_in_foldername()
- {
- ./imapsync --gmail1 --user1 imapsync.gl1@gmail.com --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --gmail2 --user2 imapsync.gl2@gmail.com --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --no-modulesversion --dry --justfolders
- }
- gmail_gmail()
- {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders --exclude Gmail --exclude "blanc\ $"
- }
- gmail_gmail_exclude()
- {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders --exclude "/Trash"
- }
- gmail_gmail_inet4() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justlogin --inet4
- }
- gmail_gmail_ipv6() {
- ! ping6 -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 2a00:1450:400c:c0a::6c \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 wl-in-x6c.1e100.net. \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justlogin
- }
- gmail_gmail_automap() {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders --dry --automap --justautomap --f1f2 Junk=Junk --f1f2 Trash=Cake
- }
- gmail_gmail_noautomap() {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justfolders --dry --noautomap
- }
- gmail_gmail_justconnect() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justconnect --timeout 1
- }
- gmail_gmail_justlogin() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --justlogin --id --debugimap
- }
- gmail_gl_gl2_justfolders() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --justfolders --exclude Gmail --exclude "blanc\ $" --dry
- }
- gmail_gl_gl2() {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --folder INBOX --dry
- }
- gmail_gl_gl2_SUB() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --justfolders --nofoldersizes --exclude Gmail --regextrans2 "s,(.*),SUB/\$1,"
- }
- gmail_gl2_gl2_selectable()
- {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl2@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --dry --justautomap
- }
- gmail_gl_gl2_create_folder_old() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --gmail2 \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --justfolders --exclude Gmail --exclude "blanc\ $" \
- --create_folder_old --dry --nofoldersizes
- }
- gmail_gmail_search_NOT_HEADER_attachment()
- {
- $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --gmail2 \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --search "NOT HEADER Content-Disposition attachment" \
- --folder INBOX --dry
- # Also works
- # --search 'HEADER Content-Type multipart/mixed' \
- # Does not work the OR
- # --search 'OR HEADER "Content-Disposition attachment" HEADER "Content-Type multipart/mixed"' \
- }
- gmail_gmail_folderfirst() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --exclude "blanc\ $" --exclude Gmail \
- --justfolders --folderfirst INBOX --folderfirst zz --folderlast "[Gmail]/All Mail" --debug
- }
- gmail_gmail_INBOX() {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder INBOX --debugflags
- #--dry # --debug --debugimap # --authmech1 LOGIN
- }
- gmail_gmail_3_delete() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 gilles.lamiral@gmail.com \
- --passfile2 ../../var/pass/secret.gilles_gmail \
- --folder '[Gmail]/All Mail' --delete1
- # '[Gmail]/All Mail' is not expunge by default!
- }
- gmail_gmail_4_tls() {
- ! ping -c1 imap.gmail.com || ! $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 --tls2 --port2 993 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder INBOX
- #--dry # --debug --debugimap # --authmech1 LOGIN
- }
- gmail_gmail_5_exclude_only_Gmail() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --nofoldersizes --folderrec "[Gmail]" --exclude "\[Gmail\]$"
- }
- gmail_gmail_6_search() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder INBOX --search 'X-GM-RAW "has:attachment"'
- }
- gmail_gmail_7_search() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder "[Gmail]/All Mail" --search 'X-GM-RAW "Analysez lalala performances"'
- }
- gmail_gmail_8_search() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder Test --nofoldersizes --debugimap \
- --search 'X-GM-RAW "label:Important label:Test"'
- }
- gmail_gmail_9_search_X_GM_LABELS() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --folder Test --nofoldersizes --debugimap \
- --search 'X-GM-LABELS "Important"'
- }
- gmail_gmail_10_search_drafts() {
- ! ping -c1 imap.gmail.com || $CMD_PERL ./imapsync \
- --gmail1 \
- --user1 gilles.lamiral@gmail.com \
- --passfile1 ../../var/pass/secret.gilles_gmail \
- --gmail2 \
- --user2 imapsync.gl@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl_gmail \
- --nofoldersizes \
- --folderfirst '[Gmail]/Drafts' --debuglabels --dry \
- --folder Test --folder '[Gmail]/Drafts'
- }
- gmail_gl_gl2_sslargs()
- {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --ssl1 \
- --user1 imapsync.gl@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl_gmail \
- --host2 imap.gmail.com \
- --ssl2 \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --justlogin --sslargs1 SSL_version=SSLv3 --sslargs1 SSL_verify_mode=0
- }
- # imapsync.gl@gmail.com
- # imapsync.gl0@gmail.com == Source only account for imapsync
- # imapsync.gl1@gmail.com == Source account for imapsync.gl2@gmail.com with
- # --subfolder2 "Archive/Bob"
- # --subfolder2 "Archive/Zuz"
- # Destination account from imapsync.gl3@gmail.com with
- # --subfolder1 "Archive/Bob"
- # imapsync.gl2@gmail.com == Destination account --subfolder2 "Archive/Bob" from imapsync.gl1@gmail.com
- # --subfolder2 "Archive/Zuz" from imapsync.gl1@gmail.com
- # imapsync.gl3@gmail.com ==
- sendtestmessage_gl0()
- {
- sendtestmessage imapsync.gl0@gmail.com
- }
- sendtestmessage_gl1()
- {
- sendtestmessage imapsync.gl1@gmail.com
- }
- gmail_gl1_gl2_labels()
- {
- #sendtestmessage imapsync.gl1@gmail.com
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl1@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --exclude "\[Gmail\]" \
- --synclabels --resynclabels --debug --debuglabels # --dry
- }
- gmail_gl1_gl2_labels_subfolder2()
- {
- #sendtestmessage imapsync.gl1@gmail.com
-
- # The backup
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl1@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --synclabels --resynclabels --debuglabels --delete2\
- --subfolder2 "Archive/Bob" --nofoldersizes --gmail1 --gmail2 --dry # --exclude "\[Gmail\]"
- return
-
- #sendtestmessage imapsync.gl1@gmail.com
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl1@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --gmail1 --gmail2 --synclabels --resynclabels --delete2 --folder INBOX --subfolder2 "Archive/Zuz"
- }
- gmail_gl2_gl3_labels_after_a_subfolder2_from_host1()
- {
- # A second backup, standard this one (no --subfolder2)
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl2@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl3@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl3_gmail \
- --synclabels --resynclabels --folderrec "Archive/Bob" --gmail1 --gmail2 --dry
- }
- gmail_gl3_gl1_labels_subfolder1()
- {
- # The restoration process
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl3@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl3_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl1@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl1_gmail \
- --subfolder1 "Archive/Bob" --debuglabels --resynclabels --nofoldersizes --justfolders #--dry
- }
- gmail_deuscustoms()
- {
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com --user1 "test1@deuscustoms.com" --passfile1 '../../var/pass/test1@deuscustoms.com' \
- --host2 imap.gmail.com --user2 "test2@deuscustoms.com" --passfile2 '../../var/pass/test2@deuscustoms.com' \
- --subfolder2 "Archived accounts/Test User 1" \
- --exclude "\[Gmail\]" --folderlast INBOX \
- --debuglabels --resynclabels --synclabels --nofoldersizes #--dry
- }
- gmail_gl1_gl2_appendlimit()
- {
- #sendtestmessage imapsync.gl1@gmail.com
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl1@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --gmail1 --gmail2 --nofoldersizes --justlogin
- }
- gmail_gl1_gl2_maxsize_over_appendlimit()
- {
- #sendtestmessage imapsync.gl1@gmail.com
- $CMD_PERL ./imapsync \
- --host1 imap.gmail.com \
- --user1 imapsync.gl1@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl1_gmail \
- --host2 imap.gmail.com \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --gmail1 --gmail2 --nofoldersizes \
- --justlogin --maxsize 999_999_999_999
- }
- gmail_gl2_gl2_move_All_Mail_Trash()
- {
- #sendtestmessage imapsync.gl1@gmail.com
- $CMD_PERL ./imapsync \
- --user1 imapsync.gl2@gmail.com \
- --passfile1 ../../var/pass/secret.imapsync.gl2_gmail \
- --user2 imapsync.gl2@gmail.com \
- --passfile2 ../../var/pass/secret.imapsync.gl2_gmail \
- --gmail1 --gmail2 \
- --folder '[Gmail]/Tous les messages' \
- --f1f2 '[Gmail]/Tous les messages=[Gmail]/Corbeille'
- }
- yahoo_xxxx_login()
- {
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin
- }
- yahoo_xxxx_login_tls() {
- # tls1 no longer works on Yahoo
- ! ping -c1 imap.mail.yahoo.com || ! $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --tls1 --timeout1 5 \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin
- }
- yahoo_xxxx() {
- # Yahoo works only with ssl (november 2011)
- # Could do plain port 143 before
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --addheader --exclude Archive
- }
- yahoo_fail_UNAVAILABLE() {
- # Those are messages from yahoo:
- # Err 1/11: - msg Archive/470002 {0} S[12903] F[$NotJunk] I[25-Oct-2016 00:19:28 +0000] could not be fetched: 29 NO [UNAVAILABLE] UID FETCH Server error while fetching messages
- # Update 2018/5/5: it now works well on those messages
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --addheader --folder Archive
- }
- yahoo_search_SENTBEFORE()
- {
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "SENTBEFORE 1-Jan-2019"
- }
- yahoo_search_SENTAFTER()
- {
- # SENTAFTER is plain wrong, so it should fail!
- ! ping -c1 imap.mail.yahoo.com || ! $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "SENTAFTER 1-Jan-2019" --folder Inbox --dry --debugimap1
- }
- yahoo_search_SENTSINCE()
- {
- # SENTAFTER is wrong, it should fail!
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "SENTSINCE 1-Jan-2019" --folder Inbox --dry --debugimap1
- }
- yahoo_search_ALL_Inbox()
- {
- # SENTAFTER is wrong, it should fail!
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 $HOST2 \
- --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --search "ALL" --folder Inbox --dry
- }
- yahoo_yahoo_Inbox()
- {
- # SENTAFTER is wrong, it should fail!
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 imap.mail.yahoo.com \
- --user2 glamiral \
- --passfile2 ../../var/pass/secret.gilles_yahoo \
- --folder Inbox --dry --debugimap1
- }
- yahoo_yahoo_search_ALL_Inbox()
- {
- # SENTAFTER is wrong, it should fail!
- ! ping -c1 imap.mail.yahoo.com || $CMD_PERL ./imapsync \
- --host1 imap.mail.yahoo.com \
- --user1 glamiral \
- --passfile1 ../../var/pass/secret.gilles_yahoo \
- --host2 imap.mail.yahoo.com \
- --user2 glamiral \
- --passfile2 ../../var/pass/secret.gilles_yahoo \
- --folder Inbox --dry --debugimap1 --search "ALL"
- }
- yahoo_all() {
- yahoo_xxxx_login_tls || return 1
- yahoo_xxxx_login || return 1
- yahoo_xxxx || return 1
- yahoo_fail_UNAVAILABLE || return 1
- yahoo_search_SENTSINCE || return 1
- yahoo_search_ALL_Inbox || return 1
- yahoo_yahoo_Inbox || return 1
- yahoo_search_SENTBEFORE || return 1
- }
- archiveopteryx_1() {
- if can_send; then
- #echo3 Here is plume
- sendtestmessage je@lupus.aox.org
- else
- :
- fi
- $CMD_PERL ./imapsync \
- --host1 lupus.aox.org --user1 je \
- --passfile1 ../../var/pass/secret.aox_je \
- --host2 lupus.aox.org --user2 je \
- --passfile2 ../../var/pass/secret.aox_je \
- --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./' \
- --foldersize --nouid1
- }
- ll_justlogin() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin
- }
- ll_justlogin_notls() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --notls1 --notls2
- }
- ll_justlogin_nocompress() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --justlogin --nocompress2
- }
- ll_justlogin_backslash_char() {
- # Look in the file ../../var/pass/secret.tptp to see
- # strange \ character behavior
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 tptp@est.belle \
- --passfile2 ../../var/pass/secret.tptp \
- --justlogin
- }
- ll_justlogin_dollar_char() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 dollar \
- --passfile2 ../../var/pass/secret.dollar \
- --justlogin --showpasswords --debugimap2
- }
- ll_justlogin_equal_char() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 equal \
- --passfile2 ../../var/pass/secret.equal \
- --justlogin --debugimap2
- }
- ll_usecache()
- {
- if can_send; then
- sendtestmessage
- 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_usecache_INBOX() {
- 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 \
- --folder INBOX
- }
- ll_usecache_all()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --usecache --nofoldersizes
- }
- ll_usecache_bracket() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --usecache --nofoldersizes --debugcache --folder "INBOX.[bracket]"
- }
- # In mandatory_tests
- 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
- }
- ll_usecache_noheader() {
- 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 \
- --folder INBOX --useheader ''
- }
- ll_usecache_debugcache() {
- 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 --useheader '' --debugcache
- }
- ll_usecache_debugcache_useuid() {
- 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 --useheader '' --debugcache --useuid
- }
- ll_useuid_INBOX()
- {
- 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 \
- --folder INBOX \
- --delete2 \
- --useuid
- }
- # In mandatory_tests
- ll_useuid()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.useuid \
- --delete2 \
- --useuid
- }
- ll_useuid_all()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --delete2 --useuid --nofoldersizes
- }
- # In mandatory_tests
- ll_useuid_nousecache()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.useuid \
- --useuid --nousecache --debugcache
- echo 'rm /home/vmail/titi/.yop.yap/cur/*'
- }
- ll_fastio()
- {
- time -p $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --fastio1 --fastio2
- }
- ll_nofastio()
- {
- time -p $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX --nofastio1 --nofastio2
- }
- l_office365()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX --tmpdir /var/tmp --usecache --regextrans2 's/INBOX/tata/' --delete2
- }
- l_office365_deleted_flag()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX.flags --tmpdir /var/tmp --regextrans2 's/INBOX/tata/' --debugflags
- }
- l_office365_flagged_flag()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --office2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX.flags --tmpdir /var/tmp --regextrans2 's/INBOX/tata/' --debugflags
- }
- l_office365_noregexmess()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --office2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justbanner --noregexmess
- }
- l_exchange2_flagged_flag()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 outlook.office365.com \
- --exchange2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --regextrans2 's/INBOX/tata/' --nofoldersizes \
- --folder INBOX.flags --debugflags
- }
- l_exchange2_flagged_noregexflag()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 outlook.office365.com \
- --exchange2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --regextrans2 's/INBOX/tata/' --nofoldersizes \
- --folder INBOX.flags --debugflags --noregexflag
- }
- l_exchange2_noregexmess_noregexflag()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 outlook.office365.com \
- --exchange2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justbanner --noregexmess --noregexflag
- }
- l_office365_SSL_verify_mode()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin --sslargs2 SSL_verify_mode=1
- }
- office1_office2()
- {
- $CMD_PERL ./imapsync \
- --office1 \
- --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --office2 \
- --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justfolders
- }
- office1_office2_sentbefore()
- {
- $CMD_PERL ./imapsync \
- --office1 \
- --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --office2 \
- --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder Sent --search "SENTBEFORE 31-Dec-2013" --debugimap
- }
- office1_office2_noexclude()
- {
- $CMD_PERL ./imapsync \
- --office1 \
- --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --office2 \
- --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justfolders --noexclude
- }
- office365_justconnect_tls_SSL_verify_mode_1()
- {
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 outlook.office365.com --tls2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justconnect --sslargs2 SSL_verify_mode=1
- }
- office365_justlogin_ssl1_ssl2()
- {
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 imap.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin
- }
- outlook_login()
- {
- office365_justlogin_ssl1_ssl2
- }
- office365_justlogin_tls()
- {
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 imap.outlook.com --tls2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin
- }
- office365_justlogin_tls2_office365()
- {
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 outlook.office365.com --tls2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin
- }
- office365_justlogin_ssl2_tls2_office365()
- {
- # Should produce "BAD Command received in Invalid state."
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 outlook.office365.com --tls2 --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin
- test "$?" = "$EXIT_TLS_FAILURE"
- }
- office365_justlogin_nossl2_notls2_office365()
- {
- # Should also produce "BAD Command received in Invalid state."
- ! $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com --ssl1 --user1 gilles.lamiral@outlook.com \
- --passfile1 ../../var/pass/secret.outlook.com \
- --host2 outlook.office365.com --notls2 --nossl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --justlogin
- }
- office365_justconnect_stunnel_ks() {
- $CMD_PERL ./imapsync \
- --host1 outlook.office365.com --ssl1 \
- --host2 ks.lamiral.info --port2 144 \
- --justconnect
- }
- office365_justconnect_stunnel_i005() {
- $CMD_PERL ./imapsync \
- --host1 outlook.office365.com --ssl1 \
- --host2 i005.lamiral.info --port2 144 \
- --justconnect
- }
- office365_justconnect_inet4_inet6()
- {
- echo force ipv4
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com \
- --host2 outlook.office365.com \
- --justconnect --inet4
- echo
- echo force ipv6
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com \
- --host2 outlook.office365.com \
- --justconnect --inet6
- echo
- # outlook.office365.com gives ipv6 2a01:111:f400:2fa2::2
- echo this one should fail but is does not
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com \
- --host2 2603:1026:4:51::2 \
- --justconnect --inet4
- echo
- # outlook.office365.com gives ipv4 40.101.42.82
- echo this one should fail but is does not
- $CMD_PERL ./imapsync \
- --host1 imap-mail.outlook.com \
- --host2 40.101.42.82 \
- --justconnect --inet6
- echo
- # outlook.office365.com gives ipv6 2603:1026:4:50::2
- echo this one should succeed
- $CMD_PERL ./imapsync \
- --host1 2603:1026:4:51::2 \
- --host2 imap-mail.outlook.com \
- --justconnect
- }
- inet4_inet6()
- {
- echo
- # outlook.office365.com gives ipv6 2603:1026:4:50::2
- # outlook.office365.com gives ipv4 52.97.129.66
- echo this one should succeed
- $CMD_PERL ./imapsync \
- --host1 2603:1026:4:50::2 \
- --host2 52.97.129.66 \
- --justconnect
- echo this one should do ipv6
- $CMD_PERL ./imapsync \
- --host1 outlook.office365.com \
- --host2 outlook.office365.com \
- --justconnect --inet6
-
- echo this one should do ipv4
- $CMD_PERL ./imapsync \
- --host1 outlook.office365.com \
- --host2 outlook.office365.com \
- --justconnect --inet4
-
- }
- l_office365_bigfolders()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --tmpdir /var/tmp --useuid --include Junk.20
- }
- l_office365_maxline()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --tmpdir /var/tmp --usecache --include Junk.2013 --maxlinelength 16000 --debugmaxlinelength
- }
- l_office365_maxline_2()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX --regextrans2 's/INBOX/tata/' \
- --minmaxlinelength 8000 --debugmaxlinelength
- }
- l_office365_maxline_3()
- {
- # It fails at 10240. So the fix is to cut at 10239
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 longlines \
- --passfile1 ../../var/pass/secret.longlines \
- --host2 imap-mail.outlook.com --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --tmpdir /var/tmp --usecache \
- --folder INBOX --regextrans2 's/INBOX/longlines/' \
- --debugmaxlinelength --errorsmax 1 --regexmess 's,(.{10239}),$1\r\n,g'
- }
- ll_empty_longlines()
- {
- ./imapsync \
- --host1 $HOST1 --user1 longlines --passfile1 ../../var/pass/secret.longlines \
- --host2 $HOST1 --user2 longlines --passfile2 ../../var/pass/secret.longlines \
- --delete1 --noexpungeaftereach --delete1emptyfolders
- }
- # Only available on ks2 (filtered by a firewall)
- l_exchange_maxline()
- {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 correu.quopiam.com --ssl2 --user2 utest@quopiam.com \
- --passfile2 ../../var/pass/secret.quopiam.com \
- --tmpdir /var/tmp --usecache \
- --folder INBOX --regextrans2 's/INBOX/longlines/' \
- --minmaxlinelength 10000 --maxlinelength 11000 --debugmaxlinelength
- }
- # In mandatory_tests
- fuzz_basic() {
- zzuf -E '^' $CMD_PERL ./imapsync
- }
- # In mandatory_tests
- fuzz_network() {
- zzuf -E '^' -d -n $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --timeout 5
- }
- # general tests end
- ##########################
- # specific tests
- ##########################
- free_ssl() {
- $CMD_PERL ./imapsync \
- --host1 imap.free.fr --user1 gilles.lamiral@free.fr --passfile1 ../../var/pass/secret.gilles_free \
- --host2 imap.free.fr --user2 gilles.lamiral@free.fr --passfile2 ../../var/pass/secret.gilles_free \
- --justlogin --ssl1 --ssl2
- }
- # xgenplus still ok on Wed Apr 3 15:36:09 CEST 2019
- xgenplus() {
- $CMD_PERL ./imapsync \
- --host1 imap.dataone.in --user1 imapsynctest@dataone.in \
- --passfile1 ../../var/pass/secret.xgenplus \
- --host2 imap.dataone.in --user2 imapsynctest@dataone.in \
- --passfile2 ../../var/pass/secret.xgenplus \
- --sep1 / --sep2 / --prefix1 "" --prefix2 "" --dry
- }
- xgenplus_feed() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.dataone.in --user2 imapsynctest@dataone.in \
- --passfile2 ../../var/pass/secret.xgenplus \
- --sep2 / --prefix2 "" \
- --include "Junk.2013" --regextrans2 "s,Junk.2013,Junk," --dry
- }
- xgenplus_few() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap.dataone.in --user2 imapsynctest@dataone.in \
- --passfile2 ../../var/pass/secret.xgenplus \
- --sep2 / --prefix2 "" \
- --include "few_emails" --dry
- }
- firstclass() {
- $CMD_PERL ./imapsync \
- --host1 mail.una.ab.ca \
- --user1 glamiral --passfile1 ../../var/pass/secret.firstclass \
- --host2 mail.una.ab.ca \
- --user2 glamiral --passfile2 ../../var/pass/secret.firstclass \
- --dry --useuid --debugcontent
- }
- firstclass_fullfill() {
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 mail.una.ab.ca \
- --user2 glamiral --passfile2 ../../var/pass/secret.firstclass \
- --debugcontent \
- --folder INBOX.few_emails --f1f2 'INBOX.few_emails=INBOX'
- }
- Alessandro_error_11()
- {
- # $CMD_PERL ./imapsync \
- # --host1 $HOST1 --user1 tata \
- # --passfile1 ../../var/pass/secret.tata \
- # --host2 $HOST2 --user2 titi \
- # --passfile2 ../../var/pass/secret.titi \
- # --folder INBOX.error_11 --debugcontent --nodry --nodry1 --pipemess 'cat /g/Alessandro_error_11.txt'
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 imap-mail.outlook.com --ssl2 --user2 gilles.lamiral@outlook.com \
- --passfile2 ../../var/pass/secret.outlook.com \
- --folder INBOX.error_11 --debugcontent --nodry --nodry1 --pipemess 'cat /g/Alessandro_error_11.txt' \
- --regexmess "s{\QSubject: =?TELETEX?Q?Fw=3APresentation_Storia_dell=5C=27Informatica?=\E}{Subject: Presentation Storia dell'Informatica}"
- # Subject: =?TELETEX?Q?Fw=3APresentation_Storia_dell=5C=27Informatica?=
- # Subject: Presentation Storia dell'Informatica
- #--pipemess W/tools/fix_email_for_exchange.py
- #--pipemess 'reformime -r7'
- }
- # End of specific tests
- huge_folder()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --include INBOX.Junk.2010 \
- --tmpdir /var/tmp --debugmemory || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_folder_headers_ALL()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --include INBOX.Junk.2010 \
- --tmpdir /var/tmp --useheader ALL --debugmemory || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_folder_2018()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 gilles@est.belle \
- --passfile2 ../../var/pass/secret.gilles_mbox \
- --folder INBOX.Junk \
- --f1f2 INBOX.Junk=INBOX.Junk.2018 \
- --search "SENTBEFORE 1-Jan-2019" \
- --tmpdir /var/tmp --usecache --delete1
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_message_ks()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 tete \
- --passfile2 ../../var/pass/secret.tete \
- --folder INBOX --minsize 100000000 \
- --tmpdir /var/tmp --debugmemory --nofoldersizes
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- echo3 'rm -f /home/tete/Maildir/cur/*'
- }
- huge_folder_ks()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 tete \
- --passfile2 ../../var/pass/secret.tete \
- --include Junk.2010 \
- --tmpdir /var/tmp
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- echo3 'rm -f /home/tete/Maildir/.Junk.2010/cur/*'
- }
- huge_folder_useuid()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --include INBOX.Junk.20 --foldersizes \
- --useuid --tmpdir /var/tmp --delete2 || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_folder_sizes_only()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --justfoldersizes --folder INBOX.Junk.2010 || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_folder_fast()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --folder INBOX.Junk.2010 \
- --fast || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- huge_folder_fast2()
- {
- date1=`date`
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --folder INBOX.Junk \
- --fast || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- echo3 'rm -f /home/vmail/tete/.Junk/cur/*'
- }
- dprof_justfoldersizes()
- {
- date1=`date`
- { $CMD_PERL -d:DProf ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --justfoldersizes --folder INBOX.Junk || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- mv tmon.out dprof_justfoldersizes_tmon.out
- dprofpp -O 30 dprof_justfoldersizes_tmon.out
- dprofpp -O 30 -I dprof_justfoldersizes_tmon.out
- }
- bigfolder()
- {
- date1=`date`
- date1epoch=`date +%s`
-
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010 --usecache
-
- date2=`date`
- date2epoch=`date +%s`
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010
-
- date3=`date`
- date3epoch=`date +%s`
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010 --usecache
-
- date4=`date`
- date4epoch=`date +%s`
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010
-
- date5=`date`
- date5epoch=`date +%s`
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010 --usecache
-
- date6=`date`
- date6epoch=`date +%s`
- $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --foldersizes --folder INBOX.Junk.2010
-
- date7=`date`
- date7epoch=`date +%s`
-
- diff_21=`expr $date2epoch - $date1epoch`
- diff_32=`expr $date3epoch - $date2epoch`
- diff_43=`expr $date4epoch - $date3epoch`
- diff_54=`expr $date5epoch - $date4epoch`
- diff_65=`expr $date6epoch - $date5epoch`
- diff_76=`expr $date7epoch - $date6epoch`
- diff_32_21=`expr $diff_32 - $diff_21`
- diff_54_43=`expr $diff_54 - $diff_43`
- diff_76_65=`expr $diff_76 - $diff_65`
- echo "[$date1] [$date2] [$date3] [$date4] [$date5] [$date6] [$date7]" | tee -a bigfolder.txt
- echo "diff [$diff_21] [$diff_32] [$diff_43] [$diff_54] [$diff_65] [$diff_76]" | tee -a bigfolder.txt
- echo "diff cache pas cache [$diff_32_21] [$diff_54_43] [$diff_76_65]" | tee -a bigfolder.txt
- echo >> bigfolder.txt
- }
- dprof_bigfolder()
- {
- date1=`date`
- { $CMD_PERL -d:DProf ./imapsync \
- --host1 $HOST1 --user1 gilles@est.belle \
- --passfile1 ../../var/pass/secret.gilles_mbox \
- --host2 $HOST2 --user2 tete@est.belle \
- --passfile2 ../../var/pass/secret.tete \
- --nofoldersizes --folder INBOX.03_imapsync.imapsync_list || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- mv tmon.out dprof_bigfolder_tmon.out
- dprofpp -O 30 dprof_bigfolder_tmon.out
- dprofpp -O 30 -I dprof_bigfolder_tmon.out
- }
- dprof_bigmail()
- {
- date1=`date`
- { $CMD_PERL -d:DProf ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.bigmail --dry --maxlinelength 8888
- echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- mv tmon.out W/dprof_bigmail_tmon.out
- dprofpp -O 30 W/dprof_bigmail_tmon.out
- dprofpp -O 30 -I W/dprof_bigmail_tmon.out
- }
- nytprof_bigmail()
- {
- date1=`date`
- { $CMD_PERL -d:NYTProf ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.bigmail --dry --maxlinelength 8888
- echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- }
- ll_nytprof()
- {
- date1=`date`
- # one time without NYTProf
- { $CMD_PERL ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- date2=`date`
- # then one time with NYTProf
- { $CMD_PERL -d:NYTProf ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi
- }
- date3=`date`
- echo3 "begin: [$date1]"
- echo3 "first: [$date2]"
- echo3 "end: [$date3]"
- }
- dprof2_bigmail()
- {
- date1=`date`
- { $CMD_PERL -d:Profile ./imapsync \
- --host1 $HOST1 --user1 tata \
- --passfile1 ../../var/pass/secret.tata \
- --host2 $HOST2 --user2 titi \
- --passfile2 ../../var/pass/secret.titi \
- --folder INBOX.bigmail --debugmemory --dry
- echo 'sudo sh -c "rm -v /home/vmail/titi/.bigmail/cur/*"' || \
- true
- }
- date2=`date`
- echo3 "[$date1] [$date2]"
- mv prof.out W/dprof2_bigmail_tmon.out
- }
- curl_online_args()
- {
- curl -v --data 'host1=test1.lamiral.info;user1=test1;password1=secret1;host2=test2.lamiral.info;user2=test2;password2=secret2;simulong=2' \
- https://imapsync.lamiral.info/cgi-bin/imapsync
- }
- curl_online_testslive()
- {
- curl -v --data 'testslive=1;simulong=2' https://imapsync.lamiral.info/cgi-bin/imapsync
- }
- curl_online_args_pidfile()
- {
- curl -v --data"host1=test1.lamiral.info;user1=test1;password1=secret1;host2=test2.lamiral.info;user2=test2;password2=secret2;pidfile=/tmp/curl_online_args_pidfile_$$.txt" \
- https://imapsync.lamiral.info/cgi-bin/imapsync
- }
- curl_online_args_nolog()
- {
- curl -v --data 'host1=test1.lamiral.info;user1=test1;password1=secret1;host2=test2.lamiral.info;user2=test2;password2=secret2;justbanner=1;log=' \
- https://lamiral.info/cgi-bin/imapsync
- }
- curl_online_args_nolog_2()
- {
- curl -v --data 'host1=test1.lamiral.info;user1=test1;password1=secret1;host2=test2.lamiral.info;user2=test2;password2=secret2;justbanner=1;log=0' \
- https://lamiral.info/cgi-bin/imapsync
- }
- curl_online_justbanner()
- {
- curl -v --data 'host1=test1.lamiral.info;user1=test1;password1=secret1;host2=test2.lamiral.info;user2=test2;password2=secret2;simulong=0.7;justbanner=1' \
- https://lamiral.info/cgi-bin/imapsync
- }
- curl_online_file()
- {
- cat > W/tmp/cred.txt <<EOF
- host1=test1.lamiral.info;
- user1=test1;
- password1=secret1;
- host2=test2.lamiral.info;
- user2=test2;
- password2=secret2;
- simulong=2;
- dry=1;
- EOF
- curl -v --data '@W/tmp/cred.txt' \
- https://imapsync.lamiral.info/cgi-bin/imapsync
- }
- curl_online_args_json()
- {
- # DO NOT WORK AT ALL
- ! curl -v --data '{ "testslive":"1" }' -H "Content-Type: application/json" \
- https://imapsync.lamiral.info/cgi-bin/imapsync
- }
- # * 1.810 https://tools.controlpanel.si/imapsync/ CGI https://tools.controlpanel.si/cgi-bin/imapsync
- # * 1.882 https://tools.intertune.io/imapsync/X/ CGI https://tools.intertune.io/cgi-bin/imapsync
- # * 1.882 https://imapsync.whc.ca/ CGI https://imapsync.whc.ca/cgi-bin/imapsync
- # * 1.925 https://imapsync.boomhost.com/ CGI https://imapsync.boomhost.com/cgi-bin/imapsync
- # * 1.977 https://imapcopy.webhosting4u.gr/ CGI https://imapcopy.webhosting4u.gr/cgi-bin/imapsync
- # * 1.991 https://imapsync.nl/ CGI https://imapsync.nl/cgi-bin/imapsync
- # * 1.998 https://mailsync.timetakernet.info/ CGI https://mailsync.timetakernet.info/cgi-bin/imapsync
- #Detected by releasecheck:
- # * 1.957 http://migracao.hahost.com.br/migrar2.html CGI http://migracao.hahost.com.br/cgi-bin/imapsync
- # * 1.967 CGI https://jcenter.nara-edu.ac.jp/cgi-bin/imapsync
- # * 1.973 http://77.68.7.106/ CGI http://77.68.7.106/cgi-bin/imapsync
- # * 1.979 CGI http://mail2.nara-edu.ac.jp/cgi-bin/imapsync
- # * 1.979 CGI https://imapsync.bepulse.com/cgi-bin/imapsync
- # * 1.990 https://transfer.keliweb.com/X/ CGI https://transfer.keliweb.com/cgi-bin/imapsync
- # * 1.998 CGI https://web-tools.na.icb.cnr.it/cgi-bin/imapsync
- # * 1.998 CGI https://140.164.23.4/cgi-bin/imapsync
- # * ?.??? https://app.migrationwizard.co.uk/ CGI 404, deep into https://app.migrationwizard.co.uk/sync.php
- curl_online_external()
- {
- # curl
- # -v verbose
- # -s silent
- for imapsync in \
- https://imapsync.lamiral.info/cgi-bin/imapsync \
- https://tools.controlpanel.si/cgi-bin/imapsync \
- https://tools.intertune.io/cgi-bin/imapsync \
- https://imapsync.whc.ca/cgi-bin/imapsync \
- https://imapsync.boomhost.com/cgi-bin/imapsync \
- https://imapcopy.webhosting4u.gr/cgi-bin/imapsync \
- https://imapsync.nl/cgi-bin/imapsync \
- https://mailsync.timetakernet.info/cgi-bin/imapsync \
- https://jcenter.nara-edu.ac.jp/cgi-bin/imapsync \
- https://imapsync.bepulse.com/cgi-bin/imapsync \
- https://transfer.keliweb.com/cgi-bin/imapsync \
- https://web-tools.na.icb.cnr.it/cgi-bin/imapsync \
- https://140.164.23.4/cgi-bin/imapsync \
- ; do
- curl -k -s --data 'justconnect=1;host1=mail.unionstrategiesinc.com;user1=a;user2=a;host2=mail5.unionstrategiesinc.com;simulong=2' \
- $imapsync
- #sleep 2
- done
- }
- ##########################
- ##########################
- # Tests list
- mandatory_tests='
- no_args
- option_version
- option_tests
- option_tests_in_var_tmp
- option_tests_in_var_tmp_sub
- option_testsdebug
- option_releasecheck
- option_noreleasecheck
- option_bad_delete2
- option_extra_arguments
- option_extra
- passfile1_noexist
- passfile2_noexist
- passwords_masked
- passwords_not_masked
- first_sync_dry
- first_sync
- ll
- ll_host_sanitize
- pidfile_well_removed
- pidfile_bad
- ll_pidfilelocking
- test_tail
- justbanner
- nomodules_version
- xxxxx_gmail
- gmail_xxxxx
- gmail
- gmail_gmail
- gmail_gmail_INBOX
- gmail_gmail_folderfirst
- gmail_glX_all_justlogin
- yahoo_xxxx_login_tls
- yahoo_xxxx_login
- yahoo_xxxx
- yahoo_fail_UNAVAILABLE
- free_ssl
- office365_justconnect_inet4_inet6
- office365_justconnect_tls_SSL_verify_mode_1
- ll_unknow_option
- ll_ask_password
- ll_env_password
- ll_bug_folder_name_with_blank
- ll_skipcrossduplicates_usecache
- ll_timeout
- ll_timeout1_timeout2
- ll_timeout_very_small
- ll_folder
- ll_folder_noexist
- ll_folder_mixfolders
- ll_nocheckselectable
- ll_checkselectable
- ll_checkselectable_nb_folders
- ll_nocheckfoldersexist
- ll_checkfoldersexist
- ll_subfolder2
- ll_subfolder1
- ll_subfolder1_INBOX_SUB
- ll_subfolder1_DOES_NOT_EXIST
- ll_oneemail
- ll_buffersize
- ll_justfolders
- ll_justfolders_delete1emptyfolders
- ll_justfolders_skipemptyfolders
- ll_f1f2_01
- ll_prefix12
- ll_nosyncinternaldates
- ll_idatefromheader
- ll_folder_rev
- ll_subscribed
- ll_nosubscribe
- ll_justfoldersizes
- ll_justfoldersizes_noexist
- ll_authmd5
- ll_authmd51
- ll_authmd52
- ll_noauthmd5
- ll_maxage
- ll_maxsize
- ll_skipsize
- ll_skipheader
- ll_include
- ll_exclude
- ll_exclude_INBOX
- ll_regextrans2
- ll_sep2
- ll_bad_login
- ll_authentication_failure_user1
- ll_authentication_failure_user2
- ll_authentication_failure_user12
- ll_bad_host1
- ll_bad_host2
- ll_bad_host12
- ll_bad_host_ssl
- ll_useheader
- ll_useheader_noheader
- ll_regexmess
- ll_regexmess_8bit_X
- ll_regexmess_bad_regex
- ll_regexmess_add_header
- ll_regexmess_add_header_path
- ll_regexmess_scwchu
- ll_skipmess
- ll_skipmess_8bits
- ll_skipmess_Content_Type_Message_partial
- ll_pipemess_nocmd
- ll_pipemess_false
- ll_pipemess_true
- ll_pipemess
- ll_pipemess_catcat
- ll_flags
- ll_resyncflags
- ll_noresyncflags
- ll_syncflagsaftercopy
- ll_regex_flag
- ll_regex_flag_bad
- ll_regex_flag_keep_only
- ll_justconnect
- ll_justconnect_ipv6
- ll_justconnect_ipv6_nossl
- ll_justhost1
- ll_justhost2
- ll_justlogin
- ll_justconnect_devel
- ll_ssl
- ll_ssl_justconnect
- ll_ssl_justlogin
- ll_ssl_justconnect_sslargs
- ll_tls_justconnect
- ll_tls_justlogin
- ll_tls
- ll_tls_justlogin_sslargs_failure_EXIT_TLS_FAILURE
- ll_authmech_PLAIN
- ll_authmech_xoauth2_gmail
- ll_authmech_xoauth2_json_gmail
- ll_authmech_LOGIN
- ll_authmech_CRAMMD5
- ll_authmech_PREAUTH
- ll_authmech_NTLM
- ll_authmech_NTLM_domain
- ll_authmech_NTLM_trylogin_ok
- ll_authmech_NTLM_trylogin_fail
- ll_authuser
- ll_proxyauth_missing_authuser
- ll_proxyauth_authuser
- ll_delete1_delete2
- ll_delete2
- ll_delete1
- ll_delete1_twoemails
- ll_folderrec
- ll_memory_consumption
- ll_newmessage
- ll_usecache
- ll_usecache_noheader
- ll_usecache_debugcache
- ll_nousecache
- ll_delete2foldersonly_NEW_3
- ll_delete2foldersonly_dry
- ll_delete2foldersonly_subfolder2
- ll_delete2foldersbutnot
- ll_folder_create
- ll_folder_create_INBOX_Inbox
- ll_delete2folders
- ll_useuid
- ll_useuid_nousecache
- ll_noheader_force
- ll_noheader
- ll_domino1_domino2
- ll_domino2
- ll_with_flags_errors
- ll_errorsmax
- ll_exitwhenover
- ll_exitwhenover_noerrorsdump
- fuzz_basic
- fuzz_network
- testslive
- testslive6
- ll_abort_pidfile_no_exist
- ll_abort_noprocess
- ll_abort_not_a_pid_number
- ll_abort_basic
- ll_abort_cgi_context_tail
- ll_abort_no_pidfile_option
- ll_abort_byfile_hand_made
- ll_abort_byfile_imapsync_made
- ll_abort_byfile_normal_run
- ll_sigreconnect_INT
- ll_diff_log_stdout_debugssl
- curl_online_args
- curl_online_file
- ksks_reset_test1
- memory_stress
- '
- # 2019_12 Removed
- # ks_justconnect_ipv6_nossl
- # ks_justconnect_ipv6
- other_tests='
- archiveopteryx_1
- msw
- msw2
- ll_bigmail
- ll_justlogin_backslash_char
- '
- l() {
- echo "$mandatory_tests" "$other_tests"
- }
- # minimal and fatal tests
- run_tests perl_syntax || exit 1
- set_return_code_variables
- if test $# -eq 0; then
- # mandatory tests
- if run_tests $mandatory_tests; then
- ./imapsync --version >> .tests_passed
- return 0
- fi
- else
- # selective tests
- run_tests "$@"
- return $?
- fi
|