rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit ba7c1d3dba8115ac19da4030109b818ae5f3e4e1
parent fb2a2e9b1cb1bfca824316633e2c18b7447d19a2
Author: Christoph Lohmann <20h@r-36.net>
Date:   Wed, 22 Mar 2017 13:54:54 +0100

Really remove option and longer lines (for spam).

Diffstat:
ind.h | 2+-
parser.c | 16++++++++--------
remove.c | 11++++++++---
3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/ind.h b/ind.h @@ -12,7 +12,7 @@ #include <stdarg.h> #include <time.h> -#define MAXLINESIZE 1048576 +#define MAXLINESIZE 10485760 void die(char *fmt, ...); void edie(char *fmt, ...); diff --git a/parser.c b/parser.c @@ -81,15 +81,15 @@ parser_readall(parser_t *parser, char *buf, int len) switch(parser->type) { case PARSER_NET: - r = net_readall((net_t *)parser->struc, buf, len); - printf(buf); - return r; - //return net_readall((net_t *)parser->struc, buf, len); + //r = net_readall((net_t *)parser->struc, buf, len); + //printf(buf); + //return r; + return net_readall((net_t *)parser->struc, buf, len); case PARSER_STRING: - r = strio_readall((strio_t *)parser->struc, buf, len); - printf(buf); - return r; - //return strio_readall((strio_t *)parser->struc, buf, len); + //r = strio_readall((strio_t *)parser->struc, buf, len); + //printf(buf); + //return r; + return strio_readall((strio_t *)parser->struc, buf, len); default: break; } diff --git a/remove.c b/remove.c @@ -21,7 +21,7 @@ char *argv0; void removeusage(void) { - die("usage: %s [-hqde] [-c cfg] [-m folder] msgs\n", argv0); + die("usage: %s [-hqdre] [-c cfg] [-m folder] msgs\n", argv0); } int @@ -37,8 +37,9 @@ removemain(int argc, char *argv[]) BEQUIET = 0x01, DODISPOSE = 0x02, DOEXPUNGE = 0x04, + DOREMOVE = 0x08, - NOARGS = 0x08 + NOARGS = 0x10 }; status = 0; @@ -61,6 +62,10 @@ removemain(int argc, char *argv[]) case 'q': status |= BEQUIET; break; + case 'r': + status &= ~DODISPOSE; + status |= DOREMOVE; + break; default: removeusage(); } ARGEND; @@ -78,7 +83,7 @@ removemain(int argc, char *argv[]) selected = memdup(selected, strlen(selected)+1); } dispose = config_getstr(cfg, "dispose"); - if (dispose != NULL && strlen(dispose) > 0) + if (dispose != NULL && strlen(dispose) > 0 && !(status & DOREMOVE)) status |= DODISPOSE; config_free(cfg);