tAccept emails from any address if author is NULL - scribo - Email-based phlog generator
(HTM) git clone git://git.z3bra.org/scribo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 36223940e8b6524ea73bbbfd801265e8def6dc4e
(DIR) parent 32d45f430b241c943ea593a9125211e9842013dc
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Wed, 9 Sep 2020 17:24:28 +0200
Accept emails from any address if author is NULL
Diffstat:
M config.def.h | 2 +-
M scribo.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/config.def.h b/config.def.h
t@@ -1,7 +1,7 @@
char *basedir = ".";
char *datefmt = "%c";
-char *author = "contact@z3bra.org";
+char *author = NULL;
char *host = "z3bra.org";
int port = 70;
(DIR) diff --git a/scribo.c b/scribo.c
t@@ -48,7 +48,7 @@ int writeindex(FILE *, char *);
void
usage(char *pgm)
{
- fprintf(stderr, "usage: %s [-a author] [-b basedir] [-d fmt] [-io file] [-x cmd]\n", pgm);
+ fprintf(stderr, "usage: %s [-h] [-a address] [-b basedir] [-d fmt] [-io file] [-x cmd]\n", pgm);
}
char *
t@@ -192,7 +192,7 @@ verifyheaders(struct headers *head)
/* verify sender's address */
addr = rfc5322_addr(header(head, "From"));
- if (strncmp(addr, author, strlen(author))) {
+ if (author && strncmp(addr, author, strlen(author))) {
fprintf(stderr, "<%s> is not authorized to publish content\n", addr);
return -1;
}