D~PTT.BCKPTT.BCK*BACK/GROUP=0 *.*/EXCL=*.OBJ [-]PTT.BCK/SAV SYSTEM /}V5.3 _BATMAN::  _$1$DUA7: V5.3 ~ *[SRC.PTT]ARGS.C;1+,./ 4O-30123KPWO56 d8d7HPd89@WvGHJ /*3 * ARGS.C - command line argument handling for PTT.9 * Copyright (C) Nick Brown, 1991. All rights reserved. */#include climsgdef#include descrip#include ssdef#include "ptt.h"/*( * Return arguments in buffers provided. */voidget_args (username, flags) char *username; int *flags;{ int status; *flags = 0;* if (my_present("ALL") == CLI$_PRESENT) { strcpy(username, ""); }. else if (my_present("P1") == CLI$_PRESENT) {6 if (my_get_value("P1", username) == CLI$_ABSENT) {) panic("get_args: problem with P1"); } } else {! panic("No username or /ALL"); }- if (my_present("DELETE") == CLI$_PRESENT) { *flags |= PTT_DELETE; } else {. if (my_present("FIXUP") == CLI$_PRESENT) { *flags |= PTT_FIXUP; }' status = my_present("CONSISTENCY");A if ((status == CLI$_PRESENT) || (status == CLI$_DEFAULTED)) { *flags |= PTT_CONSISTENCY; }2 if (my_present("EXISTENCE") == CLI$_PRESENT) { *flags |= PTT_EXISTENCE; }6 if (my_present("FORWARD_CHECK") == CLI$_PRESENT) {" *flags |= PTT_FORWARD_CHECK; } } if (*flags == 0) {9 printf("Specify at least one operation qualifier\n"); exit(4); }}/*C * Function to call cli$get_value with valid descriptor parameters. */staticmy_get_value (qualifier, value) char *qualifier; char *value;{! $DESCRIPTOR(qualifier_des, ""); $DESCRIPTOR(value_des, ""); int result; short retlen;O qualifier_des.dsc$w_length = strlen(qualifier_des.dsc$a_pointer = qualifier);" value_des.dsc$a_pointer = value;# value_des.dsc$w_length = ARGSIZE;> result = cli$get_value(&qualifier_des, &value_des, &retlen); if (result & 1) { value[retlen] = '\0'; } return result;}/*B * Function to call cli$present with a valid descriptor parameter. */staticmy_present (qualifier) char *qualifier;{! $DESCRIPTOR(qualifier_des, ""); int result;O qualifier_des.dsc$w_length = strlen(qualifier_des.dsc$a_pointer = qualifier);' result = cli$present(&qualifier_des); return result;}*[SRC.PTT]MAILMSGDEF.H;1+,6. / 4" -30123KPWO 56[N7 XX89@WvGHJ#define MAIL$_FACILITY 126#define MAIL$_CODERR 8290316#define MAIL$_UPGRADE 8290324#define MAIL$_UAFGETERR 8290330#define MAIL$_UAFOPNERR 8290338#define MAIL$_NOSUCHUSR 8290346#define MAIL$_NOTREADIN 8290354#define MAIL$_LOGLINK 8290362#define MAIL$_CREPRIJOB 8290370#define MAIL$_SENDERR 8290378#define MAIL$_NOMOREMSG 8290386#define MAIL$_NOMSGS 8290394#define MAIL$_USERSPEC 8290402#define MAIL$_SENDABORT 8290410#define MAIL$_EDITPROC 8290418#define MAIL$_INVCMD 8290426#define MAIL$_NOTFOUND 8290434#define MAIL$_NETIOERR 8290442#define MAIL$_USERDSABL 8290450#define MAIL$_FORWLOOP 8290458#define MAIL$_NAMTOOBIG 8290466#define MAIL$_ILLCHAR 8290474#define MAIL$_DATIMUSED 8290482#define MAIL$_NOTISAM 8290490#define MAIL$_DELMSG 8290498#define MAIL$_DELWASTE 8290506#define MAIL$_NOFOLDER 8290514#define MAIL$_NOTEXIST 8290522#define MAIL$_NOTSUBDIR 8290530#define MAIL$_ILLSUBDIR 8290538#define MAIL$_ILLFOLNAM 8290546#define MAIL$_NOMSGPRI 8290554#define MAIL$_ALTPRIJOB 8290562#define MAIL$_ILLPERNAM 8290570!#define MAIL$_NOSUCHUSRAT 8290578#define MAIL$_SENDERRAT 8290586#define MAIL$_CONABORT 8290594#define MAIL$_NOTCALEDT 8290602"#define MAIL$_FILECONFUSED 8290610#define MAIL$_CAPTIVE 8290618#define MAIL$_IVPROTVAL 8290626#define MAIL$_RECTOBIG 8290634#define MAIL$_ILLCTXADR 8290642#define MAIL$_WRONGCTX 8290650#define MAIL$_FAILGETVM 8290658#define MAIL$_INVITMCOD 8290666#define MAIL$_MISREQITM 8290674#define MAIL$_INVITMLEN 8290682#define MAIL$_FILEOPEN 8290690 #define MAIL$_NOFILEOPEN 8290698#define MAIL$_CONITMCOD 8290706#define MAIL$_NOMORECTX 8290714#define MAIL$_WRONGFILE 8290722#define MAIL$_ILLTPRT 8290730#define MAIL$_INVITMVAL 8290738#define MAIL$_ERACTED 8290746#define MAIL$_FORMSG 8290754#define MAIL$_NOTFORMSG 8290762#define MAIL$_ERRACTRNS 8290770#define MAIL$_BADVALUE 8290778#define MAIL$_CLOSEDEL 8290786#define MAIL$_FILNOTDEL 8290794#define MAIL$_OPENIN 8290802#define MAIL$_OPENOUT 8290810#define MAIL$_PARSEFAIL 8290818#define MAIL$_READERR 8290826 #define MAIL$_SEARCHFAIL 8290834#define MAIL$_SYSERROR 8290842#define MAIL$_NOSYSNAM 8290850#define MAIL$_NOSYSPRV 8290858#define MAIL$_PROTOCOL 8290866 #define MAIL$_NOACCPTMSG 8290874#define MAIL$_SELECTED 8306307#define MAIL$_DELMSGS 8306315#define MAIL$_CVTFILE 8306323#define MAIL$_DELSPACE 8306331#define MAIL$_NEWFOLDER 8306339!#define MAIL$_RECLPLSWAIT 8306347#define MAIL$_REENTER 8306355#define MAIL$_MOREMSG 8314304#define MAIL$_DIRHD0 8314312#define MAIL$_DIRHD10 8314320#define MAIL$_DIRHD20 8314328#define MAIL$_DIRDEL10 8314336#define MAIL$_ISUB10 8314344#define MAIL$_ISUB20 8314352#define MAIL$_ISUB30 8314360#define MAIL$_PRESRET 8314368 #define MAIL$_YOUHAVENEW 8314376#define MAIL$_MAIL10 8314384#define MAIL$_MAIL20 8314392#define MAIL$_WANTOSEND 8314400#define MAIL$_NOTIFY10 8314408#define MAIL$_NOTIFY20 8314416 #define MAIL$_JOBENTERED 8314424#define MAIL$_SHOW10 8314432#define MAIL$_SHOW20 8314440#define MAIL$_SHOW30 8314448#define MAIL$_SHOW40 8314456#define MAIL$_SHOW50 8314464#define MAIL$_SHOW60 8314472#define MAIL$_SHOW70 8314480#define MAIL$_SHOW80 8314488#define MAIL$_SHOW90 8314496#define MAIL$_SHOW100 8314504#define MAIL$_SHOW110 8314512#define MAIL$_EDIT10 8314520#define MAIL$_INFO10 8314528#define MAIL$_INFO20 8314536#define MAIL$_INFO30 8314544#define MAIL$_SEND 8314552#define MAIL$_REPLY 8314560#define MAIL$_SHOW120 8314568#define MAIL$_SHOW130 8314576#define MAIL$_INFO50 8314584#define MAIL$_SHOW140 8314592#define MAIL$_SHOW150 8314600#define MAIL$_SHOW160 8314608#define MAIL$_ISUB50 8314616#define MAIL$_MAIL30 8314624#define MAIL$_RETCONT 8314632#define MAIL$_NEWSEQ 8314640#define MAIL$_MAILDIR 8314648#define MAIL$_MAILFILE 8314656 #define MAIL$_MAILFOLDER 8314664#define MAIL$_MAIL40 8314672 #define MAIL$_CRENEWFOLD 8314680#define MAIL$_NONEWMAIL 8314688#define MAIL$_SHOWKEY10 8314696#define MAIL$_SHOWKEY20 8314704#define MAIL$_SHOWKEY30 8314712#define MAIL$_SHOWKEY40 8314720#define MAIL$_SHOWKEY50 8314728#define MAIL$_SHOWKEY60 8314736#define MAIL$_SHOWKEY70 8314744#define MAIL$_NOTIFY30 8314752#define MAIL$_NOTIFY40 8314760#define MAIL$_NOPARENT 8314768#define MAIL$_FILEMPTY 8314776#define MAIL$_NONEFOUND 8314784#define MAIL$_NOMOREREC 8314792#define MAIL$_USERFWD 8314800#define MAIL$_PROMPT 8314808#define MAIL$_INFO12 8314816#define MAIL$_INFO14 8314824#define MAIL$_INFO16 8314832#define MAIL$_INFO18 8314840 #define MAIL$_CRENEWFILE 8314848#define MAIL$_SHOW15 8314856#define MAIL$_SHOW25 8314864#define MAIL$_SHOW35 8314872#define MAIL$_FORWARD 8314880#define MAIL$_SHOW200 8314888#define MAIL$_SHOW205 8314896#define MAIL$_SHOW210 8314904#define MAIL$_SHOW215 8314912#define MAIL$_CLOSEIN 8314920#define MAIL$_CLOSEOUT 8314928#define MAIL$_INVQUAVAL 8314936#define MAIL$_WRITEERR 8314944#define MAIL$_SHOW220 8314952#define MAIL$_SHOW225 8314960#define MAIL$_MSGTEXT 8322305#define MAIL$_MSGINFO 8322313#define MAIL$_MSGSENT 8322321#define MAIL$_MSGSENTAT 8322329#define MAIL$_YES 8322337#define MAIL$_COPIEDR 8322345#define MAIL$_CREATED 8322353#define MAIL$_RENAMED 8322361#define MAIL$_TEXT 8322369#define MAIL$_MAILFOLD 8322377#define MAIL$_WASTEFOLD 8322385*[SRC.PTT]PROCESS.C;1+,d./ 4O-30123KPWO56 9}74}89GHJ/*. * PROCESS.C - do the main processing for PTT.9 * Copyright (C) Nick Brown, 1991. All rights reserved. */#include descrip#include maildef#include rmsdef#include ssdef#include stdio#include "mailmsgdef.h"#include "ptt.h"static ITEMLIST nlist [] = { { 0, 0, 0, 0 }}; #ifdef DEBUG/*- * Handle errors signalled by MAIL$ routines. */staticint)handler (int sigargs [], int mechargs []){ fprintf(stderr, "Handler\n");" if (lib$match_cond (&sigargs[1],$ &MAIL$_OPENIN,$ &MAIL$_NOMSGS,& &MAIL$_NOTEXIST,$ &MAIL$_NOTISAM ) ) { return SS$_CONTINUE; } else { return SS$_RESIGNAL; }}#endif/*B * Process mail file according to arguments, for one or all users. */voidprocess (char *user, int flags){ int status; int context; int one_user; int go_on; int actual_new_known;#define USERNAME_LEN 64# char username [USERNAME_LEN + 1]; int username_len;#define FORWARD_LEN 255! char forward [FORWARD_LEN + 1]; int forward_len;#define FULLDIR_LEN 255! char fulldir [FULLDIR_LEN + 1]; int fulldir_len;#define SUBDIR_LEN 255 char subdir [SUBDIR_LEN + 1]; int subdir_len; short profile_new; short actual_new; ITEMLIST user_list_in [] = {) { 0, 0, 0, 0 }, /* filled in later */ { 0, MAIL$_NOSIGNAL, 0, 0 }, { 0, 0, 0, 0 } }; ITEMLIST user_list_out [] = {4 { 2, MAIL$_USER_NEW_MESSAGES, &profile_new, 0 },J { USERNAME_LEN, MAIL$_USER_RETURN_USERNAME, username, &username_len },B { FORWARD_LEN, MAIL$_USER_FORWARDING, forward, &forward_len },F { FULLDIR_LEN, MAIL$_USER_FULL_DIRECTORY, fulldir, &fulldir_len },B { SUBDIR_LEN, MAIL$_USER_SUB_DIRECTORY, subdir, &subdir_len }, { 0, 0, 0, 0 } }; #ifdef DEBUG lib$establish(handler);#endif context = 0;I if ((status = mail$user_begin(&context, nlist, nlist)) != SS$_NORMAL) { exit(status); } if (one_user = *user) {/ user_list_in[0].code = MAIL$_USER_USERNAME;D user_list_in[0].buflen = strlen(user_list_in[0].bufaddr = user); } else {, user_list_in[0].code = MAIL$_USER_FIRST; } go_on = 1; while (go_on) {G status = mail$user_get_info(&context, user_list_in, user_list_out);$ if (status == MAIL$_NOMOREREC) { break; }) else if (status == MAIL$_NOSUCHUSR) {9 printf("%s: No MAIL profile record found\n", user); break; }$ else if (status != SS$_NORMAL) { exit(status); }/*: * Loop again next time, unless only one user is required. */ if (one_user) { go_on = 0; } else {- user_list_in[0].code = MAIL$_USER_NEXT; }/*+ * Now that we have one record, process it. */" username[username_len] = '\0'; forward[forward_len] = '\0'; fulldir[fulldir_len] = '\0'; subdir[subdir_len] = '\0';/*+ * Delete record, if required by CLI flags. */ if (flags & PTT_DELETE) {) ITEMLIST user_delete_list_in [] = {? { strlen(username), MAIL$_USER_USERNAME, username, 0 }, { 0, 0, 0, 0 } };K status = mail$user_delete_info(&context, user_delete_list_in, nlist);! if (status != SS$_NORMAL) { exit(status); }< printf("%s: MAIL profile record deleted\n", username); continue; }/* * Check if user exists in UAF. */ if (flags & PTT_EXISTENCE) {* if (!see_if_user_exists(username)) {M printf("** %s: Username in MAIL profile but not in UAF\n", username); if (flags & PTT_FIXUP) {- ITEMLIST user_delete_list_in [] = {C { strlen(username), MAIL$_USER_USERNAME, username, 0 }, { 0, 0, 0, 0 } };O status = mail$user_delete_info(&context, user_delete_list_in, nlist);% if (status != SS$_NORMAL) { exit(status); }M printf("** %s: Fixed by deleting MAIL profile record\n", username); } continue; } }/*: * Check new mail count is consistent with NEWMAIL folder. */ actual_new_known = 0;" if (flags & PTT_CONSISTENCY) {? actual_new = get_new_count(username, fulldir, subdir, 1); actual_new_known = 1;= if ((actual_new >= 0) && (profile_new != actual_new)) {? printf("** %s: New mail flag: %d Actual count: %d\n",9 username, profile_new, actual_new ); if (flags & PTT_FIXUP) {* ITEMLIST user_new_list_in [] = {C { strlen(username), MAIL$_USER_USERNAME, username, 0 },? { 2, MAIL$_USER_SET_NEW_MESSAGES, &actual_new, 0 }, { 0, 0, 0, 0 } };I status = mail$user_set_info(&context, user_new_list_in, nlist);% if (status != SS$_NORMAL) { exit(status); }N printf("** %s: Fixed by setting count to actual value\n", username); } } }/*, * Check forwarding address is "reasonable".M * This is defined as: a remote address (with ::), or a VALID local username.A * If user has forwarded mail, check no new messages are waiting. */7 if ((flags & PTT_FORWARD_CHECK) && (forward_len)) {O if (((strstr(forward, "::")) != NULL) || (see_if_user_exists(forward))) {3 int ugly_ducklings = ( (actual_new_known)- ? (actual_new)J : (get_new_count(username, fulldir, "", 0)) );! if (ugly_ducklings > 0) {H printf("%s: Forwarding to %s, left behind %d new message%s\n",4 username, forward, ugly_ducklings,2 (ugly_ducklings == 1 ? "" : "s") ); } else {> printf("%s: Forwarding to %s\n", username, forward); } } else {= printf("** %s: Forwarding to non-existent user %s\n",* username, forward); if (flags & PTT_FIXUP) {0 ITEMLIST user_noforward_list_in [] = {C { strlen(username), MAIL$_USER_USERNAME, username, 0 },6 { 0, MAIL$_USER_SET_NO_FORWARDING, 0, 0 }, { 0, 0, 0, 0 } };O status = mail$user_set_info(&context, user_noforward_list_in, nlist);% if (status != SS$_NORMAL) { exit(status); }L printf("** %s: Fixed by clearing forwarding address\n", username); } } } }}/*, * Return actual count of messages for user.( * Returns -1 if some file error occurs.9 * If moan is true, output warning messages on any error. */staticEget_new_count (char *username, char *fulldir, char *subdir, int moan){ int context; int status; int messages; int file_open;! char defspec [FULLDIR_LEN + 1];' ITEMLIST mailfile_list_open_in [] = {K { 0, MAIL$_MAILFILE_DEFAULT_NAME, defspec, 0 }, /* buflen done below */7 { strlen("MAIL"), MAIL$_MAILFILE_NAME, "MAIL", 0 }, { 0, MAIL$_NOSIGNAL, 0, 0 }, { 0, 0, 0, 0 } }; strcpy(defspec, fulldir); strcat(defspec, ".MAI");F mailfile_list_open_in[0].buflen = strlen(defspec); /* as promised */ context = 0;M if ((status = mail$mailfile_begin(&context, nlist, nlist)) != SS$_NORMAL) { exit(status); } messages = 0; file_open = 0;F status = mail$mailfile_open(&context, mailfile_list_open_in, nlist);= if ((status == MAIL$_NOMSGS) || (status == MAIL$_OPENIN)) { if (moan) {4 printf("%s: Cannot find MAIL file", username); if (*subdir) {3 printf(" (check subdirectory %s)", subdir); } printf("\n"); } messages = -1; }: else if ((status == RMS$_DNF) || (status == RMS$_DEV)) { if (moan) {C printf("%s: Mail directory %s not found", username, fulldir);. if ((status == RMS$_DNF) && (*subdir)) {3 printf(" (check subdirectory %s)", subdir); } printf("\n"); } messages = -1; }" else if (status == SS$_NORMAL) { file_open = 1; } else { exit(status); } if (file_open) {D messages = count_in_folder("NEWMAIL", &context, username, moan);O if ((status = mail$mailfile_close(&context, nlist, nlist)) != SS$_NORMAL) { exit(status); } }K if ((status = mail$mailfile_end(&context, nlist, nlist)) != SS$_NORMAL) { exit(status); } return messages;}/*- * Return number of messages in given folder.O * Note that if this routine is to be called many times for a single mail file,I * the whole sequence should be rewritten; see the MAIL routines manual. * For moan, see above. */staticKcount_in_folder (char *folder, int *file_context, char *username, int moan){ int context; int status; int count;' ITEMLIST message_begin_list_in [] = {3 { 4, MAIL$_MESSAGE_FILE_CTX, file_context, 0 }, { 0, 0, 0, 0 } };! ITEMLIST message_list_in [] = {8 { strlen(folder), MAIL$_MESSAGE_FOLDER, folder, 0 }, { 0, MAIL$_NOSIGNAL, 0, 0 }, { 0, 0, 0, 0 } };" ITEMLIST message_list_out [] = {- { 4, MAIL$_MESSAGE_SELECTED, &count, 0 }, { 0, 0, 0, 0 } }; context = 0;F status = mail$message_begin(&context, message_begin_list_in, nlist); if (status != SS$_NORMAL) { exit(status); }L status = mail$message_select(&context, message_list_in, message_list_out);! if (status == MAIL$_NOTEXIST) { count = 0; }% else if (status == MAIL$_NOTISAM) { if (moan) {3 printf("%s: Mail file not ISAM\n", username); } count = -1; }" else if (status != SS$_NORMAL) { exit(status); }J if ((status = mail$message_end(&context, nlist, nlist)) != SS$_NORMAL) { exit(status); } return count;}*[SRC.PTT]PTT.C;1+,:./ 49.-30123KPWO56#qT7tX89@WvGHJ/*$ * PTT.C - manage mail control file.9 * Copyright (C) Nick Brown, 1991. All rights reserved. */#include "ptt.h"main (argc, argv) int argc; char *argv [];{ char username [ARGSIZE]; int flags = 0; get_args(username, &flags); process(username, flags);}*[SRC.PTT]PTT.CLD;1+,B./ 4K-30123KPWO56#KX7Jb89@WvGHJDEFINE VERB PTT IMAGE "PTT" PARAMETER P1! PROMPT="Username"3! VALUE (TYPE=$FILE, LIST, REQUIRED) ! QUALIFIER USER, DEFAULT! NONNEGATABLE! VALUE QUALIFIER ALL NONNEGATABLE DISALLOW P1 AND ALL!8! CONSISTENCY checks that the new mail count is correct.!& QUALIFIER CONSISTENCY, DEFAULT!K! EXISTENCE checks that the user (from the mail profile) exists in the UAF.! QUALIFIER EXISTENCE!E! FORWARD_CHECK checks that any forwarding is to a valid destination.! QUALIFIER FORWARD_CHECK!>! FIXUP corrects problems in any of the above, where possible.! QUALIFIER FIXUP!2! DELETE simply deletes the user's profile record.! QUALIFIER DELETE! DISALLOW DELETE AND FIXUP DISALLOW DELETE AND ALLG DISALLOW DELETE AND (CONSISTENCY OR EXISTENCE OR FORWARD_CHECK)*[SRC.PTT]PTT.EXE;1+,./ 4-30123 KPWO565Nd7%Qd89@WvGHJ0DX0205(EMdPTTV1.0EMd05-05  ? ! VAXCRTL_001! LIBRTL_001! MTHRTL_001 j! MAILSHR_001!@! MAILSHRP_001"! SECURESHR_001#!SECURESHRP_001ALLP1P1get_args: problem with P1No username or /ALLDELETEFIXUPCONSISTENCYEXISTENCEFORWARD_CHECKSpecify at least one operation qualifier Handler %s: No MAIL profile record found %s: MAIL profile record deleted ** %s: Username in MAIL profile but not in UAF ** %s: Fixed by deleting MAIL profile record ** %s: New mail flag: %d Actual count: %d ** %s: Fixed by setting count to actual value ::%s: Forwarding to %s, left behind %d new message%s s%s: Forwarding to %s ** %s: Forwarding to non-existent user %s ** %s: Fixed by clearing forwarding address MAILMAIL.MAI%s: Cannot find MAIL file (check subdirectory %s) %s: Mail directory %s not found (check subdirectory %s) NEWMAIL%s: Mail file not ISAM PTT: panic: %s ^Wԭ߭ݭP^RԼbP–PݭP Pߢݬ1PޢP–PݭP꟭ PzޢTЬSڐܐ”޴•TݭVPS曏?⟭p PQP2P@cQPPߢ   ߢ% ޢ9PҐԐ–PݭPҟ P1ޢ@Pʐ̐–PݭPʟ PޢFPĐ–PݭgPŸM PQQ Q!ޢRP–PݭP Pޢ\P–Pݭ P Pռߢj  P ^IR”•Ьݭk PЬSS?꟭ PQP2P@cQP ^R–Ьݭ P ^ Џ~߭Џڀ~߭ЏZ~߭Џ~߭ЬPt PPЏ Pt^oSX|͇͍͋|͏|͗͟7J 9>;?@CF EޭGޭKOK QͣSޭW[I ]ͣ_ޭcgH iͣkޭo|s{ԭhh߭ P Pl ЬRb@ ́R̓̓? P ́Y1/ V Wi Z U_[X D7߭F PRR~1R*~ݬߣ  RRfծ@Y ́ЭP@ЭP@ͣЭP@ͣЭP@ͣE߭gP !ޭ#|'|/h߭jPPf߭ߣ+e1P_߭kPU߭ߣLe1߭gP ޭ ||h߭jPPf߭ߣ|e1PT1ͣͣ߭|PTPsPm2P~2~߭êeW߭gP ޭ >||h߭PPPf߭e1խ1ͣP ͣkP^T2R ͣ߭ϲPRRQ*Q @RP>RRQͣ߭ ezPͣ߭Aegͣ߭WeT߭gPͿ ޭ ||hͿ߭PPPf߭ÂeY1F|Θ^wRT¯ P´||ݬ¹Pԭdd߭P P|Ud߭PSSZ~ S~9լ.ݬ¾^Ь P` PI>UnSJ SĄFլ:ݬݬSJЬ P` P,UPSV PSV0ݬݬ߭.BPUdd߭P Pdd߭P PUPP^STܰ Ь||ݬ9P Ьԭİ||ԭذ;ޭ||ԭd߭߭>P P߭߭߭PRRڀ~ԭ5PR~լݬ 6PR Rdd߭P PzЭP0^ԭఏެTdSSޭ|ԭ|~߭ԭ߭ PRRЭRR1ЭP@c׭ЭP@c &QЭP@a׭ЭP@a PRP,^&۰/ݞ||ЬݭnP|~߭۟|~PPP PIP ^Rݬߢ <`^,n䐏Pݬ^|VX^,n䐏Qݬf^PRݬl$լ ݬf  RP|_VD^,nȐSȞO؞CܕlլݬfЬ̑lլ  lլ,n䞭l լ Ь l լЬlլ ݬf^<`^,n䐏Tl լЬ^<`^,n䐏UdXݬB^@@|t `HP` dF,  @VAXCRTLLIBRTLMTHRTLMAILSHRMAILSHRP SECURESHR SECURESHRP*[SRC.PTT]PTT.H;1+,=./ 49-30123KPWO56 z%XS7`׍X89@WvGHJ/* * PTT.H - includes for PTT.9 * Copyright (C) Nick Brown, 1991. All rights reserved. *//* * Item list structure. */typedef struct { short buflen; short code; int bufaddr; int retlen; } ITEMLIST;/* * IOSP for $GETJPI. */typedef struct { int status; int reserved; } JPI_IOSB;/* * Command-line option flags. */#define PTT_FIXUP 1#define PTT_DELETE 2#define PTT_CONSISTENCY 4#define PTT_EXISTENCE 8#define PTT_FORWARD_CHECK 16/* * Size of CLI string arguments. */#define ARGSIZE 255/* * External routines. */%extern void get_args ( /* ARGS.C */ char *username, int *flags);'extern void process ( /* PROCESS.C */ char *username, int flags);-extern void get_current_user ( /* UTILS.C */ char *username);.extern int see_if_user_exists ( /* UTILS.C */ char *username);#extern void panic ( /* UTILS.C */ char *s);/* * Global data. */*[SRC.PTT]PTT.HLP;1+,G . / 4M x-30123KPWO 56H5%b7 YKb89@WvGHJ1 PTTG Invokes a program to display and optionally correct various fields of8 the VMS MAIL user profile data file (VMSMAIL_PROFILE).K PTT will normally be run by the system manager (with SYSPRV privilege) toK correct problems in users' mail profiles. A non-privileged user can also: run PTT, but will only have access to their own profile. Format: $ PTT [username] [/qualifiers]2 More_about_PTTF You should have received the C source of PTT. If you have access to@ VAX C, you are encouraged to review the program and compile itG yourself before using it, not because I think that the software is soG wonderful you must read it, but because this is a good way to protect2 yourself against some of the bad guys out there.@ If you have any questions, comments, or bugs to report, please contact: Nick Brown Council of Europe BP 431 R6 67006 Strasbourg FranceH Naturally, since this is free software, I accept no responsibility forH any loss or damage to any data. Nor do I offer any warranty that thisE software works as described under any particular circumstances. In& other words, no price, no guarantee. 2 ParametersUsernameI A single username for PTT to work on. Mutually exclusive with the /ALL qualifier.2 Command_Qualifiers/ALL /ALL /NOALL (D)J Tells PTT to report on all users in the MAIL profile. The default is to$ report on a single specified user. /CONSISTENCY /CONSISTENCY %x6~PTT.BCKG 3[SRC.PTT]PTT.HLP;1M (D) /NOCONSISTENCYL Causes PTT to check that the "new mail" count in the profile is consistent4 with the number of messages in the NEWMAIL folder.M If /FIXUP is specified, and the count is not consistent, PTT will reset the8 profile count to be equal to the NEWMAIL folder count./DELETE /DELETE /NODELETE (D)H When specified with a single user, deletes that user's record from theA profile. Cannot be specified with /ALL or any other qualifier. /EXISTENCE /EXISTENCE /NOEXISTENCE (D)K Causes PTT to check that the username from the profile is a valid user in the system UAF.L If /FIXUP is specified, and the username is not found in the UAF, PTT will) delete the profile record for the user./FIXUP /FIXUP /NOFIXUP (D)M Normally, PTT only reports on problems and inconsistencies. This qualifier> causes it to take appropriate action to try to fix problems.J Only PTT report lines beginning with "**" indicate problems that will be fixed by FIXUP./FORWARD_CHECK /FORWARD_CHECK /NOFORWARD_CHECK (D)E Causes PTT to check that any local (non-network) forwarding addressH specified for the user is a valid username. If the forwarding addressF contains a double colon ("::"), the address is considered and is not checked.K If /FIXUP is specified, and the forwarding address is not valid, PTT will5 clear the forwarding address in the profile record.2 Installation= There is no installation command procedure. To install PTTE permanently, put PTT.EXE in SYS$SYSTEM, and add PTT to your command tables as follows:6 $ set command /tables=SYS$COMMON:[SYSLIB]DCLTABLES -6 /output=SYS$COMMON:[SYSLIB]DCLTABLES - PTT.CLD0 $ install replace SYS$COMMON:[SYSLIB]DCLTABLESD For temporary installation, you can define the logical name PTT toA point to PTT.EXE, and use "$ set command PTT.CLD" to define the command. 2 Examples8 1. $ PTT FRED /CONSISTENCY /EXISTENCE /FORWARD_CHECK) Shows all known problems for user FRED. 2. $ PTT /ALL /FIXUP) Fixes the new mail count for all users.*[SRC.PTT]PTT.OPT;1+,?./ 4T-30123KPWO561O7ҎX89@WvGHJ! LINK /NOTRACE PTT /OPTpttargsprocessutilssys$library:vaxcrtl/share*[SRC.PTT]UTILS.C;1+,@./ 4L&-30123KPWO56 +S1O7lX89@WvGHJ/*& * UTILS.C - utility routines for PTT.9 * Copyright (C) Nick Brown, 1991. All rights reserved. */#include descrip#include jpidef#include rmsdef#include ssdef#include stdio#include uaidef#include "ptt.h"/*& * Return username of current process. */voidget_current_user (username) char *username;{ int retlen = 0; ITEMLIST jpi_items [] = {. ARGSIZE, JPI$_USERNAME, username, &retlen, 0, 0, 0, 0 }; int status; JPI_IOSB iosb;9 status = sys$getjpiw(0, &0, 0, jpi_items, &iosb, 0, 0); if (status == SS$_NORMAL) { status = iosb.status; } if (status == SS$_NORMAL) { username[retlen] = '\0';' while (username[--retlen] == ' ') { username[retlen] = '\0'; } } else { exit(status); }}/*( * Return 1 if given user exists in UAF. */intsee_if_user_exists (username) char *username;{ $DESCRIPTOR(username_des, ""); char pri; ITEMLIST uai_items [] = {9 1, UAI$_PRI, &pri, 0, /* ask for something trivial */ 0, 0, 0, 0 }; int status;L username_des.dsc$w_length = strlen(username_des.dsc$a_pointer = username);? status = sys$getuai(0, 0, &username_des, uai_items, 0, 0, 0); if (status == RMS$_RNF) { return 0; }" else if (status != SS$_NORMAL) { exit(status); } return 1;}/*H * Function to handle unexpected events (that indicate internal errors). */void panic (s) char *s;{) fprintf(stderr, "PTT: panic: %s\n", s); exit(4);}f