Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!convex!convex.com!datri From: datri@convex.com (Anthony A. Datri) Newsgroups: comp.soft-sys.andrew Subject: Problems with using AMS_MailCollectionCommand Message-ID: <105873@convex.convex.com> Date: 6 Sep 90 20:06:39 GMT Sender: usenet@convex.com Organization: Convex Computer Corporation; Richardson, TX Lines: 93 I wrote a program in the vein of nsb's eatmail to safely move mail from /usr/spool/mail into ~/Mailbox, but I've discovered that AMS_MailCollectionCommand gets run *after* /usr/spool/mail/joeuser is checked and collected. Am I missing something? I would think that if AMS_MailCollectionCommand (and apparently PersonalMailCollectionCommand as well) is set, that the system shouldn't collect from /usr/spool/mail/joeuser *at all*. In ams/libs/ms/mungenew.c, I find: if (homeUsesAMSDelivery < 0) { char SpoolFileName[1 + MAXPATHLEN], *HomeBox, *SpoolFile; int numfound; /* Only convert /usr/spool/mail-type stuff if we're checking our person$ HomeBox = GetPersonalMailbox(); sprintf(SpoolFileName, "%s/Mailbox", home); if (strcmp(HomeBox, SourceDir) == 0 || strcmp(SpoolFileName, SourceDir)$ SpoolFile = getenv("MAIL"); if (SpoolFile == NULL || *SpoolFile == '\0') SpoolFile = getprofile$ if (SpoolFile == NULL || *SpoolFile == '\0') { sprintf(SpoolFileName, "%s/%s", AMS_MailBoxPrefix, Me); } else { strcpy(SpoolFileName, SpoolFile); } mserrcode = ConvertIncomingMail(SpoolFileName, SourceDir, &numfound$ if (mserrcode) return (mserrcode); } } if (PersonalMailCollectionCommand) { int syscode; syscode = system(PersonalMailCollectionCommand); if (syscode) { char ErrorText[100+MAXPATHLEN]; sprintf(ErrorText, "Personal mail collection command %s failed with$ NonfatalBizarreError(ErrorText); AMS_RETURN_ERRCODE(EMSBOGUS, EIN_SYSTEM, EVIA_PROCNEWMSGS); } } if (AMS_MailCollectionCommand) { int syscode; syscode = system(AMS_MailCollectionCommand); if (syscode) { char ErrorText[100+MAXPATHLEN]; sprintf(ErrorText, "System mail collection command %s failed with c$ NonfatalBizarreError(ErrorText); AMS_RETURN_ERRCODE(EMSBOGUS, EIN_SYSTEM, EVIA_PROCNEWMSGS); } } Shouldn't the initial conditional change from if (homeUsesAMSDelivery < 0) { to if (homeUsesAMSDelivery < 0 && ( ! (PersonalMailCollectionCommand || AMS_MailCollectionCommand) )) { Also, just what is "PersonalMailCollectionCommand" anyway? It seems to be redundant given AMS_MailCollectionCommand, and I haven't seen mention of it in any docs. The scenario is that I run Messages on my diskless workstation, and mail physically resides on another machine. I want to safely collect mail from my mailbox there into ~/Mailbox, rather than take the chance of AMS on my workstation and binmail on the server stomping on each other. The server's /usr/spool/mail is mounted on my workstation because I've just been taking the chance, and also so that I can use "from" and any of a variety of xbiffy programs. But even when I specify AMS_MailCollectionCommand, /usr/spool/mail/datri gets read and truncated before my MailCollectionCommand gets run, so the latter never actually gets to do its thing. The only way I see to work around this without changing the source and rebuilding (ugggh) is to not have /usr/spool/mail from the server pointed to by the local /usr/spool/mail, but that's ugly, and it really should work as I've described. Comments? -- beak is beak is not