eudora-mac/mailxfer.c

1 line
65 KiB
C
Raw Permalink Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mailxfer.h" #include "myssl.h" #define FILE_NUM 52 /* Copyright (c) 1993 by QUALCOMM Incorporated */ #pragma segment Mailxfer void NewMailSound(void); short CheckForMail(TransStream stream,short *gotSome,XferFlags *flags); short SendTheQueue(TransStream stream,XferFlags flags); void ResetCheckTime(Boolean force); OSErr SpecialXfer(struct XferFlags *flags); OSErr POPHostLimit(void); short XferMailLo(Boolean check, Boolean send, Boolean manual, XferFlags flags,long *totalGot,OSErr *dialErrPtr); Boolean NeedPassword(Boolean check, Boolean send); void ResetPersCheckTime(Boolean force); #ifdef THREADING_ON Boolean OKToThread(Boolean check, Boolean send, Boolean manual, Boolean ae); long FindTotalQueuedSize(TOCHandle tocH,long gmtSecs); Boolean AddSigIntro(PETEHandle pte,UHandle text); Boolean RemoveSigIntro(PETEHandle pte,UHandle text); pascal Boolean SpecialXferFilter(DialogPtr dgPtr,EventRecord *event,short *item); PersHandle SMTPRelayPers(void); OSErr RememberMID(uLong midHash); long GlobalOpenUnreadCount(); long GlobalInUnreadCount(); /************************************************************************ * OKToThread - returns false if threading should be used because of * transport limitations * * (a) Do not thread if the connection method is the CTB. The CTB * supports one and only one connection at a time. * * (b) Do not thread if any personality is set to uucpOut and is allowed to * send mail. * * (c) Do not thread if any personality is set to uucpIn and is allowed to * check mail manually or automatically. * ************************************************************************/ Boolean OKToThread(Boolean check, Boolean send, Boolean manual, Boolean ae) { Boolean threadOK = true; // Str255 pass; if (UseCTB) threadOK = false; // go ahead and thread uucp stuff #if 0 else { for (CurPers=PersList;CurPers&&threadOK;CurPers=(*CurPers)->next) { if ((*CurPers)->uupcOut || (*CurPers)->uupcIn) { (*CurPers)->checkMeNow = (*CurPers)->sendMeNow = (*CurPers)->checked = 0; if (check && *GetPref(pass,PREF_POP)) { if ((manual||ae) && !PrefIsSet(PREF_JUST_SAY_NO)) (*CurPers)->checkMeNow = True; } if (send && (*CurPers)->sendQueue && !PrefIsSet(PREF_PERS_NO_SEND)) (*CurPers)->sendMeNow = True; if ((*CurPers)->uupcOut && (*CurPers)->checkMeNow) threadOK = false; if ((*CurPers)->uupcIn && ((