diff options
author | Eduardo Chappa <chappa@washington.edu> | 2015-05-08 09:12:03 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2015-05-08 09:12:03 -0600 |
commit | 78cdd43ac7f0b6b14dddc0a539f50bf2609ebfa5 (patch) | |
tree | aabefe2bc16da03777e69e85718cf62aaaf4db66 /pith | |
parent | 21aedc404d8e1bf637e810ee521e99472b1e1287 (diff) | |
download | alpine-78cdd43ac7f0b6b14dddc0a539f50bf2609ebfa5.tar.xz |
* Crash: Pico would crash when a search and replace was requested. The
problem was that the menu must have size 10, even if not all items
are used, and in this case, it had size 2, making the routines that
process menu items crash.
* The feature Scramble the Message-ID When Sending will also scramble
the name, version and operative system in the message-id header.
Based on a contribution by Dennis Davis, which is itself based on a
contribution by Mark Hills.
Diffstat (limited to 'pith')
-rw-r--r-- | pith/pine.hlp | 9 | ||||
-rw-r--r-- | pith/reply.c | 44 | ||||
-rw-r--r-- | pith/reply.h | 1 |
3 files changed, 47 insertions, 7 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp index 65adbef4..820c553a 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -224,6 +224,10 @@ Additions include: <LI> Make sure titlebar (the line at the top of the screen) always contains the name of the folder/newsgroup that is open, if this fits in the title. + <LI> The feature <a href="h_config_scramble_message_id">FEATURE: <!--#echo var="FEAT_scramble-message-id"--></a> + will also scramble the name, version and operative system in the message-id header. + Based on a contribution by Dennis Davis, which is itself based on a contribution by + Mark Hills. </UL> @@ -28368,6 +28372,11 @@ The result will still have the correct syntax for a Message-ID but the part of the MessageID that is often a domain name will not be an actual domain name because the letters will be scrambled. <P> +In addition, other information such as the name program, version, and +a code for operating system used to build Alpine, will be encoded using +the Rot13 transformation, except for the version number which will be +encoded using a Rot5 transformation. +<P> It is possible (but unlikely?) that some spam detection software will use that as a reason to reject the mail as spam. It has also been reported that some spam detection software uses the diff --git a/pith/reply.c b/pith/reply.c index 54223e68..f60ce58f 100644 --- a/pith/reply.c +++ b/pith/reply.c @@ -3217,6 +3217,9 @@ generate_message_id(void) time_t now; struct tm *now_x; char *hostpart = NULL; + char *alpine_name = NULL; + char *alpine_version = NULL; + char *system_os = NULL; now = time((time_t *)0); now_x = localtime(&now); @@ -3228,23 +3231,33 @@ generate_message_id(void) osec = now_x->tm_sec; } - hostpart = F_ON(F_ROT13_MESSAGE_ID, ps_global) - ? rot13(ps_global->hostname) - : cpystr(ps_global->hostname); + if(F_ON(F_ROT13_MESSAGE_ID, ps_global)){ + hostpart = rot13(ps_global->hostname); + alpine_name = rot13("alpine"); + alpine_version = rot5n(ALPINE_VERSION); + system_os = rot13(SYSTYPE); + } else { + hostpart = cpystr(ps_global->hostname); + alpine_name = cpystr("alpine"); + alpine_version = cpystr(ALPINE_VERSION); + system_os = cpystr(SYSTYPE); + } if(!hostpart) hostpart = cpystr("huh"); - snprintf(idbuf, sizeof(idbuf), "<alpine.%.4s.%.20s.%02d%02d%02d%02d%02d%02d%X.%d@%.50s>", - SYSTYPE, ALPINE_VERSION, (now_x->tm_year) % 100, now_x->tm_mon + 1, + snprintf(idbuf, sizeof(idbuf), "<%.6s.%.4s.%.20s.%02d%02d%02d%02d%02d%02d%X.%d@%.50s>", + alpine_name, system_os, alpine_version, (now_x->tm_year) % 100, now_x->tm_mon + 1, now_x->tm_mday, now_x->tm_hour, now_x->tm_min, now_x->tm_sec, cnt, getpid(), hostpart); idbuf[sizeof(idbuf)-1] = '\0'; id = cpystr(idbuf); - if(hostpart) - fs_give((void **) &hostpart); + if(hostpart) fs_give((void **) &hostpart); + if(alpine_name) fs_give((void **) & alpine_name); + if(alpine_version) fs_give((void **)&alpine_version); + if(system_os) fs_give((void **)&system_os); return(id); } @@ -3290,6 +3303,23 @@ rot13(char *src) return(ret); } +char * +rot5n(char *src) +{ + char byte, *p, *ret = NULL; + + if(src && *src){ + ret = (char *) fs_get((strlen(src)+1) * sizeof(char)); + p = ret; + while((byte = *src++) != '\0') + *p++ = ((byte >= '0') && (byte <= '9') + ? ((byte - '0' + 5) % 10 + '0') : byte); + *p = '\0'; + } + + return(ret); +} + /*---------------------------------------------------------------------- Return the first true address pointer (modulo group syntax allowance) diff --git a/pith/reply.h b/pith/reply.h index 315f81c7..9809dfdb 100644 --- a/pith/reply.h +++ b/pith/reply.h @@ -95,6 +95,7 @@ char *reply_in_reply_to(ENVELOPE *); char *generate_message_id(void); char *generate_user_agent(void); char *rot13(char *); +char *rot5n(char *); ADDRESS *first_addr(ADDRESS *); char *get_signature_lit(char *, int, int, int, int); int sigdashes_are_present(char *); |