home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / comm / mail / smail / src / rcs / bsmtp.c,v < prev    next >
Text File  |  1993-12-21  |  15KB  |  844 lines

  1. head    1.11;
  2. access;
  3. symbols
  4.     C_1:1.11;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.11
  10. date    93.11.14.21.01.46;    author Aussem;    state Exp;
  11. branches;
  12. next    1.10;
  13.  
  14. 1.10
  15. date    93.11.13.22.13.56;    author Aussem;    state Exp;
  16. branches;
  17. next    1.9;
  18.  
  19. 1.9
  20. date    93.11.12.23.09.33;    author Aussem;    state Exp;
  21. branches;
  22. next    1.8;
  23.  
  24. 1.8
  25. date    93.11.09.17.00.22;    author Aussem;    state Exp;
  26. branches;
  27. next    1.7;
  28.  
  29. 1.7
  30. date    93.11.01.23.21.53;    author Aussem;    state Exp;
  31. branches;
  32. next    1.6;
  33.  
  34. 1.6
  35. date    93.10.28.23.31.15;    author Aussem;    state Exp;
  36. branches;
  37. next    1.5;
  38.  
  39. 1.5
  40. date    93.10.28.21.21.08;    author Aussem;    state Exp;
  41. branches;
  42. next    1.4;
  43.  
  44. 1.4
  45. date    93.10.23.22.46.59;    author Aussem;    state Exp;
  46. branches;
  47. next    1.3;
  48.  
  49. 1.3
  50. date    93.10.19.00.36.33;    author Aussem;    state Exp;
  51. branches;
  52. next    1.2;
  53.  
  54. 1.2
  55. date    93.10.17.23.23.47;    author Aussem;    state Exp;
  56. branches;
  57. next    1.1;
  58.  
  59. 1.1
  60. date    93.10.17.21.13.56;    author Aussem;    state Exp;
  61. branches;
  62. next    ;
  63.  
  64.  
  65. desc
  66. @SMTP transport routines
  67. @
  68.  
  69.  
  70. 1.11
  71. log
  72. @commtents insert
  73. @
  74. text
  75. @/*
  76.  *  bsmtp for smail/rmail
  77.  *
  78.  * This program is free software; you can redistribute it and/or
  79.  * modify it under the terms of the GNU General Public License as
  80.  * published by the Free Software Foundation; either version 2 of
  81.  * the License, or (at your option) any later version.
  82.  *
  83.  * This program is distributed in the hope that it will be useful,
  84.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  85.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  86.  * General Public License for more details.
  87.  *
  88.  * You should have received a copy of the GNU General Public License
  89.  * along with this program; if not, write to the Free Software
  90.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  91.  *
  92.  *
  93.  * $Log: bsmtp.c,v $
  94.  * Revision 1.10  1993/11/13  22:13:56  Aussem
  95.  * check_site() generates only debug lines if the paramter debug is != No
  96.  * if there is no From line in the BSMTP mail convert_smtp will
  97.  * generate one
  98.  *
  99.  * Revision 1.9  1993/11/12  23:09:33  Aussem
  100.  * check_site does not care about case of the site
  101.  * in BSMTP file
  102.  * cosmetic changes in debug/advise output
  103.  *
  104.  * Revision 1.8  1993/11/09  17:00:22  Aussem
  105.  * cosmetic changes
  106.  *
  107.  * Revision 1.7  1993/11/01  23:21:53  Aussem
  108.  * fmode() call removed
  109.  *
  110.  * Revision 1.6  1993/10/28  23:31:15  Aussem
  111.  * converting \n to \r\n by using fmode() when receiving BSMTP mails
  112.  *
  113.  * Revision 1.5  1993/10/28  21:21:08  Aussem
  114.  * check_bsmtp() security check insert
  115.  *
  116.  * Revision 1.4  1993/10/23  22:46:59  Aussem
  117.  * the file for bsmtp sites is taken from uulib:config
  118.  *
  119.  * Revision 1.3  1993/10/19  00:36:33  Aussem
  120.  * check whether a site is a bsmtp site included
  121.  * hide_dot() implemented
  122.  *
  123.  * Revision 1.2  1993/10/17  23:23:47  Aussem
  124.  * removed the HELO line from write_bsmtp_prolog
  125.  *
  126.  * Revision 1.1  1993/10/17  21:13:56  Aussem
  127.  * Initial revision
  128.  *
  129.  *
  130.  *
  131.  */
  132.  
  133. static char     *rcsid="$Id: bsmtp.c,v 1.10 1993/11/13 22:13:56 Aussem Exp Aussem $";
  134.  
  135. #include <stdio.h>
  136. #include <assert.h>
  137. #include <stdlib.h>
  138. #include <sys/types.h>
  139. #include <sys/stat.h>
  140. #include "defs.h"
  141. #include <ctype.h>
  142.  
  143. extern char hostname[];    /* our host's name         */
  144. extern int debug;
  145. extern char bsmtp_sites[];
  146. extern char nows[];
  147. extern char rmailname[];
  148.  
  149.  
  150. /* Macros for Checking the compress type */
  151. #define CHECK_FREEZE(buf)   ((buf[0]=='0x1f' && buf[1]=='0x9f')?1:0)
  152. #define CHECK_COMPRESS(buf) ((buf[0]=='0x1f' && buf[1]=='0x9d')?1:0)
  153. #define CHECK_GZIP(buf)     ((buf[0]=='0x1f' && buf[1]=='0x8b')?1:0)
  154.  
  155. /*
  156.  * setup_fromline(): generate a RFC conform from line
  157.  *
  158.  * params: address of the sender and the system
  159.  *
  160.  */
  161. static
  162. void
  163. setup_fromline(char *from,char *systemname)
  164. {
  165.     char user[SMLBUF];        /* for rewriting user@@host    */
  166.     char domain[SMLBUF];        /* "   "         "              */
  167.     char addr[SMLBUF];        /* "   "         "              */
  168.     enum eform form;    /* "   "         "              */
  169.     char buf[BIGBUF];
  170.  
  171.    strcpy(addr, from);
  172.     (void) parse(addr, domain, user);
  173.         if(*domain == '\0') {
  174.             form = LOCAL;
  175.         } else {
  176.             form = UUCP;
  177.         }
  178.  
  179.     build(domain, user, form, addr);
  180.  
  181.     (void) strcpy(from, addr);
  182.    setdates();
  183.    sprintf(buf,RFROM(from,nows,systemname));
  184.    strcpy(from,buf);
  185. }
  186.  
  187. /*
  188.  * write_bsmtp_prologue - write the initial SMTP commands for BSMTP transports
  189.  *
  190.  * write out the MAIL FROM line
  191.  *
  192.  */
  193. write_bsmtp_prologue(f,from)
  194.     FILE *f;                /* file to write commands to */
  195.     char *from;
  196. {
  197.     assert(f);
  198.     fprintf(f, "MAIL FROM:<%s!%s>\n",hostname, from);
  199. }
  200.  
  201. /*
  202.  * write_bsmtp_epilogue - write tailing commands for BSMTP transports
  203.  *
  204.  * finish off the data command and write out the QUIT command.
  205.  *
  206.  */
  207. write_bsmtp_epilogue(f)
  208.     FILE *f;
  209. {
  210. assert(f);
  211. fprintf(f, ".\n");
  212. fprintf(f, ".\nQUIT\n");
  213. }
  214.  
  215. /*
  216.  * uncompress_stream()
  217.  *
  218.  * uncompress a stream with cmd <tmp_from_stream >tmp
  219.  * and returns a FILE ptr to the uncompressed file
  220.  *
  221.  */
  222. FILE *uncompress_stream(FILE *fp,char cmd[])
  223. {
  224. char *text;
  225. char tmpfile[SMLBUF],outfile[SMLBUF],line[SMLBUF];
  226. FILE *out;
  227. int rc;
  228. size_t len;
  229.  
  230. if(!fp)
  231.     {
  232.    ADVISE("uncompress_stream: stream is null '%x'\n",fp);
  233.     return(NULL);
  234.    }
  235.  
  236. fseek(fp,0,SEEK_END);
  237. len=ftell(fp);
  238. if(len==0)
  239.     {
  240.    return(fp);
  241.    }
  242.  
  243. fseek(fp,0,SEEK_SET);
  244. text=malloc(len*sizeof(char));
  245. if(!text)
  246.     {
  247.    ADVISE("uncompress_stream: no memory for text '%x'\n",text);
  248.    return(NULL);
  249.    }
  250.  
  251. fread(text,len,1,fp);
  252. if(strncmp(text,"HELO ",5)==0)
  253.     {
  254.     DEBUG("mail not compress, continue\n");
  255.     fseek(fp,0,SEEK_SET);
  256.     return(fp);
  257.     }
  258.  
  259. ADVISE("uncompressing...");
  260.  
  261. strcpy(tmpfile,tmpnam(NULL));
  262. out=fopen(tmpfile,"wb");
  263. if(!out)
  264.     {
  265.    DEBUG("\nunable to open tmpfile %s\n",tmpfile);
  266.     return(NULL);
  267.    }
  268. fwrite(text,len,1,out);
  269. fclose(out);
  270. if(text)
  271.     free(text);
  272.  
  273. strcpy(outfile,tmpnam(NULL));
  274. sprintf(line,"%s -d <%s >%s",cmd,tmpfile,outfile);
  275. DEBUG("\ncmd: %s",line);
  276. rc=system(line);
  277. if(rc)
  278.     {
  279.    DEBUG("\nuncompressing failed ('%s')\n",line);
  280.     remove(tmpfile);
  281.     remove(outfile);
  282.     return(0);
  283.     }
  284. remove(tmpfile);
  285. ADVISE("\n");
  286. return(fopen(outfile,"rb"));
  287. }
  288. /*
  289.  * uncompress_file()
  290.  *
  291.  * uncompress a file with cmd <name >tmp
  292.  * and replace name with the uncompressed
  293.  * file
  294.  */
  295. int uncompress_file(char *name,char cmd[])
  296. {
  297. char outfile[SMLBUF],line[SMLBUF];
  298. int rc;
  299.  
  300. ADVISE("uncompressing...");
  301.  
  302. strcpy(outfile,tmpnam(NULL));
  303. sprintf(line,"%s -d <%s >%s",cmd,name,outfile);
  304. DEBUG("\ncmd: %s",line);
  305. rc=system(line);
  306. if(rc)
  307.     {
  308.    DEBUG("\nuncompressing failed ('%s')\n",line);
  309.     remove(outfile);
  310.     return(0);
  311.     }
  312.  
  313. sprintf(line,"copy %s %s",outfile,name);
  314. rc=system(line);
  315. remove(outfile);
  316.  
  317. ADVISE("\n");
  318. return(1);
  319. }
  320.  
  321. /*
  322.  * convert_smtp()
  323.  *
  324.  * converts a SMTP mail into UUCP mails and call rmail to
  325.  * deliver them via rmail
  326.  *
  327.  */
  328. convert_smtp(FILE *fp)
  329. {
  330. char line[BIGBUF],tmpname[SMLBUF],cmd[BIGBUF],puf[BIGBUF],
  331.      fromline[SMLBUF];
  332. char *begin,*end,*result,*systemname;
  333. FILE *out=NULL;
  334. size_t msg,pos;
  335.  
  336. if(!fp)
  337.     return;
  338.  
  339. ADVISE("converting BSMTP file...");
  340. strcpy(tmpname,tmpnam(NULL));
  341.  
  342. /* get the first line and check for HELO */
  343. result=fgets(line,sizeof(line),fp);
  344. if(!result)
  345.     goto error;
  346.  
  347. if(strncmp(line,"HELO ",5)!=0)
  348.     {
  349.     DEBUG("\nfile not in SMTP format aborting !\n");
  350.     return;
  351.     }
  352.  
  353. /* Save the systemname */
  354. end=index(&line[5],'\n');
  355. if(end)
  356.     *end='\0';
  357. systemname=strdup(&line[5]);
  358. ADVISE("\nReceiving mails from '%s'\n",systemname);
  359.  
  360. /* init dates */
  361. setdates();
  362.  
  363. /* Read the first line */
  364. result=fgets(line,sizeof(line),fp);
  365. if(!result)
  366.     goto error;
  367.  
  368. do
  369. {
  370. /* search the MAIL FROM: line */
  371. if(strncmp(line,"MAIL FROM:",10)!=0)
  372.     goto error;
  373. msg=ftell(fp);
  374.  
  375. /* Extracting the sender */
  376. begin=index(line,'<');
  377. end=rindex(line,'>');
  378. if(begin && end)
  379.     {
  380.     *end='\0';
  381.     strcpy(puf,begin+1);
  382.     *end='>';
  383.    }
  384.  
  385. if(debug==VERBOSE)
  386.     printf("\nFrom: %s\n",puf);
  387.  
  388. /*  open the tmpfile */
  389. out=fopen(tmpname,"w");
  390. if(!out)
  391.     {
  392.     ADVISE("\nunable to open '%s'\n",tmpname);
  393.    goto error;
  394.     }
  395.  
  396. /* remove \n from nows */
  397. strcpy(line,nows);
  398. end=index(line,'\n');
  399. if(end)
  400.     *end='\0';
  401.  
  402. /* setup the fromline */
  403. setup_fromline(puf,systemname);
  404. strcpy(fromline,puf);
  405.  
  406. while((result=fgets(line,sizeof(line),fp))!=NULL)
  407.     if(strncmp(line,"DATA\n",5)==0)break;
  408. if(!result)
  409.     goto error;
  410.  
  411. /* Check whether we have a From user date remote system line */
  412. result=fgets(line,sizeof(line),fp);
  413. /* WE have no From line */
  414. if(strncmp(line,"From ",5)!=NULL)
  415.     {
  416.     fputs(fromline,out);
  417.     if(debug==YES)
  418.         fputs(fromline,stdout);
  419.    }
  420.  
  421. do {
  422.     if(strncmp(line,".\n",5)==0)break;
  423.    /* remove the hidden dots */
  424.     if(strncmp(line,"..\n",5)==0)
  425.         {
  426.         fputs(".\n",out);
  427.         if(debug==YES)
  428.             fputs(".\n",stdout);
  429.       continue;
  430.       }
  431.     fputs(line,out);
  432.     if(debug==YES)
  433.         fputs(line,stdout);
  434.     }while((result=fgets(line,sizeof(line),fp))!=NULL);
  435.  
  436. if(!result)
  437.     goto error;
  438. pos=ftell(fp);
  439.  
  440. fclose(out);
  441.  
  442. fseek(fp,msg,SEEK_SET);
  443. while((result=fgets(line,sizeof(line),fp))!=NULL)
  444.     {
  445.     if(strncmp(line,"DATA\n",5)==0)break;
  446.    begin=index(line,'<');
  447.    if(begin)
  448.        {
  449.        end=rindex(++begin,'>');
  450.        if(end)
  451.            *end='\0';
  452.        sprintf(cmd,"%s <%s %s %s",rmailname,tmpname,VFLAG,begin);
  453.       DEBUG("\ncmd: '%s'\n",cmd);
  454.       if(debug != YES)
  455.           system(cmd);
  456.       }
  457.     }
  458.   if(!result)
  459.     goto error;
  460.  
  461. fseek(fp,pos,SEEK_SET);
  462. result=fgets(line,sizeof(line),fp);
  463. if(!result)
  464.     goto error;
  465. }
  466. while(strcmp(line,"QUIT\n")!=0);
  467.  
  468. ADVISE("\n");
  469. remove(tmpname);
  470. return;
  471.  
  472. error:
  473. if(out)fclose(out);
  474. DEBUG("Corrupt SMTP Format, aborting\n");
  475. remove(tmpname);
  476. }
  477.  
  478. /*
  479.  * check_site()
  480.  *
  481.  * check whether site is in uulib:mail/bsmtp_sites
  482.  *
  483.  */
  484. int check_site(char site[],enum edebug debug)
  485. {
  486. static char *text=NULL;
  487. char puf[SMLBUF]="\n",*found;
  488.  
  489. if(!site ||
  490.    site[0]=='\0')
  491.    return(0);
  492.  
  493. ADVISE("BSMTP_check: seaching site '%s' in '%s' ",site,bsmtp_sites);
  494. if(!text)
  495.     {
  496.     FILE *fp=NULL;
  497.     size_t pos;
  498.  
  499.     fp=fopen(bsmtp_sites,"r");
  500.     if(!fp)
  501.         {
  502.         ADVISE("check_site: BSMTP file open('%s') failed\n", bsmtp_sites);
  503.         return(0);
  504.       }
  505.     fseek(fp,0,SEEK_END);
  506.     pos=ftell(fp);
  507.     if(pos<1)
  508.         {
  509.         ADVISE("check_site: BSMTP file is ('%s') empty\n", bsmtp_sites);
  510.         return(0);
  511.       }
  512.     fseek(fp,0,SEEK_SET);
  513.     text=malloc(pos*sizeof(char));
  514.     if(!text)
  515.         {
  516.         ADVISE("check_site: unable to alloc %d bytes\n", pos);
  517.         return(0);
  518.       }
  519.     fread(text,pos,1,fp);
  520.     fclose(fp);
  521.     /* case insenstiv please */
  522.     strlwr(text);
  523.     }
  524. strcat(puf,site);
  525. strcat(puf,"\n");
  526. /* case insenstiv please */
  527. strlwr(puf);
  528. if(strstr(text,puf))
  529.     {
  530.     ADVISE("found\n");
  531.     return(1);
  532.     }
  533. /* if the file starts with this site there is no \n at the begin */
  534. strcpy(puf,site);
  535. strcat(puf,"\n");
  536. found=strstr(text,puf);
  537. if(found==text)
  538.     {
  539.     ADVISE("found\n");
  540.     return(1);
  541.     }
  542.  
  543. ADVISE("not found\n");
  544. return(0);
  545. }
  546.  
  547. /*
  548.  * hide_dot()
  549.  *
  550.  * hide a dot behind a double dot
  551.  *
  552.  */
  553. void hide_dot(char *line,size_t max_len)
  554. {
  555. size_t act_len;
  556.  
  557. if(!line || line[0]!='.')
  558.     return;
  559.  
  560. act_len=strlen(line);
  561.  
  562. if(act_len+1<max_len)
  563.     {
  564.    strins(line+1,".");
  565.    }
  566. else
  567.       DEBUG("hide_dot: unable to hide .dot in line '%s'\n",line);
  568. }
  569.  
  570. /*
  571.  * re_hide_dot()
  572.  *
  573.  * remove the hidden dot
  574.  *
  575.  */
  576. void re_hide_dot(char *line)
  577. {
  578. if(!line || line[0]!='.' || line[1]!='.')
  579.     return;
  580.  
  581. strcpy(&line[0],&line[1]);
  582. }
  583. @
  584.  
  585.  
  586. 1.10
  587. log
  588. @check_site() generates only debug lines if the paramter debug is != No
  589. if there is no From line in the BSMTP mail convert_smtp will
  590. generate one
  591. @
  592. text
  593. @d20 5
  594. d59 1
  595. a59 1
  596. static char     *rcsid="$Id: bsmtp.c,v 1.9 1993/11/12 23:09:33 Aussem Exp Aussem $";
  597. d76 1
  598. d84 2
  599. d116 2
  600. a117 1
  601.  * write out the HELO, MAIL FROM, RCPT TO and DATA commands.
  602. a118 1
  603.  
  604. d131 1
  605. d251 1
  606. a251 1
  607.  * deliver them
  608. a508 1
  609.  
  610. @
  611.  
  612.  
  613. 1.9
  614. log
  615. @check_site does not care about case of the site
  616. in BSMTP file
  617. cosmetic changes in debug/advise output
  618. @
  619. text
  620. @d20 5
  621. d54 1
  622. a54 1
  623. static char     *rcsid="$Id: bsmtp.c,v 1.8 1993/11/09 17:00:22 Aussem Exp Aussem $";
  624. d67 3
  625. d76 30
  626. d247 3
  627. a249 2
  628. char line[BIGBUF],tmpname[SMLBUF],cmd[BIGBUF];
  629. char *begin,*end,*result;
  630. d270 11
  631. a280 1
  632. ADVISE("\nfrom %s",&line[5]);
  633. d290 1
  634. d292 9
  635. a300 1
  636. msg=ftell(fp);
  637. d302 2
  638. a303 4
  639. while((result=fgets(line,sizeof(line),fp))!=NULL)
  640.     if(strncmp(line,"DATA\n",5)==0)break;
  641. if(!result)
  642.     goto error;
  643. d305 1
  644. d310 1
  645. a310 1
  646.     return;
  647. d313 10
  648. d324 8
  649. d333 6
  650. d344 2
  651. d349 4
  652. a352 1
  653.     }
  654. d369 1
  655. a369 1
  656.        sprintf(cmd,"rmail <%s %s %s",tmpname,VFLAG,begin);
  657. d384 1
  658. d401 1
  659. a401 1
  660. int check_site(char site[])
  661. d500 1
  662. @
  663.  
  664.  
  665. 1.8
  666. log
  667. @cosmetic changes
  668. @
  669. text
  670. @d20 3
  671. d49 1
  672. a49 1
  673. static char     *rcsid="$Id: bsmtp.c,v 1.7 1993/11/01 23:21:53 Aussem Exp Aussem $";
  674. d111 1
  675. a111 1
  676.    ADVISE("stream is null '%x'\n",fp);
  677. d126 1
  678. a126 1
  679.    ADVISE("no memory for text '%x'\n",text);
  680. d284 1
  681. a284 1
  682.       DEBUG("\nexecute '%s'\n",cmd);
  683. d332 1
  684. a332 1
  685.         ADVISE("BSMTP file open('%s') failed\n", bsmtp_sites);
  686. d339 1
  687. a339 1
  688.         ADVISE("BSMTP file is ('%s') empty\n", bsmtp_sites);
  689. d346 1
  690. a346 1
  691.         ADVISE("unable to alloc %d bytes\n", pos);
  692. d351 2
  693. d356 2
  694. d397 1
  695. a397 1
  696.       DEBUG("unable to hide .dot in line '%s'\n",line);
  697. @
  698.  
  699.  
  700. 1.7
  701. log
  702. @fmode() call removed
  703. @
  704. text
  705. @d20 3
  706. d46 1
  707. a46 1
  708. static char     *rcsid="$Id: bsmtp.c,v 1.6 1993/10/28 23:31:15 Aussem Exp Aussem $";
  709. d108 1
  710. a108 1
  711.    ADVISE("stream is zero %x\n",fp);
  712. d123 1
  713. a123 1
  714.    ADVISE("no memory for text %x\n",text);
  715. d353 1
  716. a353 1
  717.     ADVISE("found\n",site);
  718. d362 1
  719. a362 1
  720.     ADVISE("found\n",site);
  721. d366 1
  722. a366 1
  723. ADVISE("not found\n",site);
  724. @
  725.  
  726.  
  727. 1.6
  728. log
  729. @converting \n to \r\n by using fmode() when receiving BSMTP mails
  730. @
  731. text
  732. @d20 3
  733. d43 1
  734. a43 1
  735. static char     *rcsid="$Id: bsmtp.c,v 1.5 1993/10/28 21:21:08 Aussem Exp Aussem $";
  736. a210 1
  737. fmode(fp,0);
  738. d278 1
  739. a278 1
  740.       DEBUG("\nexecute '%s'",cmd);
  741. d283 1
  742. a283 1
  743. if(!result)
  744. @
  745.  
  746.  
  747. 1.5
  748. log
  749. @check_bsmtp() security check insert
  750. @
  751. text
  752. @d20 3
  753. d40 1
  754. a40 1
  755. static char     *rcsid="$Id: bsmtp.c,v 1.4 1993/10/23 22:46:59 Aussem Exp Aussem $";
  756. d208 1
  757. @
  758.  
  759.  
  760. 1.4
  761. log
  762. @the file for bsmtp sites is taken from uulib:config
  763. @
  764. text
  765. @d20 3
  766. d37 1
  767. a37 1
  768. static char     *rcsid="$Id: bsmtp.c,v 1.3 1993/10/19 00:36:33 Aussem Exp Aussem $";
  769. d306 4
  770. @
  771.  
  772.  
  773. 1.3
  774. log
  775. @check whether a site is a bsmtp site included
  776. hide_dot() implemented
  777. @
  778. text
  779. @d20 4
  780. d34 1
  781. a34 1
  782. static char     *rcsid="$Id: bsmtp.c,v 1.2 1993/10/17 23:23:47 Aussem Exp Aussem $";
  783. d46 1
  784. d296 1
  785. a296 1
  786.  * check whether site is in BSMTPSITES
  787. d304 1
  788. a304 1
  789. DEBUG("seaching '%s'",site);
  790. d310 1
  791. a310 1
  792.     fp=fopen(BSMTPSITES,"r");
  793. d313 1
  794. a313 1
  795.         DEBUG("\nBSMTP file open('%s') failed\n", BSMTPSITES);
  796. d320 1
  797. a320 1
  798.         DEBUG("\nBSMTP file is ('%s') empty\n", BSMTPSITES);
  799. d327 1
  800. a327 1
  801.         DEBUG("\nunable to alloc %d bytes\n", pos);
  802. d337 1
  803. a337 1
  804.     DEBUG("found\n",site);
  805. d346 1
  806. a346 1
  807.     DEBUG("found\n",site);
  808. d350 1
  809. a350 1
  810. DEBUG("not found\n",site);
  811. @
  812.  
  813.  
  814. 1.2
  815. log
  816. @removed the HELO line from write_bsmtp_prolog
  817. @
  818. text
  819. @d20 3
  820. d30 1
  821. a30 1
  822. static char     *rcsid="$Id: bsmtp.c,v 1.1 1993/10/17 21:13:56 Aussem Exp Aussem $";
  823. d286 98
  824. @
  825.  
  826.  
  827. 1.1
  828. log
  829. @Initial revision
  830. @
  831. text
  832. @d19 3
  833. a21 1
  834.  * $Log:$
  835. d24 1
  836. d27 1
  837. a27 1
  838. static char     *rcsid="$Id$";
  839. a36 1
  840. extern char hostdomain[];    /* our host's domain         */
  841. a54 1
  842.     fprintf(f, "HELO %s\n",hostdomain);
  843. @
  844.