Új hozzászólás Aktív témák

  • Enoch

    csendes tag

    Sziasztok! Imapsync-et ismeri valami? Egy batch programból lehet futtani és postafiók tartalmakat lehet szinkronizálni. Van egy loop változata ahol txt fájlból szedi össze amásolni kívánt fiók adatokat.
    Meg lehet adni argumentumokat, ezekkel vagyok elveszve, hogy pontosan hol adom meg.

    CD /D %~dp0

    @REM Let's get arguments of this batch, they will be added to imapsync arguments, if any.
    @REM Do not touch this part to add arguments to imapsync, do that in the FOR loop below
    @SET arguments= & @SET command=%~0
    @IF %1. EQU . GOTO args_end
    :args_loop
    @SET arguments=%arguments% %1 & @SHIFT
    @IF %1. NEQ . GOTO args_loop
    @ECHO Command and arguments: %command% %arguments%
    :args_end

    @REM Now the loop on the csv file.
    SET csvfile=file.txt

    @FOR /F "tokens=1,2,3,4,5,6,7 delims=; eol=#" %%G IN (%csvfile%) DO (
    @REM Blank lines are usually ignored. Dumping the tokens in [] in case debugging is needed
    @ECHO GOT those values from %csvfile% presented inside brackets: [%%G] [%%H] [%%I] [%%J] [%%K] [%%L] [%%M]
    @REM You can add extra arguments to imapsync after the variable named %arguments%
    @ECHO ==== Starting imapsync from --host1 %%G --user1 %%H to --host2 %%J --user2 %%K ====
    @imapsync ^
    --host1 %%G --user1 %%H --password1 %%I ^
    --host2 %%J --user2 %%K --password2 %%L %%M %arguments%
    --automap --useuid --nossl1 --notls1
    @ECHO ==== Ended imapsync from --host1 %%G --user1 %%H to --host2 %%J --user2 %%K ====
    @ECHO.
    )

    @ECHO Loop finished!
    @ECHO Log files are in LOG_imapsync directory
    @PAUSE

    Eddig fiókoknként külün fájlt használtam rá. De egyre több fiók lenne amit másolni szeretnék és ez praktikusabb lenne. Ahol egy fájlban volt ott ezek működtek: --automap --nossl1 --notls1

    .\imapsync.exe --host1 test1.lamiral.info --user1 test1 --password1 "secret1" ^
    --host2 test2.lamiral.info --user2 test2 --password2 "secret2" ^
    --automap --nossl1 --notls1

    Ezektre lenne szükségesm most is, de nem igazán tiszta, hogy hol kell megadni.
    Ahol most van a kódban ott ezt a hibát adja rá: '--automap' is not recognized as an internal or external command, operable program or batch file.

    Előre is köszönöm a segítséget!

Új hozzászólás Aktív témák

Hirdetés