diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile index 7fcaae1d938f..9b3e1531d9c9 100644 --- a/mail/mutt/Makefile +++ b/mail/mutt/Makefile @@ -1,231 +1,231 @@ # Created by: Udo Schweigert PORTNAME= mutt -DISTVERSION= 2.2.5 +DISTVERSION= 2.2.6 CATEGORIES+= mail MASTER_SITES= ftp://ftp.mutt.org/pub/mutt/ \ https://bitbucket.org/mutt/mutt/downloads/ \ http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv DIST_SUBDIR= mutt EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} PATCH_SITES+= http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://vc.org.ua/mutt/:vc PATCH_DIST_STRIP= -p1 MAINTAINER= dereks@lifeofadishwasher.com COMMENT= Small but powerful text based program for read/writing e-mail LICENSE= GPLv2+ RUN_DEPENDS= ${LOCALBASE}/etc/mime.types:misc/mime-support USES= cpe perl5 shebangfix ssl USE_PERL5= build SHEBANG_FILES= contrib/smime_keys_test.pl doc/gen-map-doc smime_keys.pl GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-fcntl \ --enable-compressed \ --enable-external-dotlock \ --enable-imap \ --enable-pop \ --enable-sidebar \ --sysconfdir=${PREFIX}/etc \ --with-docdir=${DOCSDIR} \ --with-ssl=${OPENSSLBASE} .if defined(MUTT_CONFIGURE_ARGS) CONFIGURE_ARGS+= ${MUTT_CONFIGURE_ARGS} .endif CONFLICTS= ja-mutt ja-mutt-devel mutt-1.4* mutt-devel-lite mutt-lite \ zh-mutt-devel INFO= ${PORTNAME} OPTIONS_DEFINE= AUTOCRYPT DEBUG_LOGS DOCS EXAMPLES FLOCK GPGME \ GREETING_PATCH HTML ICONV IDN IFDEF_PATCH LOCALES_FIX \ MAILBOX_MANPAGES MAILDIR_MTIME_PATCH NLS QUOTE_PATCH \ REVERSE_REPLY_PATCH SMART_DATE SMIME SMTP URLVIEW OPTIONS_DEFAULT= AUTOCRYPT DEBUG_LOGS GPGME GSSAPI_NONE HCACHE_LMDB HTML \ ICONV IDN IFDEF_PATCH LOCALES_FIX MAILBOX_MANPAGES \ MAILDIR_MTIME_PATCH NCURSES NLS QUOTE_PATCH \ REVERSE_REPLY_PATCH SASL_CYRUS SMART_DATE SMIME SMTP \ URLVIEW OPTIONS_SINGLE= GSSAPI HCACHE SASL SCREEN OPTIONS_SINGLE_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE OPTIONS_SINGLE_HCACHE= HCACHE_BDB HCACHE_GDBM HCACHE_KYOTOCABINET HCACHE_LMDB \ HCACHE_NONE HCACHE_QDBM HCACHE_TOKYOCABINET OPTIONS_SINGLE_SASL= SASL_CYRUS SASL_GSASL SASL_NONE OPTIONS_SINGLE_SCREEN= NCURSES SLANG OPTIONS_SUB= yes AUTOCRYPT_DESC= Convenient End-to-End Encryption DEBUG_LOGS_DESC= Debugging capabilities FLOCK_DESC= flock() usage GPGME_DESC= Gpgme interface GREETING_PATCH_DESC= Greeting support HCACHE_BDB_DESC= Use Berkeley DB (BDB) (AGPLv3) HCACHE_DESC= Header Cache support HCACHE_GDBM_DESC= Use GDBM HCACHE_KYOTOCABINET_DESC= Use Kyoto Cabinet HCACHE_LMDB_DESC= Use LMDB HCACHE_NONE_DESC= Disable Header Cache HCACHE_QDBM_DESC= Use QDBM HCACHE_TOKYOCABINET_DESC= Use Tokyo Cabinet HTML_DESC= HTML documentation IDN_DESC= International Domain Names (implies ICONV) IFDEF_PATCH_DESC= ifdef feature LOCALES_FIX_DESC= Locales fix MAILBOX_MANPAGES_DESC= Install mbox.5/mmdf.5 manpages MAILDIR_MTIME_PATCH_DESC= Maildir mtime patch NCURSES_DESC= Ncurses support NLS_DESC= Native language support (implies ICONV) QUOTE_PATCH_DESC= Extended quoting REVERSE_REPLY_PATCH_DESC= Reverse_reply SASL_CYRUS_DESC= Cyrus SASL Authentication SASL_GSASL_DESC= GNU SASL Authentication SASL_NONE_DESC= Disable SASL Authentication SLANG_DESC= SLANG support SMART_DATE_DESC= Dynamic date formatting with "%@" SMIME_DESC= SMIME email check option patch SMTP_DESC= SMTP relay support URLVIEW_DESC= Use urlview for the URL selector menu AUTOCRYPT_IMPLIES= GPGME IDN AUTOCRYPT_BUILD_DEPENDS= ${AUTOCRYPT_DEPENDS} AUTOCRYPT_RUN_DEPENDS= ${AUTOCRYPT_DEPENDS} AUTOCRYPT_USES= sqlite:3 AUTOCRYPT_CONFIGURE_ENABLE= autocrypt AUTOCRYPT_CONFIGURE_WITH= sqlite3=${LOCALBASE} AUTOCRYPT_DEPENDS= gnupg>=2.1:security/gnupg \ gpgme>=1.8:security/gpgme DEBUG_LOGS_CONFIGURE_ON= --enable-debug DOCS_BUILD_DEPENDS= lynx:www/lynx DOCS_CONFIGURE_OFF= --disable-doc FLOCK_CONFIGURE_ENABLE= flock GPGME_LIB_DEPENDS+= libassuan.so:security/libassuan \ libgpg-error.so:security/libgpg-error \ libgpgme.so:security/gpgme GPGME_CONFIGURE_ENABLE= gpgme GREETING_PATCH_PATCHFILES= mutt-${GREETING_PATCH_VERSION}.vc.greeting:vc # Handle GSSAPI from various places GSSAPI_BASE_USES= gssapi GSSAPI_BASE_CONFIGURE_ON= ${GSSAPI_CONFIGURE_ARGS} \ --with-gss=${GSSAPIBASEDIR} GSSAPI_HEIMDAL_USES= gssapi:heimdal GSSAPI_HEIMDAL_CONFIGURE_ON= ${GSSAPI_CONFIGURE_ARGS} \ --with-gss=${GSSAPIBASEDIR} GSSAPI_MIT_USES= gssapi:mit GSSAPI_MIT_CONFIGURE_ON= ${GSSAPI_CONFIGURE_ARGS} \ --with-gss=${GSSAPIBASEDIR} GSSAPI_NONE_CONFIGURE_ON= --without-gss HCACHE_BDB_USES= bdb:18 HCACHE_BDB_CONFIGURE_WITH= bdb=${LOCALBASE} HCACHE_BDB_VARS= CFLAGS+=-I${BDB_INCLUDE_DIR} \ LDFLAGS+=-L${BDB_LIB_DIR} \ LICENSE=AGPLv3 HCACHE_GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm HCACHE_GDBM_CONFIGURE_WITH= gdbm=${LOCALBASE} HCACHE_KYOTOCABINET_LIB_DEPENDS= libkyotocabinet.so:databases/kyotocabinet HCACHE_KYOTOCABINET_CONFIGURE_WITH= kyotocabinet=${LOCALBASE} HCACHE_LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb HCACHE_LMDB_CONFIGURE_WITH= lmdb=${LOCALBASE} HCACHE_NONE_CONFIGURE_ON= --disable-hcache HCACHE_NONE_CONFIGURE_OFF= --enable-hcache HCACHE_QDBM_LIB_DEPENDS= libqdbm.so:databases/qdbm HCACHE_QDBM_CONFIGURE_WITH= qdbm=${LOCALBASE} HCACHE_TOKYOCABINET_LIB_DEPENDS= libtokyocabinet.so:databases/tokyocabinet HCACHE_TOKYOCABINET_CONFIGURE_WITH= tokyocabinet=${LOCALBASE} ICONV_USES= iconv:translit ICONV_CONFIGURE_ON= ${ICONV_CONFIGURE_ARG} ICONV_CONFIGURE_OFF= --disable-iconv IDN_IMPLIES= ICONV IDN_LIB_DEPENDS= libidn2.so:dns/libidn2 \ libunistring.so:devel/libunistring IDN_CONFIGURE_WITH= idn2=${LOCALBASE} IFDEF_PATCH_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ifdef LOCALES_FIX_CONFIGURE_ON= --enable-locales-fix MAILDIR_MTIME_PATCH_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-maildir-mtime NCURSES_USES= ncurses NLS_IMPLIES= ICONV NLS_USES= gettext NLS_CONFIGURE_ENABLE= nls QUOTE_PATCH_PATCHFILES= patch-${VVV_PATCH_VERSION}.vvv.initials.xz:vvv \ mutt-${GREETING_PATCH_VERSION}.vvv.quote:vc REVERSE_REPLY_PATCH_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-reverse_reply SASL_CYRUS_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 SASL_CYRUS_CONFIGURE_WITH= sasl=${LOCALBASE} SASL_GSASL_LIB_DEPENDS= libgsasl.so:security/libgsasl SASL_GSASL_CONFIGURE_WITH= gsasl=${LOCALBASE} # Handle ncurses/ncurses-port/slang SLANG_LIB_DEPENDS= libslang.so:devel/libslang2 SLANG_CONFIGURE_ON= --with-slang=${LOCALBASE} SLANG_VARS= PKGMESSAGE=${FILESDIR}/pkg-message.slang SMART_DATE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-smartdate SMIME_EXTRA_PATCHES= ${PATCHDIR}/extra-smime-sender SMTP_CONFIGURE_ENABLE= smtp URLVIEW_RUN_DEPENDS= urlview:textproc/urlview .ifnmake portclippy .ifmake makesum # for optional distfiles patchfiles OPTIONS_OVERRIDE= ${OPTIONS_DEFAULT} ${OPTIONS_DEFINE} .MAKEOVERRIDES+= OPTIONS_OVERRIDE .endif .endif .include VVV_PATCH_VERSION= 1.13.0 GREETING_PATCH_VERSION= 2.2.0 post-install: ${INSTALL_MAN} ${FILESDIR}/mailcap.5 ${STAGEDIR}${MANPREFIX}/man/man5 pre-configure:: # Stop make from setgid mutt_dotlock @${REINPLACE_CMD} \ -e '/if test.*mutt_dotlock.*DOTLOCK_GROUP/s/if/if ${FALSE} \&\&/' \ ${WRKSRC}/Makefile.in # Base FreeBSD krb5-config --version returns "FreeBSD heimdal" @${REINPLACE_CMD} -e 's,?eimdal\*),?eimdal*|\"FreeBSD heimdal\"*),' \ ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} # Install contrib samples to ${EXAMPLESDIR} @${REINPLACE_CMD} -e 's#$$(docdir)/samples#${EXAMPLESDIR}#g' \ ${WRKSRC}/contrib/Makefile.in # Undo some dist. installed files post-stage:: @${MV} ${STAGEDIR}/${LOCALBASE}/etc/Muttrc.dist \ ${STAGEDIR}/${LOCALBASE}/etc/Muttrc.sample @${RM} ${STAGEDIR}/${LOCALBASE}/etc/mime.types* .include diff --git a/mail/mutt/distinfo b/mail/mutt/distinfo index 566b0cbd0ac9..f99217c89310 100644 --- a/mail/mutt/distinfo +++ b/mail/mutt/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1653001771 -SHA256 (mutt/mutt-2.2.5.tar.gz) = ff8b781159794adcca126b551d5e419174b7b38a582a159bfe4e13451a757e47 -SIZE (mutt/mutt-2.2.5.tar.gz) = 5516189 +TIMESTAMP = 1654459078 +SHA256 (mutt/mutt-2.2.6.tar.gz) = ffa2d93517cfc606fe01daffc5f12e42062a1c134d3b9af78484ebc5430888d3 +SIZE (mutt/mutt-2.2.6.tar.gz) = 5517121 SHA256 (mutt/mutt-2.2.0.vc.greeting) = 7abb467cfaa0ccbfa1fa7cdf8585eefef94e039459ff95fb59efe23043d941d2 SIZE (mutt/mutt-2.2.0.vc.greeting) = 1979 SHA256 (mutt/patch-1.13.0.vvv.initials.xz) = 8b25ad6596bd57d94f6551e7e73ceb8da620468e96fb507b2f51545d5b3eaa02 SIZE (mutt/patch-1.13.0.vvv.initials.xz) = 720 SHA256 (mutt/mutt-2.2.0.vvv.quote) = 4a3786921d11c931fa8db16b089398d72ef6ae0c42503e5d4884dbaa0e01032b SIZE (mutt/mutt-2.2.0.vvv.quote) = 2909 diff --git a/mail/mutt/files/extra-patch-ifdef b/mail/mutt/files/extra-patch-ifdef index 6b7f0dc129da..90d893067df5 100644 --- a/mail/mutt/files/extra-patch-ifdef +++ b/mail/mutt/files/extra-patch-ifdef @@ -1,77 +1,77 @@ ---- PATCHES.orig 2022-04-30 21:11:31 UTC +--- PATCHES.orig 2022-06-05 20:10:54 UTC +++ PATCHES @@ -0,0 +1 @@ +patch-1.5.4.cd.ifdef.1 ---- init.c.orig 2022-04-12 20:38:51 UTC +--- init.c.orig 2022-05-11 16:57:07 UTC +++ init.c @@ -715,6 +715,52 @@ static mbchar_table *parse_mbchar_table (const char *s return t; } +static int parse_ifdef (BUFFER *tmp, BUFFER *s, union pointer_long_t data, BUFFER *err) +{ + int i, j, res = 0; + BUFFER token; + + memset (&token, 0, sizeof (token)); + mutt_extract_token (tmp, s, 0); + + /* is the item defined as a variable or a function? */ + if (!(res = (mutt_option_index (tmp->data) != -1))) + for (i = 0; !res && i < MENU_MAX; i++) + { + const struct menu_func_op_t *b = km_get_table (Menus[i].value); + + if (!b) + continue; + + for (j = 0; b[j].name; j++) + if (!ascii_strncasecmp (tmp->data, b[j].name, mutt_strlen (tmp->data)) + && (mutt_strlen (b[j].name) == mutt_strlen (tmp->data))) + { + res = 1; + break; + } + } + + if (!MoreArgs (s)) + { + snprintf (err->data, err->dsize, _("ifdef: too few arguments")); + return (-1); + } + mutt_extract_token (tmp, s, MUTT_TOKEN_SPACE); + + if (res) + { + if (mutt_parse_rc_buffer (tmp, &token, err) == -1) + { + mutt_error ("Erreur: %s", err->data); + FREE (&token.data); + return (-1); + } + FREE (&token.data); + } + return 0; +} + static int parse_unignore (BUFFER *buf, BUFFER *s, union pointer_long_t udata, BUFFER *err) { do ---- init.h.orig 2022-04-30 21:11:31 UTC +--- init.h.orig 2022-06-05 20:10:54 UTC +++ init.h -@@ -4927,6 +4927,7 @@ static int parse_lists (BUFFER *, BUFFER *, union poin +@@ -4934,6 +4934,7 @@ static int parse_lists (BUFFER *, BUFFER *, union poin static int parse_unlists (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); static int parse_alias (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); static int parse_unalias (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); +static int parse_ifdef (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); static int parse_echo (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); static int parse_ignore (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); static int parse_unignore (BUFFER *, BUFFER *, union pointer_long_t, BUFFER *); -@@ -4994,6 +4995,7 @@ const struct command_t Commands[] = { +@@ -5001,6 +5002,7 @@ const struct command_t Commands[] = { { "hdr_order", parse_list, {.p=&HeaderOrderList} }, #ifdef HAVE_ICONV { "iconv-hook", mutt_parse_hook, {.l=MUTT_ICONVHOOK} }, + { "ifdef", parse_ifdef, {.l=0} }, #endif { "ignore", parse_ignore, {.l=0} }, { "index-format-hook",mutt_parse_idxfmt_hook, {.l=MUTT_IDXFMTHOOK} }, diff --git a/mail/mutt/files/extra-patch-maildir-mtime b/mail/mutt/files/extra-patch-maildir-mtime index 73306ef3caad..a2d4548bd477 100644 --- a/mail/mutt/files/extra-patch-maildir-mtime +++ b/mail/mutt/files/extra-patch-maildir-mtime @@ -1,52 +1,52 @@ ---- PATCHES.orig 2022-04-30 21:11:31 UTC +--- PATCHES.orig 2022-06-05 20:10:54 UTC +++ PATCHES @@ -0,0 +1 @@ +patch-1.5.7.ust.maildir-mtime.2 ---- browser.c.orig 2022-04-21 21:35:19 UTC +--- browser.c.orig 2022-06-05 18:00:36 UTC +++ browser.c @@ -32,6 +32,7 @@ #ifdef USE_IMAP #include "imap.h" #endif +#include "mx.h" #include #include @@ -531,6 +532,21 @@ static void init_state (struct browser_state *state, M menu->data = state->entry; } +static void check_maildir_times (BUFFY *buf, struct stat *st) +{ + char buffer[_POSIX_PATH_MAX + SHORT_STRING]; + struct stat s; + + if(!buf || buf->magic != MUTT_MAILDIR) + return; + + snprintf (buffer, sizeof (buffer), "%s/tmp", mutt_b2s(buf->pathbuf)); + if (lstat (buffer, &s) != 0) + return; + + st->st_mtime = s.st_mtime; +} + static int examine_directory (MUTTMENU *menu, struct browser_state *state, const char *d, const char *prefix) { @@ -597,6 +613,7 @@ static int examine_directory (MUTTMENU *menu, struct b tmp = Incoming; while (tmp && mutt_strcmp (mutt_b2s (full_path), mutt_b2s (tmp->pathbuf))) tmp = tmp->next; + check_maildir_times (tmp, &s); if (tmp && Context && !tmp->nopoll && !mutt_strcmp (tmp->realpath, Context->realpath)) { @@ -684,6 +701,7 @@ static int examine_mailboxes (MUTTMENU *menu, struct b s.st_mtime = st2.st_mtime; } + check_maildir_times (tmp, &s); add_folder (menu, state, mutt_b2s (mailbox), mutt_b2s (tmp->pathbuf), &s, tmp); } while ((tmp = tmp->next)); diff --git a/mail/mutt/files/extra-patch-reverse_reply b/mail/mutt/files/extra-patch-reverse_reply index 302d69d20179..0147778998ba 100644 --- a/mail/mutt/files/extra-patch-reverse_reply +++ b/mail/mutt/files/extra-patch-reverse_reply @@ -1,93 +1,93 @@ ---- PATCHES.orig 2022-04-30 21:11:31 UTC +--- PATCHES.orig 2022-06-05 20:10:54 UTC +++ PATCHES @@ -0,0 +1 @@ +patch-1.5.6.cb.reverse_reply.2 ---- init.h.orig 2022-04-30 21:11:31 UTC +--- init.h.orig 2022-06-05 20:10:54 UTC +++ init.h @@ -3431,6 +3431,13 @@ struct option_t MuttVars[] = { ** In either case, a missing real name will be filled in afterwards ** using the value of $$realname. */ + { "reverse_reply", DT_BOOL, R_NONE, {.l=OPTREVREPLY}, {.l=0} }, + /* + ** .pp + ** When set, this variable uses the name from your aliases in the To and Cc + ** headers of reply mails you send, like $reverse_alias does in the index. + ** When unset, the headers taken from the original mail are left unchanged. + */ { "rfc2047_parameters", DT_BOOL, R_NONE, {.l=OPTRFC2047PARAMS}, {.l=1} }, /* ** .pp ---- mutt.h.orig 2022-04-30 21:11:31 UTC +--- mutt.h.orig 2022-06-05 20:10:54 UTC +++ mutt.h -@@ -533,6 +533,7 @@ enum +@@ -538,6 +538,7 @@ enum OPTREVALIAS, OPTREVNAME, OPTREVREAL, + OPTREVREPLY, OPTRFC2047PARAMS, OPTSAVEADDRESS, OPTSAVEEMPTY, ---- protos.h.orig 2022-03-24 21:38:29 UTC +--- protos.h.orig 2022-05-21 16:36:29 UTC +++ protos.h @@ -86,6 +86,7 @@ char* mutt_extract_message_id (const char *, const cha ADDRESS *mutt_get_address (ENVELOPE *, char **); ADDRESS *mutt_lookup_alias (const char *s); ADDRESS *mutt_remove_duplicates (ADDRESS *); +ADDRESS *mutt_reverse_address (ADDRESS *); ADDRESS *mutt_remove_adrlist_group_delimiters (ADDRESS *); ADDRESS *mutt_expand_aliases (ADDRESS *); ADDRESS *mutt_parse_adrlist (ADDRESS *, const char *); ---- send.c.orig 2022-03-24 21:38:29 UTC +--- send.c.orig 2022-05-11 16:57:07 UTC +++ send.c @@ -744,6 +744,10 @@ void mutt_fix_reply_recipients (ENVELOPE *env) /* the CC field can get cluttered, especially with lists */ env->to = mutt_remove_duplicates (env->to); env->cc = mutt_remove_duplicates (env->cc); + if (option (OPTREVREPLY)){ + env->to = mutt_reverse_address (env->to); + env->cc = mutt_reverse_address (env->cc); + } env->cc = mutt_remove_xrefs (env->to, env->cc); if (env->cc && !env->to) ---- sendlib.c.orig 2022-04-12 20:38:51 UTC +--- sendlib.c.orig 2022-05-27 21:24:33 UTC +++ sendlib.c -@@ -3093,6 +3093,37 @@ static void set_noconv_flags (BODY *b, short flag) +@@ -3108,6 +3108,37 @@ static void set_noconv_flags (BODY *b, short flag) } } +/* given a list of addresses, return a list of reverse_alias'ed addresses */ +ADDRESS *mutt_reverse_address (ADDRESS *addr) +{ + ADDRESS *top,*tmp,*alias; + + if (addr == NULL) + return NULL; + + if ((alias = alias_reverse_lookup (addr)) && alias->personal) { + tmp = rfc822_cpy_adr_real(alias); + tmp->next = addr->next; + addr->next = NULL; + rfc822_free_address(&addr); + addr = tmp; + } + + for (top = addr; top->next != NULL; top = tmp) { + tmp = top->next; + if ((alias = alias_reverse_lookup (tmp)) && alias->personal) { + top->next = rfc822_cpy_adr_real(alias); + top->next->next = tmp->next; + tmp->next = NULL; + rfc822_free_address(&tmp); + tmp = top->next; + } + } + return addr; +} + + + int mutt_write_fcc (const char *path, SEND_CONTEXT *sctx, const char *msgid, int post, const char *fcc) { HEADER *hdr; diff --git a/mail/mutt/files/extra-patch-smartdate b/mail/mutt/files/extra-patch-smartdate index 80c351ff17d1..a0e81c699146 100644 --- a/mail/mutt/files/extra-patch-smartdate +++ b/mail/mutt/files/extra-patch-smartdate @@ -1,126 +1,126 @@ ---- hdrline.c.orig 2022-04-30 21:11:31 UTC +--- hdrline.c.orig 2022-06-05 20:10:54 UTC +++ hdrline.c @@ -249,6 +249,89 @@ static char *apply_subject_mods (ENVELOPE *env) * %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label) * %Z = status flags */ +static void +format_smartdate( char *buf, size_t max, struct tm *tm, smartdate_type type ) +{ + char *strftime_fmt = NULL; + + switch( type ) { + case FUTURE: /* Date in the future */ + strftime_fmt = "%d%h%y!"; + break; + case SMARTTIME: /* Today */ + strftime_fmt = "%I:%M %p"; + break; + case YESTERDAY: /* Yesterday */ + strncpy( buf, "Yesterday", max ); + break; + case WEEKDAY: /* Within the last 7 days */ + strftime_fmt = "%A"; + break; + case STANDARD: /* Within the last six months */ + strftime_fmt = "%h %d"; + break; + case ANCIENT: /* Older than 6 months */ + strftime_fmt = "%h %Y"; + break; + } + + if( strftime_fmt != NULL ) { + strftime( buf, max, strftime_fmt, tm ); + } +} + +static void +smartdate( char *buf, size_t max, struct tm *tm ) +{ + smartdate_type type = 0; + + struct tm now; + + time_t sse = mktime( tm ); /* Seconds since epoch */ + time_t sse_now = time(NULL); /* Seconds since epoch until now */ + + int dse = 0; /* Days since epoch */ + int dse_now = 0; /* Days since epoch until today */ + + /* Calculate the number of days since epoch */ + dse = sse / (60*60*24); + dse_now = sse_now / (60*60*24); + + /* Default display type */ + type = STANDARD; + + /* Check if the date is in the future */ + if( dse > dse_now ) { + type = FUTURE; + } + else { + int diff = dse_now - dse; + if( diff == 0 ) type = SMARTTIME; + else if( diff == 1 ) type = YESTERDAY; + else if( diff < 7 ) type = WEEKDAY; + else if( diff > 215 ) type = ANCIENT; /* Surely older than six + months */ + else if( diff > 180 ) { + /* + * Slightly heavy calculation to check if the date is more + * than six months in the past. This calculation uses + * calendar months and not the exact number of days. So, + * January 31, 2003 would be considered more than six months + * old whether today's date is August 1 or August 31, 2003 + */ + int monthdiff; + localtime_r( &sse_now, &now ); + monthdiff = ( now.tm_mon - tm->tm_mon ) + + ( ( now.tm_year - tm->tm_year ) * 12 ); + if( monthdiff > 6 ) { + type = ANCIENT; + } + } + } + + format_smartdate( buf, max, tm, type ); +} + static const char * hdr_format_str (char *dest, size_t destlen, @@ -422,7 +505,13 @@ hdr_format_str (char *dest, if (!do_locales) setlocale (LC_TIME, "C"); - strftime (buf2, sizeof (buf2), dest, tm); + /* Identify the non-strftime smartdate pattern (%@) */ + if( strncmp( dest, "%@", 2 ) == 0 ) { + smartdate( buf2, sizeof( buf2 ), tm ); + } + else { + strftime (buf2, sizeof (buf2), dest, tm); + } if (!do_locales) setlocale (LC_TIME, ""); ---- mutt.h.orig 2022-04-30 21:11:31 UTC +--- mutt.h.orig 2022-06-05 20:10:54 UTC +++ mutt.h @@ -168,6 +168,16 @@ typedef enum MUTT_WRITE_HEADER_MIME } mutt_write_header_mode; +/* flags for SmartDate */ +typedef enum { + FUTURE = 1, + SMARTTIME = 2, + YESTERDAY = 3, + WEEKDAY = 4, + STANDARD = 5, + ANCIENT = 6 +} smartdate_type; + /* types for mutt_add_hook() */ #define MUTT_FOLDERHOOK 1 #define MUTT_MBOXHOOK (1<<1) diff --git a/mail/mutt/files/extra-smime-sender b/mail/mutt/files/extra-smime-sender index 2b60f4088a74..5e689aa61ff7 100644 --- a/mail/mutt/files/extra-smime-sender +++ b/mail/mutt/files/extra-smime-sender @@ -1,39 +1,39 @@ ---- commands.c.orig 2022-03-24 21:38:29 UTC +--- commands.c.orig 2022-05-11 16:57:07 UTC +++ commands.c @@ -302,7 +302,7 @@ int mutt_display_message (HEADER *cur) { if (cur->security & GOODSIGN) { - if (!crypt_smime_verify_sender(cur)) + if (option(OPTSMIMENOSENDER) || !crypt_smime_verify_sender(cur)) mutt_message ( _("S/MIME signature successfully verified.")); else mutt_error ( _("S/MIME certificate owner does not match sender.")); ---- init.h.orig 2022-04-30 21:11:31 UTC +--- init.h.orig 2022-06-05 20:10:54 UTC +++ init.h -@@ -3928,6 +3928,15 @@ struct option_t MuttVars[] = { +@@ -3935,6 +3935,15 @@ struct option_t MuttVars[] = { ** to determine the key to use. It will ask you to supply a key, if it can't find one. ** (S/MIME only) */ + { "smime_dont_check_sender", DT_BOOL, R_NONE, {.l=OPTSMIMENOSENDER}, {.l=0} }, + /* + ** .pp + ** This flag controls wether you want the skip the check for the sender's + ** email address against the email address stored in the certificate. + ** This can be useful if most of your email senders use SMIMEv3 which no + ** longer needs email-addresses as part of the certificates. + ** It is not set by default. + */ { "smime_self_encrypt_as", DT_SYN, R_NONE, {.p="smime_default_key"}, {.p=0} }, { "smime_default_key", DT_STR, R_NONE, {.p=&SmimeDefaultKey}, {.p=0} }, /* ---- mutt.h.orig 2022-04-30 21:11:31 UTC +--- mutt.h.orig 2022-06-05 20:10:55 UTC +++ mutt.h -@@ -617,6 +617,7 @@ enum +@@ -622,6 +622,7 @@ enum OPTSMIMEISDEFAULT, OPTSMIMESELFENCRYPT, OPTASKCERTLABEL, + OPTSMIMENOSENDER, OPTSDEFAULTDECRYPTKEY, OPTPGPIGNORESUB, OPTPGPCHECKEXIT, diff --git a/mail/mutt/files/patch-date-conditional b/mail/mutt/files/patch-date-conditional index ae87993fc648..d2845e668636 100644 --- a/mail/mutt/files/patch-date-conditional +++ b/mail/mutt/files/patch-date-conditional @@ -1,97 +1,97 @@ ---- PATCHES.orig 2022-04-30 21:11:31 UTC +--- PATCHES.orig 2022-06-05 20:10:55 UTC +++ PATCHES @@ -0,0 +1 @@ +patch-1.5.0.ats.date_conditional.1 ---- hdrline.c.orig 2022-04-30 21:11:31 UTC +--- hdrline.c.orig 2022-06-05 20:10:55 UTC +++ hdrline.c @@ -428,6 +428,53 @@ hdr_format_str (char *dest, const char *cp; struct tm *tm; time_t T; + int i = 0, invert = 0; + + if (optional && (op == '[' || op == '(')) { + char *is; + T = time(NULL); + T -= (op == '(') ? hdr->received : hdr->date_sent; + + is = (char *)prefix; + if( *is == '>' ) { + invert = 1; + ++is; + } + + while( *is && *is != '?' ) { + int t = strtol (is, &is, 10); + switch (*(is++)) { + case '?': + break; + case 'y': + t *= 365 * 24 * 60 * 60; + break; + case 'M': + t *= 30 * 24 * 60 * 60; + break; + case 'w': + t *= 7 * 24 * 60 * 60; + break; + case 'd': + t *= 24 * 60 * 60; + break; + case 'h': + t *= 60 * 60; + break; + case 'm': + t *= 60; + break; + } + i += t; + } + + if (i < 0) + i *= -1; + + if( (T > i || T < -1*i) ^ invert ) + optional = 0; + break; + } p = dest; ---- muttlib.c.orig 2022-04-30 19:35:13 UTC +--- muttlib.c.orig 2022-05-21 16:36:29 UTC +++ muttlib.c -@@ -1694,7 +1694,16 @@ void mutt_FormatString (char *dest, /* output buffer +@@ -1701,7 +1701,16 @@ void mutt_FormatString (char *dest, /* output buffer if (*src == '?') { flags |= MUTT_FORMAT_OPTIONAL; - src++; + ch = *(++src); /* save the character to switch on */ + cp = prefix; + ++src; + count = 0; + while (count < sizeof (prefix) && *src != '?') + { + *cp++ = *src++; + count++; + } + *cp = 0; } else { -@@ -1710,12 +1719,12 @@ void mutt_FormatString (char *dest, /* output buffer +@@ -1717,12 +1726,12 @@ void mutt_FormatString (char *dest, /* output buffer count++; } *cp = 0; - } - if (!*src) - break; /* bad format */ + if (!*src) + break; /* bad format */ - ch = *src++; /* save the character to switch on */ + ch = *src++; /* save the character to switch on */ + } if (flags & MUTT_FORMAT_OPTIONAL) { diff --git a/mail/mutt/files/patch-dgc-deepif b/mail/mutt/files/patch-dgc-deepif index a2114d2df8df..b9ca5a455924 100644 --- a/mail/mutt/files/patch-dgc-deepif +++ b/mail/mutt/files/patch-dgc-deepif @@ -1,30 +1,30 @@ ---- muttlib.c.orig 2022-04-30 21:11:31 UTC +--- muttlib.c.orig 2022-06-05 20:10:55 UTC +++ muttlib.c -@@ -1737,6 +1737,12 @@ void mutt_FormatString (char *dest, /* output buffer +@@ -1744,6 +1744,12 @@ void mutt_FormatString (char *dest, /* output buffer count = 0; while (count < sizeof (ifstring) && *src && *src != '?' && *src != '&') { + if (*src == '\\') + { + src++; + if (!*src) + break; + } *cp++ = *src++; count++; } -@@ -1749,7 +1755,13 @@ void mutt_FormatString (char *dest, /* output buffer +@@ -1756,7 +1762,13 @@ void mutt_FormatString (char *dest, /* output buffer count = 0; while (count < sizeof (elsestring) && *src && *src != '?') { - *cp++ = *src++; + if (*src == '\\') + { + src++; + if (!*src) + break; + } + *cp++ = *src++; count++; } *cp = 0;