aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmailconf
Commit message (Collapse)AuthorAgeFilesLines
* Looks like we've got the new authentication logic done.Eric S. Raymond2001-02-121-12/+6
| | | | svn path=/trunk/; revision=3072
* Warn about pop3ad server.Eric S. Raymond2001-02-101-2/+10
| | | | svn path=/trunk/; revision=3038
* First cut at ODMR support.Eric S. Raymond2001-02-071-5/+13
| | | | svn path=/trunk/; revision=3028
* Obvious bug fixes for 5.6.3.Eric S. Raymond2001-02-071-6/+8
| | | | svn path=/trunk/; revision=3022
* Fix the "principal" problem.Eric S. Raymond2000-12-231-13/+12
| | | | svn path=/trunk/; revision=3005
* Spambounce patch.Eric S. Raymond2000-12-121-0/+18
| | | | svn path=/trunk/; revision=2998
* Minor bugfixes.Eric S. Raymond2000-12-011-2/+2
| | | | svn path=/trunk/; revision=2993
* Correction.Eric S. Raymond2000-11-271-1/+2
| | | | svn path=/trunk/; revision=2990
* 5-6-0bis fix for smtpname.Eric S. Raymond2000-11-271-2/+5
| | | | svn path=/trunk/; revision=2989
* Handle `principal' correctly.Eric S. Raymond2000-11-241-4/+4
| | | | svn path=/trunk/; revision=2985
* Ready to ship.Eric S. Raymond2000-11-111-0/+9
| | | | svn path=/trunk/; revision=2983
* Added --showdots option by Thomas Jarosch <tomj@gmx.de>Eric S. Raymond2000-11-041-2/+5
| | | | svn path=/trunk/; revision=2981
* Before showdots,Eric S. Raymond2000-10-081-3/+8
| | | | svn path=/trunk/; revision=2975
* Bug fixes and internationalization improvements.Eric S. Raymond2000-09-261-0/+6
| | | | svn path=/trunk/; revision=2967
* Warn about Novonyx.Eric S. Raymond2000-09-061-0/+7
| | | | svn path=/trunk/; revision=2957
* Don't doublequote user and password.Eric S. Raymond2000-08-051-3/+3
| | | | svn path=/trunk/; revision=2941
* Almost ready to ship.Eric S. Raymond2000-07-281-1/+1
| | | | svn path=/trunk/; revision=2939
* Added dropdelivered.Eric S. Raymond2000-07-231-0/+7
| | | | svn path=/trunk/; revision=2931
* sslcert fix.Eric S. Raymond2000-07-231-2/+2
| | | | svn path=/trunk/; revision=2930
* Minor update.Eric S. Raymond2000-07-231-2/+2
| | | | svn path=/trunk/; revision=2927
* String-quote what we put in the file.Eric S. Raymond2000-06-281-3/+3
| | | | svn path=/trunk/; revision=2915
* Plug a security hole.Eric S. Raymond2000-06-201-3/+5
| | | | svn path=/trunk/; revision=2905
* Warn about spray.net servers.Eric S. Raymond2000-06-071-0/+9
| | | | svn path=/trunk/; revision=2901
* Quote password and string parts.Eric S. Raymond2000-05-131-2/+2
| | | | svn path=/trunk/; revision=2894
* More about MailMax.Eric S. Raymond2000-05-131-4/+5
| | | | svn path=/trunk/; revision=2890
* Another minor bugfix.Eric S. Raymond2000-04-211-1/+0
| | | | svn path=/trunk/; revision=2889
* Better deletion handling.Eric S. Raymond2000-04-211-2/+7
| | | | svn path=/trunk/; revision=2888
* This version works better.Eric S. Raymond2000-04-211-10/+4
| | | | svn path=/trunk/; revision=2887
* Added guard code.Eric S. Raymond2000-04-211-8/+17
| | | | svn path=/trunk/; revision=2880
* Take note of the Domino bug.Eric S. Raymond2000-03-301-0/+9
| | | | svn path=/trunk/; revision=2852
* Prevent some spurious matches.Eric S. Raymond2000-03-291-2/+2
| | | | svn path=/trunk/; revision=2839
* Back out the InterChange workaround.Eric S. Raymond2000-03-241-4/+4
| | | | svn path=/trunk/; revision=2837
* Work around InterChange.Eric S. Raymond2000-03-211-3/+6
| | | | svn path=/trunk/; revision=2830
* Typo fix.Eric S. Raymond2000-03-061-1/+1
| | | | svn path=/trunk/; revision=2796
* Cleaner icon generation.Eric S. Raymond2000-03-061-4/+2
| | | | svn path=/trunk/; revision=2795
* Embed a suitable test.Eric S. Raymond2000-03-061-0/+5
| | | | svn path=/trunk/; revision=2794
* Simple rename.Eric S. Raymond2000-03-061-8/+8
| | | | svn path=/trunk/; revision=2793
* Deal with fetchmailconf bug.Eric S. Raymond2000-03-061-1/+1
| | | | svn path=/trunk/; revision=2791
* Implemented support for RFC2177 IDLE command.Eric S. Raymond2000-03-061-3/+9
| | | | svn path=/trunk/; revision=2790
* Fix for Red Hat bug 9982.Eric S. Raymond2000-03-051-0/+1
| | | | svn path=/trunk/; revision=2782
* Rearranged autoprobe code.Eric S. Raymond2000-02-221-83/+85
| | | | svn path=/trunk/; revision=2767
* Attempted bug fix.Eric S. Raymond2000-02-191-34/+34
| | | | svn path=/trunk/; revision=2761
* Note RFC violation.Eric S. Raymond2000-02-181-3/+3
| | | | svn path=/trunk/; revision=2759
* Various minor bug fixes.Eric S. Raymond2000-02-181-2/+10
| | | | svn path=/trunk/; revision=2757
* Fix for fetchmailconf.Eric S. Raymond2000-02-121-3/+3
| | | | svn path=/trunk/; revision=2744
* Cosmetic fixes.Eric S. Raymond2000-02-101-3/+10
| | | | svn path=/trunk/; revision=2738
* LinuxWorld hacks.Eric S. Raymond2000-02-051-6/+14
| | | | svn path=/trunk/; revision=2729
* Before trying to clean up closes.Eric S. Raymond2000-01-311-41/+41
| | | | svn path=/trunk/; revision=2722
* Fixed indentation error in fetchmailconf.Eric S. Raymond1999-12-191-2/+2
| | | | svn path=/trunk/; revision=2664
* Ready to ship 5.2.0.Eric S. Raymond1999-11-301-0/+24
| | | | svn path=/trunk/; revision=2656
| FOLDER folder_list | SMTPHOST smtp_list | FETCHDOMAINS fetch_list | SMTPADDRESS STRING {current.smtpaddress = xstrdup($2);} | SMTPNAME STRING {current.smtpname = xstrdup($2);} | SPAMRESPONSE num_list | MDA STRING {current.mda = xstrdup($2);} | BSMTP STRING {current.bsmtp = xstrdup($2);} | LMTP {current.listener = LMTP_MODE;} | PRECONNECT STRING {current.preconnect = xstrdup($2);} | POSTCONNECT STRING {current.postconnect = xstrdup($2);} | KEEP {current.keep = FLAG_TRUE;} | FLUSH {current.flush = FLAG_TRUE;} | FETCHALL {current.fetchall = FLAG_TRUE;} | REWRITE {current.rewrite = FLAG_TRUE;} | FORCECR {current.forcecr = FLAG_TRUE;} | STRIPCR {current.stripcr = FLAG_TRUE;} | PASS8BITS {current.pass8bits = FLAG_TRUE;} | DROPSTATUS {current.dropstatus = FLAG_TRUE;} | DROPDELIVERED {current.dropdelivered = FLAG_TRUE;} | MIMEDECODE {current.mimedecode = FLAG_TRUE;} | IDLE {current.idle = FLAG_TRUE;} | SSL {current.use_ssl = FLAG_TRUE;} | SSLKEY STRING {current.sslkey = xstrdup($2);} | SSLCERT STRING {current.sslcert = xstrdup($2);} | SSLPROTO STRING {current.sslproto = xstrdup($2);} | SSLCERTCK {current.sslcertck = FLAG_TRUE;} | SSLCERTPATH STRING {current.sslcertpath = xstrdup($2);} | SSLFINGERPRINT STRING {current.sslfingerprint = xstrdup($2);} | NO KEEP {current.keep = FLAG_FALSE;} | NO FLUSH {current.flush = FLAG_FALSE;} | NO FETCHALL {current.fetchall = FLAG_FALSE;} | NO REWRITE {current.rewrite = FLAG_FALSE;} | NO FORCECR {current.forcecr = FLAG_FALSE;} | NO STRIPCR {current.stripcr = FLAG_FALSE;} | NO PASS8BITS {current.pass8bits = FLAG_FALSE;} | NO DROPSTATUS {current.dropstatus = FLAG_FALSE;} | NO DROPDELIVERED {current.dropdelivered = FLAG_FALSE;} | NO MIMEDECODE {current.mimedecode = FLAG_FALSE;} | NO IDLE {current.idle = FLAG_FALSE;} | NO SSL {current.use_ssl = FLAG_FALSE;} | LIMIT NUMBER {current.limit = NUM_VALUE_IN($2);} | WARNINGS NUMBER {current.warnings = NUM_VALUE_IN($2);} | FETCHLIMIT NUMBER {current.fetchlimit = NUM_VALUE_IN($2);} | BATCHLIMIT NUMBER {current.batchlimit = NUM_VALUE_IN($2);} | EXPUNGE NUMBER {current.expunge = NUM_VALUE_IN($2);} | PROPERTIES STRING {current.properties = xstrdup($2);} ; %% /* lexer interface */ extern char *rcfile; extern int prc_lineno; extern char *yytext; extern FILE *yyin; static struct query *hosttail; /* where to add new elements */ void yyerror (const char *s) /* report a syntax error */ { report_at_line(stderr, 0, rcfile, prc_lineno, GT_("%s at %s"), s, (yytext && yytext[0]) ? yytext : GT_("end of input")); prc_errflag++; } int prc_filecheck(const char *pathname, const flag securecheck) /* check that a configuration file is secure */ { #ifndef __EMX__ struct stat statbuf; errno = 0; /* special case useful for debugging purposes */ if (strcmp("/dev/null", pathname) == 0) return(PS_SUCCESS); /* pass through the special name for stdin */ if (strcmp("-", pathname) == 0) return(PS_SUCCESS); /* the run control file must have the same uid as the REAL uid of this process, it must have permissions no greater than 600, and it must not be a symbolic link. We check these conditions here. */ if (lstat(pathname, &statbuf) < 0) { if (errno == ENOENT) return(PS_SUCCESS); else { report(stderr, "lstat: %s: %s\n", pathname, strerror(errno)); return(PS_IOERR); } } if (!securecheck) return PS_SUCCESS; if ((statbuf.st_mode & S_IFLNK) == S_IFLNK) { fprintf(stderr, GT_("File %s must not be a symbolic link.\n"), pathname); return(PS_IOERR); } #ifndef __BEOS__ if (statbuf.st_mode & ~(S_IFREG | S_IREAD | S_IWRITE | S_IEXEC | S_IXGRP)) { fprintf(stderr, GT_("File %s must have no more than -rwx--x--- (0710) permissions.\n"), pathname); return(PS_IOERR); } #endif /* __BEOS__ */ #ifdef HAVE_GETEUID if (statbuf.st_uid != geteuid()) #else if (statbuf.st_uid != getuid()) #endif /* HAVE_GETEUID */ { fprintf(stderr, GT_("File %s must be owned by you.\n"), pathname); return(PS_IOERR); } #endif return(PS_SUCCESS); } int prc_parse_file (const char *pathname, const flag securecheck) /* digest the configuration into a linked list of host records */ { prc_errflag = 0; querylist = hosttail = (struct query *)NULL; errno = 0; /* Check that the file is secure */ if ( (prc_errflag = prc_filecheck(pathname, securecheck)) != 0 ) return(prc_errflag); /* * Croak if the configuration directory does not exist. * This probably means an NFS mount failed and we can't * see a configuration file that ought to be there. * Question: is this a portable check? It's not clear * that all implementations of lstat() will return ENOTDIR * rather than plain ENOENT in this case... */ if (errno == ENOTDIR) return(PS_IOERR); else if (errno == ENOENT) return(PS_SUCCESS); /* Open the configuration file and feed it to the lexer. */ if (strcmp(pathname, "-") == 0) yyin = stdin; else if ((yyin = fopen(pathname,"r")) == (FILE *)NULL) { report(stderr, "open: %s: %s\n", pathname, strerror(errno)); return(PS_IOERR); } yyparse(); /* parse entire file */ fclose(yyin); /* not checking this should be safe, file mode was r */ if (prc_errflag) return(PS_SYNTAX); else return(PS_SUCCESS); } static void reset_server(const char *name, int skip) /* clear the entire global record and initialize it with a new name */ { trailer = FALSE; memset(&current,'\0',sizeof(current)); current.smtp_socket = -1; current.server.pollname = xstrdup(name); current.server.skip = skip; current.server.principal = (char *)NULL; } static void user_reset(void) /* clear the global current record (user parameters) used by the parser */ { struct hostdata save; /* * Purpose of this code is to initialize the new server block, but * preserve whatever server name was previously set. Also * preserve server options unless the command-line explicitly * overrides them. */ save = current.server; memset(&current, '\0', sizeof(current)); current.smtp_socket = -1; current.server = save; } struct query *hostalloc(init) /* append a host record to the host list */ struct query *init; /* pointer to block containing initial values */ { struct query *node; /* allocate new node */ node = (struct query *) xmalloc(sizeof(struct query)); /* initialize it */ if (init) memcpy(node, init, sizeof(struct query)); else { memset(node, '\0', sizeof(struct query)); node->smtp_socket = -1; } /* append to end of list */ if (hosttail != (struct query *) 0) hosttail->next = node; /* list contains at least one element */ else querylist = node; /* list is empty */ hosttail = node; if (trailer) node->server.lead_server = leadentry; else { node->server.lead_server = NULL; leadentry = &node->server; } return(node); } static void record_current(void) /* register current parameters and append to the host list */ { (void) hostalloc(&current); trailer = TRUE; } /* easier to do this than cope with variations in where the library lives */ int yywrap(void) {return 1;} /* rcfile_y.y ends here */