Re: Using UTC time in Date header

2021-05-16 Thread Joerg Dorchain
On Sun, May 16, 2021 at 10:32:33AM +1000, raf wrote:
> 
> When my workplace switched to office365 (all but me anyway),
> their emails started arriving with UTC date headers. So I
> wrote a procmail recipe to filter incoming emails through
> a little perl script to convert the date header to my timezone.
> it's attached. the local timezone is hardcoded (sorry) but
> can be changed as needed.

Something similiar, just with procmail/formail:
You need Gnu date for this, sorry non-Posix features used.

{
#time in seconds since the epoch (to be rethought before Jan 19 2038 03:14:08)
:0 hi
* ^Date:[   ]*(...?, )?\/[^,]*$
# this blank contains a space and a tab, and yes, there are 
strange date: header out there
DATE=| date -d "$MATCH" +%s

# catch unparsable/missing dates
:0 hi
* DATE ?? ^$
DATE=| echo "0"

:0 fwhi
| formail -i "Date: `TZ=America/Los_Angeles date -d @$DATE -R`"
}

Just leave out TZ= to get your default timezone

HTH,

Joerg


signature.asc
Description: PGP signature


Re: Using UTC time in Date header

2021-05-15 Thread raf
On Fri, May 14, 2021 at 09:43:21PM -0400, John Hawkinson  
wrote:

> For what it's worth, I have a desire for the opposite kind of feature,
> although I don't quite know how it should work.
> I want to see and use timezones as displayed in messages as long as
> they are nearby US timezones that my brain is facile with the trivial
> arithmetic for (i.e. US/Eastern, US/Central, US/Pacific, and I suppose
> the rare US/Mountain).
> 
> But when a header comes in UTC, I'd much rather convert it to local
> time, especially so I don't have to think about how DST affects the
> offset.
> [...]
> --
> jh...@alum.mit.edu
> John Hawkinson

When my workplace switched to office365 (all but me anyway),
their emails started arriving with UTC date headers. So I
wrote a procmail recipe to filter incoming emails through
a little perl script to convert the date header to my timezone.
it's attached. the local timezone is hardcoded (sorry) but
can be changed as needed.

cheers,
raf

#!/usr/bin/env perl
use warnings;
use strict;

# procmail_filter_fix_outlook_date_header.pl
# 
# This is an email filter to be run by procmail as email arrives.
# It replaces UTC Date: headers in incoming email with the local timezone.
# Outlook/Exchange refuses to use the sender's local timezone in Date: headers.
# This can't recover the lost information about the true timezone of the
# sender, but at least you won't need to perform timezone calculations in
# your head when reading emails from your own work colleagues.
#
# usage (in ~/.procmailrc):
#
# :0 fw
# * ^From:.*@(domain_that_uses_exchange\.com|and_another\.com)
# | procmail_filter_fix_outlook_date_header.pl
#
# WARNING: This is hard-coded to convert UTC to Australia/Sydney
# and needs to be modified if you are in a different timezone.
#
# 20200205 raf 

# Update these suit your local timezone.

my $local_tz = 'Australia/Sydney'; # Or `cat /etc/timezone` if present ($TZ didn't work for me)
my @local_offsets_by_dst = ('+1000', '+1100'); # How to get these programmatically?

use POSIX;

my %month_name2num = (Jan => 0, Feb => 1, Mar => 2, Apr => 3, May => 4, Jun => 5, Jul => 6, Aug => 7, Sep => 8, Oct => 9, Nov => 10, Dec => 11);
my %month_num2name = (0 => 'Jan', 1 => 'Feb', 2 => 'Mar', 3 => 'Apr', 4 => 'May', 5 => 'Jun', 6 => 'Jul', 7 => 'Aug', 8 => 'Sep', 9 => 'Oct', 10 => 'Nov', 11 => 'Dec');
my %day_num2name = (0 => 'Sun', 1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri', 6 => 'Sat');

while (<>)
{
	# Date: Tue, 4 Feb 2020 22:41:34 +
	my ($day, $month, $year, $hour, $minute, $second, $eol) = /^Date: (?:Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s+(\d{1,2})\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d{4})\s+(\d{1,2}):(\d{2}):(\d{2}) \+(?:\s+\([A-Z]+\))?(\s*)$/;
	if (defined $day && defined $month && defined $year && defined $hour && defined $minute && defined $second)
	{
		print('X-Original-' . $_);
		local($ENV{TZ}) = 'UTC';
		my $t = mktime $second, $minute, $hour, $day, $month_name2num{$month}, $year - 1900;
		$ENV{TZ} = $local_tz;
		my ($sec, $min, $hr, $d, $m, $y, $wday, $yday, $isdst) = localtime($t);
		$_ = sprintf('Date: %s, %d %s %d %02d:%02d:%02d %s%s',
			$day_num2name{$wday}, $d, $month_num2name{$m}, @{[$y + 1900]},
			$hr, $min, $sec, $local_offsets_by_dst[$isdst], $eol);
	}
	print;
}

# vi:set ts=4 sw=4:


Re: Using UTC time in Date header

2021-05-14 Thread Gregory Anders

On Fri, 14 May 2021 19:57 -0600, Gregory Anders wrote:
For example, I am one of those (rare) US/Mountain time zones, so I know 
I just need to subtract 6 from any UTC time to get my local time (7 
during DST).


Of course I got these backwards: it's 6 during DST and 7 otherwise. 
Maybe I just invalidated my own point about how easy this actually is :)


Re: Using UTC time in Date header

2021-05-14 Thread Gregory Anders
I don't mean to invalidate your opinion, but I don't think using UTC 
universally is actually all that bad. Each individual person just needs 
to know their own personal UTC offset and then it's trivial to adjust. 
In my opinion, when everyone uses their own local time zone it actually 
makes things more difficult, since instead of applying a constant offset 
I have to also adjust their time zone to UTC and then convert from UTC 
to my time zone.


For example, I am one of those (rare) US/Mountain time zones, so I know 
I just need to subtract 6 from any UTC time to get my local time (7 
during DST).


Of course, what's "easy" is totally subjective. That's just my 2 cents.

I suppose if mutt were extensible in lua or lisp or whatever, I could 
easily write my own function that handled the US timezones differently 
from other ones, and that would solve most of my problems.


Have you looked into MuttLisp [1] at all? I haven't, so I'm not sure if 
it's capable of solving your issue, but it might be worth a look.


Greg

[1]: http://www.mutt.org/doc/manual/#muttlisp


Re: Using UTC time in Date header

2021-05-14 Thread John Hawkinson
Gregory Anders  wrote on Fri, 14 May 2021
at 21:57:04 EDT in :

> I don't mean to invalidate your opinion, but I don't think using UTC
> universally is actually all that bad. Each individual person just needs to

That may be nice for you, but most of the non-software-engineering normal 
humans I exchange email with are not capable of doing any timeone math 
whatsoever, much less the next zone over. UTC is right out. This is especially 
the case for those who tend to use Exchange, which curiously offers these UTC 
defaults, I guess on the assumption that everyone's mail clients will convert 
everything to local time.

To put it different, it's not so much that I don't want to the timezone math 
(although I don't really), it's that I am confident that the people I deal with 
do not.

I'm sure your experience may be different, but those are my requirements.

--
jh...@alum.mit.edu
John Hawkinson



Re: Using UTC time in Date header

2021-05-14 Thread John Hawkinson
For what it's worth, I have a desire for the opposite kind of feature, although 
I don't quite know how it should work.
I want to see and use timezones as displayed in messages as long as they are 
nearby US timezones that my brain is facile with the trivial arithmetic for 
(i.e. US/Eastern, US/Central, US/Pacific, and I suppose the rare US/Mountain).

But when a header comes in UTC, I'd much rather convert it to local time, 
especially so I don't have to think about how DST affects the offset.

But also this is an issue for attributions. When I reply to someone, I want the 
attribution to properly reflect the time in a zone they understand, because I 
assume other humans can't easily do timezone math. As long as their client used 
their local zone, this works great.

But more and more Exchange/Outlook/whatever are using UTC, and that means the 
times in attributions echoed back to them are too hard.

A while back I gave up and converted from %{%a, %e %b %Y} to %[%a, %e %b %Y].

I don't love this, but it seems to work better.

I don't really know what to suggest, though. It's hard to think of a good 
heuristic that would be worth coding up in C.

I suppose if mutt were extensible in lua or lisp or whatever, I could easily 
write my own function that handled the US timezones differently from other 
ones, and that would solve most of my problems.


Anyhow, this email isn't really intended to be actionable in any way, but I 
thought it was worth talking about the problem, perhaps as a way to inform...I 
don't know what, perhaps future development, but probably not.

Thanks for listening.

--
jh...@alum.mit.edu
John Hawkinson


Re: Using UTC time in Date header

2021-05-14 Thread Gregory Anders

On Sat, 15 May 2021 11:07 +1000, raf wrote:

just create a shell function like this:

 mutt() { TZ=UTC /usr/bin/mutt "$@"; }



I did discover this after asking my question, and it's an okay solution, 
but it has the side effect of changing timezones *everywhere* in Mutt, 
not just in the date header. So, for example, showing mail arrival times 
in my local timezone no longer works.


I sent a patch [1] to add a new 'local_date_header' option (enabled by 
default) that should enable this behavior, for anyone else who may be 
interested.


Thanks,

Greg

[1]: 
https://lists.sr.ht/~kevin8t8/mutt-dev/%3C20210515005500.76492-1-greg%40gpanders.com%3E


Re: Using UTC time in Date header

2021-05-14 Thread raf
On Fri, May 14, 2021 at 02:22:43PM -0600, Gregory Anders  
wrote:

> Hi all,
> 
> The Date: header that Mutt adds to my sent emails includes my time zone
> offset. I would prefer to have the header present the time of my email in
> UTC time (offset 0). I wasn't able to find a setting that controls this. In
> fact, I'm not sure how Mutt is getting my time zone at all, since I'm quite
> sure I haven't set it anywhere in my configuration.
> 
> Is this possible to do? If not I may take a stab at creating a patch.
> 
> Thanks,
> Greg

hi,

your default timezone would probably have been selected
when your operating system was installed. but it can be
overridden easily.

just create a shell function like this:

  mutt() { TZ=UTC /usr/bin/mutt "$@"; }

and put it in a shell startup file.

cheers,
raf



Using UTC time in Date header

2021-05-14 Thread Gregory Anders

Hi all,

The Date: header that Mutt adds to my sent emails includes my time zone 
offset. I would prefer to have the header present the time of my email 
in UTC time (offset 0). I wasn't able to find a setting that controls 
this. In fact, I'm not sure how Mutt is getting my time zone at all, 
since I'm quite sure I haven't set it anywhere in my configuration.


Is this possible to do? If not I may take a stab at creating a patch.

Thanks,

Greg


Re: Index screen - could it feature time segments?

2020-08-04 Thread Derek Martin
On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho Kraav wrote:
> One of the replies mentioned something about "tasteful" or similar. For
> me, mail is not a fashion statement, it needs to get work done, so not
> giving that taste argument much weight.
> [...]
> Other than that, haven't seen a any legit alternatives or arguments to
> convert this want into "OK I really don't need it after all".

A legit alternative... I mean, the index view has the date, which can
be formatted pretty flexibly, and sorted on.  If you want to know what
e-mails you received in the last two days, sort by newest first, and
then you just need to know what day it is, and have sufficient working
knowledge of how dates work to know what the day before today is...

Basically the same thing for 30 days, but as a rough equivalent, stop
scrolling when you get to the same date last month, i.e. if today is
July 1, then stop at June 1.

If for some reason that is not enough for you, you can use Mutt's
search or limit feature to only show you messages that are less than
2/30/however many days old.  I forget exactly how it works because
I've never found the feature useful, but I know it's there...

And that is why I said having a visual divider is a distasteful waste
of space.  It has nothing to do with fashion--it has everything to do
with efficient function.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-04 Thread Leho Kraav
On Mon, Aug 03, 2020 at 09:45:38PM +, Job Snijders wrote:
> On Sun, Aug 02, 2020 at 03:40:36PM +0300, Leho Kraav wrote:
> > On Sun, Aug 02, 2020 at 02:28:10PM +0200, Matthias Apitz wrote:
> > > 
> > > Ah, now I understand your intention better. I though you want to draw a
> > > horizontal line between the times of Today, Yesterday, Last Week, 2
> > > weeks ago etc. like M$ OutLook it does. What you want to have, is an
> > > additional column with some time indicator. Correct? 
> > 
> > Horizontal display-only lines are the goal.
> > 
> > See right edge of this screenshot:
> > https://lh3.googleusercontent.com/proxy/cVzlSH2JCHNJAM32g8NmKOISjkIPBCne27JLtzJd_fvRdV6dPu9S6IpPSiGFdoBgomT2HlybTi7RbxipyI3-jGn58jsvUDvcyA6xiWy-zUt3KglrjijxPsPUjqRIJw
> 
> the URL seems to give an error 'forbidden'
> 
> I'd be curious to see a mock-up of what you meant!

Oops!

See 
https://www.ghacks.net/2008/02/15/group-mails-in-thunderbird-chronologically/

"Chronological grouping" is the term I was looking for.

-- 
Leho Kraav, senior technology & digital marketing architect


Re: Index screen - could it feature time segments?

2020-08-03 Thread Will Yardley
On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho Kraav wrote:
> On Mon, Aug 03, 2020 at 05:08:25PM -0400, Josef 'Jeff' Sipek wrote:

> > Alternatively, if you are accessing the mailboxes via IMAP, the server
> > software may have a fancier mechanism.  For example, Dovecot has virtual
> > folders.
> 
> I'm on Dovecot, and am already taking full advantage of virtual folders.
> 
> My virtual inbox is actually a "last 2 days" view, but I would *still*
> like to have a segmentation "Today", "Yesterday", etc within this mail index 
> screen.

Mutt also has the limit feature.

I know you're not interested in more comments from people saying that
this is not a feature they want to see in Mutt, but I think that what
you're asking for really isn't something that makes a lot of sense for
Mutt or how most Mutt users work.

w



Re: Index screen - could it feature time segments?

2020-08-03 Thread Kevin J. McCarthy

On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho Kraav wrote:
My virtual inbox is actually a "last 2 days" view, but I would *still* 
like to have a segmentation "Today", "Yesterday", etc within this mail 
index screen.


I also have a "last 30 days" folder, where segmentation would be even 
more useful.


Other folks in the thread have had good suggestions, but I'll also throw 
out index-format-hook to add labels to the message based on age.  That 
at least might make it more obvious where the age-range groups span.


You could also use macros to switch to different limits, or (with more 
work) rotate among a few date-range limit-views.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-03 Thread Felix Finch

On 20200803, Remco Rijnders wrote:

Note that I am not passing judgement on your need for this
functionality, but if it is an absolute requirement/deal breaker for
you, then mutt might not be the tool to use here.


I haven't been following this very deeply, but have two ideas.

One: My $date_format is "%Y%m%d" and I put that in the $index_format as "%d".  
It's easy enough to see where the date changes.

Two: Fake it with a cron job which throws in dummy messages for the dates 
desired, with fake headers to show dashes:

 From: 
 Subject: -

The cron job would fire off at midnight and either delete the old dummies and 
create new ones, or adjust the existing dummies in place.

Both of these assume the sort order is by date.

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / fe...@crowfix.com
 GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: Index screen - could it feature time segments?

2020-08-03 Thread Remco Rijnders
On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho wrote in 
<20200803212601.GB6143@papaya>:

Alternatively, if you are accessing the mailboxes via IMAP, the server
software may have a fancier mechanism.  For example, Dovecot has virtual
folders.


I'm on Dovecot, and am already taking full advantage of virtual folders.

My virtual inbox is actually a "last 2 days" view, but I would *still*
like to have a segmentation "Today", "Yesterday", etc within this mail index 
screen.

I also have a "last 30 days" folder, where segmentation would be even more 
useful.

One of the replies mentioned something about "tasteful" or similar. For
me, mail is not a fashion statement, it needs to get work done, so not
giving that taste argument much weight.

Thus far, it seems like it's simply a technically difficult goal.

Other than that, haven't seen a any legit alternatives or arguments to
convert this want into "OK I really don't need it after all".


I think the dovecot alternative you use now, and/or using a tool like
mairix (which I never used, but it seems you can use it to create time
based virtual mailboxes) is as good as you are going to get it with
mutt. Mutt displays messages per mailbox, filtered if you want, and
sorted as you want, but always one message per line. As far as I know
there is no way to get any sort of grouping based on message age that
you want in a single view, let alone provide a way to collapse/expand
such groupings.

Note that I am not passing judgement on your need for this
functionality, but if it is an absolute requirement/deal breaker for
you, then mutt might not be the tool to use here.

I hope that with the suggestions you've been given you can find
something that will "kind of" work for you, as I'm out of ideas
otherwise.

Kind regards,

Remco


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-03 Thread Leho Kraav
On Mon, Aug 03, 2020 at 05:08:25PM -0400, Josef 'Jeff' Sipek wrote:
> On Mon, Aug 03, 2020 at 16:23:03 -0400, Logan Rathbone wrote:
> ...
> > Another way of potentially achieving this may be to think outside the 
> > box -- or outside the index, in this case.
> > 
> > Why not set up the MTA to deliver mail into a mailbox called "Today" and 
> > set up a daily cronjob to do further sorting of the mail into different 
> > mailboxes by date?  This won't allow for separators in the index view, 
> > but will allow OP to view these groups of dates in the mailbox view.
> 
> Alternatively, if you are accessing the mailboxes via IMAP, the server
> software may have a fancier mechanism.  For example, Dovecot has virtual
> folders.

I'm on Dovecot, and am already taking full advantage of virtual folders.

My virtual inbox is actually a "last 2 days" view, but I would *still*
like to have a segmentation "Today", "Yesterday", etc within this mail index 
screen.

I also have a "last 30 days" folder, where segmentation would be even more 
useful.

One of the replies mentioned something about "tasteful" or similar. For
me, mail is not a fashion statement, it needs to get work done, so not
giving that taste argument much weight.

Thus far, it seems like it's simply a technically difficult goal.

Other than that, haven't seen a any legit alternatives or arguments to
convert this want into "OK I really don't need it after all".


Re: Index screen - could it feature time segments?

2020-08-03 Thread Josef 'Jeff' Sipek
On Mon, Aug 03, 2020 at 16:23:03 -0400, Logan Rathbone wrote:
...
> Another way of potentially achieving this may be to think outside the 
> box -- or outside the index, in this case.
> 
> Why not set up the MTA to deliver mail into a mailbox called "Today" and 
> set up a daily cronjob to do further sorting of the mail into different 
> mailboxes by date?  This won't allow for separators in the index view, 
> but will allow OP to view these groups of dates in the mailbox view.

Alternatively, if you are accessing the mailboxes via IMAP, the server
software may have a fancier mechanism.  For example, Dovecot has virtual
folders.

Jeff.

-- 
Evolution, n.:
  A hypothetical process whereby infinitely improbable events occur with
  alarming frequency, order arises from chaos, and no one is given credit.


Re: Index screen - could it feature time segments?

2020-08-03 Thread Logan Rathbone

On Sun, Aug 02, 2020 at 06:24:24AM -0400, Remco Rijnders wrote:
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho wrote in 
<173ae7cb050.2742.b94389c50b70d4ef8bda8663b7428...@kraav.com>:
Hi. I'm looking for a way to get mutt index to segment list display 
with Today, Yesterday, Last Week, 2 weeks ago etc separators.


Feels like it should be technically possible, but I haven't been 
able to find a configuration or a patch for this.


I don't think this is possible "out of the box", as you are limited by
what options $index_format [1] offers, which in turn uses $date_format
[2], which in turn uses the functionality offered by the systems
strftime(3) function. That said, you could use a script as a filter
which provide such functionality [3] by passing it the timestamp of
the message and returning the desired string to display.

I do not know of a script that will do exactly what you want, though
they may exist. If not, you can roll your own, perhaps using some
scripting around the datediff command from the dateutils package [4]?

[snip]

1: http://www.mutt.org/doc/manual/#index-format
2: http://www.mutt.org/doc/manual/#date-format
3: http://www.mutt.org/doc/manual/#formatstrings-filters
4: https://www.fresse.org/dateutils/#datediff


I think this is a great response.  Too complicated for me to delve into, 
and I don't even want or need this functionality -- for me, I'll add it 
to the pile with "creative" features like "unified inbox" that 
contemporary mail clients are utilizing that I also have no interest in 
-- but it looks like it might be at least possible to put 
Yesterday/Today/etc. type nomenclature in the $index_format variable.


But I don't think Mutt has any concept of the type of separators in the 
index view that OP is trying to achieve and populate with these type of 
strings.


Another way of potentially achieving this may be to think outside the 
box -- or outside the index, in this case.


Why not set up the MTA to deliver mail into a mailbox called "Today" and 
set up a daily cronjob to do further sorting of the mail into different 
mailboxes by date?  This won't allow for separators in the index view, 
but will allow OP to view these groups of dates in the mailbox view.


Re: Index screen - could it feature time segments?

2020-08-03 Thread Derek Martin
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho Kraav wrote:
> Hi. I'm looking for a way to get mutt index to segment list display with
> Today, Yesterday, Last Week, 2 weeks ago etc separators.
> 
> Feels like it should be technically possible, but I haven't been able to
> find a configuration or a patch for this.
> 
> Your thoughts?

My thoughts are:

 - Blech.  This is not Outlook. I always thought it was a distasteful
   waste of space in Outlook, and it would be even more so in Mutt.
   Obviously, it's a matter of taste, which is highly individual.

 - There's no way to do this currently in Mutt.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-02 Thread Leho Kraav
On Sun, Aug 02, 2020 at 02:28:10PM +0200, Matthias Apitz wrote:
> 
> Ah, now I understand your intention better. I though you want to draw a
> horizontal line between the times of Today, Yesterday, Last Week, 2
> weeks ago etc. like M$ OutLook it does. What you want to have, is an
> additional column with some time indicator. Correct? 

Horizontal display-only lines are the goal.

See right edge of this screenshot:
https://lh3.googleusercontent.com/proxy/cVzlSH2JCHNJAM32g8NmKOISjkIPBCne27JLtzJd_fvRdV6dPu9S6IpPSiGFdoBgomT2HlybTi7RbxipyI3-jGn58jsvUDvcyA6xiWy-zUt3KglrjijxPsPUjqRIJw


Re: Index screen - could it feature time segments?

2020-08-02 Thread Remco Rijnders
On Sun, Aug 02, 2020 at 02:28:10PM +0200, Matthias wrote in 
<20200802122810.GA4666@c720-r342378>:

Ah, now I understand your intention better. I though you want to draw a
horizontal line between the times of Today, Yesterday, Last Week, 2
weeks ago etc. like M$ OutLook it does. What you want to have, is an
additional column with some time indicator. Correct?


That's how I understood it, but I guess your interpretation might be
more what Leho intended as they referred to time segments. In that
case, I don't know of any way to do that in mutt.


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-02 Thread Matthias Apitz
El día domingo, agosto 02, 2020 a las 07:57:05a. m. -0400, Remco Rijnders 
escribió:

> On Sun, Aug 02, 2020 at 11:46:43AM +0200, Matthias wrote in 
> <7f107366-0e85-4e77-819d-65e59217f...@unixarea.de>:
> >On Sunday, 2 August 2020 11:24:35 CEST, Leho Kraav  wrote:
> >>Hi. I'm looking for a way to get mutt index to segment list display 
> >>with Today, Yesterday, Last Week, 2 weeks ago etc separators.
> >...
> >In a threaded view, this would lead to the question, where an original 
> >post and its reply have to be placed if they're two weeks away from 
> >each other.
> 
> I would guess it would look something like this:
> 
> 115 r   Two weeks ago Leho Kraav  (5.4K) Index screen - could it feature 
> time segments?
> 116 Yesterday Matthias Apitz  (  25) ├─>
> 
> And it would sort internally in Mutt using the original sorting method
> set. When set using a date it would go by the real date and not the
> textual representation displayed.

Ah, now I understand your intention better. I though you want to draw a
horizontal line between the times of Today, Yesterday, Last Week, 2
weeks ago etc. like M$ OutLook it does. What you want to have, is an
additional column with some time indicator. Correct? 

matthias



-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!


Re: Index screen - could it feature time segments?

2020-08-02 Thread Remco Rijnders
On Sun, Aug 02, 2020 at 11:46:43AM +0200, Matthias wrote in 
<7f107366-0e85-4e77-819d-65e59217f...@unixarea.de>:

On Sunday, 2 August 2020 11:24:35 CEST, Leho Kraav  wrote:
Hi. I'm looking for a way to get mutt index to segment list display 
with Today, Yesterday, Last Week, 2 weeks ago etc separators.

...
In a threaded view, this would lead to the question, where an original 
post and its reply have to be placed if they're two weeks away from 
each other.


I would guess it would look something like this:

115 r   Two weeks ago Leho Kraav  (5.4K) Index screen - could it feature 
time segments?
116 Yesterday Matthias Apitz  (  25) ├─>

And it would sort internally in Mutt using the original sorting method
set. When set using a date it would go by the real date and not the
textual representation displayed.


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-02 Thread Matthias Apitz

On Sunday, 2 August 2020 11:24:35 CEST, Leho Kraav  wrote:
Hi. I'm looking for a way to get mutt index to segment list display with 
Today, Yesterday, Last Week, 2 weeks ago etc separators.


Feels like it should be technically possible, but I haven't been able to 
find a configuration or a patch for this.


Your thoughts?



In a threaded view, this would lead to the question, where an original post 
and its reply have to be placed if they're two weeks away from each other.


matthias



--
Sent from my Ubuntu phone
http://www.unixarea.de/
NO to the EU! NEIN zur EU!


Re: Index screen - could it feature time segments?

2020-08-02 Thread Remco Rijnders
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho wrote in 
<173ae7cb050.2742.b94389c50b70d4ef8bda8663b7428...@kraav.com>:
Hi. I'm looking for a way to get mutt index to segment list display 
with Today, Yesterday, Last Week, 2 weeks ago etc separators.


Feels like it should be technically possible, but I haven't been able 
to find a configuration or a patch for this.


I don't think this is possible "out of the box", as you are limited by
what options $index_format [1] offers, which in turn uses $date_format
[2], which in turn uses the functionality offered by the systems
strftime(3) function. That said, you could use a script as a filter
which provide such functionality [3] by passing it the timestamp of
the message and returning the desired string to display.

I do not know of a script that will do exactly what you want, though
they may exist. If not, you can roll your own, perhaps using some
scripting around the datediff command from the dateutils package [4]?

Hopefully this gives you some pointers to get you started.

Kind regards,

Remco
--
1: http://www.mutt.org/doc/manual/#index-format
2: http://www.mutt.org/doc/manual/#date-format
3: http://www.mutt.org/doc/manual/#formatstrings-filters
4: https://www.fresse.org/dateutils/#datediff


signature.asc
Description: PGP signature


Index screen - could it feature time segments?

2020-08-02 Thread Leho Kraav
Hi. I'm looking for a way to get mutt index to segment list display with 
Today, Yesterday, Last Week, 2 weeks ago etc separators.


Feels like it should be technically possible, but I haven't been able to 
find a configuration or a patch for this.


Your thoughts?




Re: Using UTC as time zone in outgoing email headers

2019-07-24 Thread Paul Gilmartin
On 2019-07-24, at 12:31:23, Derek Martin wrote:
> 
> On Wed, Jul 24, 2019 at 07:06:52AM +, Ryan Smith wrote:
>> By default, mutt uses local or computer time zone in outgoing email full 
>> header, Date section.
>> 
>> How to force mutt to use UTC as time zone in all outgoing email headers?
> 
> For what it's worth, this is probably mostly pointless.  There's a
> very good chance the remote end will use the user's local time zone to
> display the date regardless of what you do on your end. As long as the
> time that's sent is accurate, the user will see something sensible
> when they view your message, and you largely can't control what that is.
> That said, it can be done...
>  
What's particularly irritating is that in text quoted in replies,
most mailers show that "local time" with no indication of time zone,
making it hard to follow the chronology of a thread.

> Set your TZ environment variable to UTC.  If you don't want all of
> your programs to use UTC, but only Mutt, there are a few ways you
> could accomplish this.
> 
> 1. On the command line, when you start mutt:
> 
>  $ TZ=UTC mutt
>  
Or define an alias.

> 2. Create a shell script that sets the timezone and starts mutt:
> 
>  $ cat Mutt.sh
>  #!/bin/sh
>  export TZ=UTC
>  exec mutt
> 
>  Then use the shell script to start mutt instead of starting it
>  directly.
> 
> 3. Edit the mutt source code to set the TZ environment variable during
>   initialization (but really, don't do that)...
> 
> etc

-- gil




Re: Using UTC as time zone in outgoing email headers

2019-07-24 Thread Derek Martin
On Wed, Jul 24, 2019 at 07:06:52AM +, Ryan Smith wrote:
> By default, mutt uses local or computer time zone in outgoing email full 
> header, Date section.
> 
> How to force mutt to use UTC as time zone in all outgoing email headers?

For what it's worth, this is probably mostly pointless.  There's a
very good chance the remote end will use the user's local time zone to
display the date regardless of what you do on your end. As long as the
time that's sent is accurate, the user will see something sensible
when they view your message, and you largely can't control what that is.
That said, it can be done...

Set your TZ environment variable to UTC.  If you don't want all of
your programs to use UTC, but only Mutt, there are a few ways you
could accomplish this.

1. On the command line, when you start mutt:

  $ TZ=UTC mutt

2. Create a shell script that sets the timezone and starts mutt:

  $ cat Mutt.sh
  #!/bin/sh
  export TZ=UTC
  exec mutt

  Then use the shell script to start mutt instead of starting it
  directly.

3. Edit the mutt source code to set the TZ environment variable during
   initialization (but really, don't do that)...

etc

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpwxYPv1RFeE.pgp
Description: PGP signature


Re: Using UTC as time zone in outgoing email headers

2019-07-24 Thread John Long
Hi, I don't know the answer because I set all my devices to UTC.

But I can suggest it's difficult to find all the places where your time
zone is leaked so setting it to UTC or some misc. time zone is probably
not a bad idea.

/jl

On Wed, 24 Jul 2019 07:06:52 +
Ryan Smith  wrote:

> By default, mutt uses local or computer time zone in outgoing email
> full header, Date section.
> 
> How to force mutt to use UTC as time zone in all outgoing email
> headers?
> 
> set_hdr Date=?
> 
> K9 Mail in Android has such option in privacy settings Hide Timezone,
> use UTC instead of local time zone. Ryan



Using UTC as time zone in outgoing email headers

2019-07-24 Thread Ryan Smith
By default, mutt uses local or computer time zone in outgoing email full 
header, Date section.

How to force mutt to use UTC as time zone in all outgoing email headers?

set_hdr Date=?

K9 Mail in Android has such option in privacy settings Hide Timezone, use UTC 
instead of local time zone.
Ryan

Re: Can I use the OP's time zone in the time given on the $attribution line in a reply?

2017-01-19 Thread Ken Moffat
On Thu, Jan 19, 2017 at 09:35:37PM +, Alan Mackenzie wrote:
> Hello, mutt.
> 
> I'm using mutt version 1.5.24.
> 
> Suppose someone has sent me an email with this Date: header:
> 
> Date: Thu, 19 Jan 2017 12:00:49 +0100
> 
> .  When I reply, with g or r, the following attribution line heads my
> reply:
> 
>  On Thu, Jan 19, 2017 at 11:00:49 UTC, Joe Bloggs wrote:
> 

Hi Alan,

I made this reply with 'g' (normally I would only reply to the list
because a lot of people here get pissed off if they get two copies
when I reply), but we are both on UTC +0 (you are probably in UTC,
I'm in British non-summer time) so it doesn't actually prove
anything.

> .  Note that this has converted his sending time to my time zone.  This
> seems to me somewhat discourteous.  Is there any way I can configure my
> mutt (something in the $attribution value, perhaps?) so that the
> attribution line would come out as:
> 
> On Thu, Jan 19, 2017 at 12:00:49 +0100, Joe Bloggs wrote:
> 
> , i.e. retaining the OP's time zone as specified in his Date: header?
> 

I took a look at my .muttrc, but I don't have ANY setting for
attribution, so I assume I'm using the default value - and my last
reply to a list quoted the sender's time (he was in -0500)
correctly.

This is with 1.7.2, but I'm sure the behaviour was the same in the
1.5 versions I used.  So all I can suggest is that you maybe already
set something in $attribution.  Sorry if that doesn't help.

ĸen
-- 
`I shall take my mountains', said Lu-Tze. `The climate will be good
for them.' -- Small Gods


Re: Can I use the OP's time zone in the time given on the $attribution line in a reply?

2017-01-19 Thread Mihai Lazarescu

On Thu, Jan 19, 2017 at 09:35:37PM +, Alan Mackenzie wrote:


 Hello, mutt.

 I'm using mutt version 1.5.24.

 Suppose someone has sent me an email with this Date: header:

 Date: Thu, 19 Jan 2017 12:00:49 +0100

 .  When I reply, with g or r, the following attribution line heads my
 reply:

  On Thu, Jan 19, 2017 at 11:00:49 UTC, Joe Bloggs wrote:

 .  Note that this has converted his sending time to my time zone.  This
 seems to me somewhat discourteous.  Is there any way I can configure my
 mutt (something in the $attribution value, perhaps?) so that the
 attribution line would come out as:

 On Thu, Jan 19, 2017 at 12:00:49 +0100, Joe Bloggs wrote:

 , i.e. retaining the OP's time zone as specified in his Date: header?


I guess that if you update mutt you may get the desired behavior, 
as you can see above.


I use v1.7.1 with attribution = "On %d, %n wrote:\n"

Best,
Mihai


Can I use the OP's time zone in the time given on the $attribution line in a reply?

2017-01-19 Thread Alan Mackenzie
Hello, mutt.

I'm using mutt version 1.5.24.

Suppose someone has sent me an email with this Date: header:

Date: Thu, 19 Jan 2017 12:00:49 +0100

.  When I reply, with g or r, the following attribution line heads my
reply:

 On Thu, Jan 19, 2017 at 11:00:49 UTC, Joe Bloggs wrote:

.  Note that this has converted his sending time to my time zone.  This
seems to me somewhat discourteous.  Is there any way I can configure my
mutt (something in the $attribution value, perhaps?) so that the
attribution line would come out as:

On Thu, Jan 19, 2017 at 12:00:49 +0100, Joe Bloggs wrote:

, i.e. retaining the OP's time zone as specified in his Date: header?

-- 
Alan Mackenzie (Nuremberg, Germany).


specify time at which mutt sends a precomposed mail?

2016-02-03 Thread Peter P.
I am wondering if there is any way during message composition in mutt to
specify at which time (eg. 3pm, 10mins later,...) at which an email will
actually be sent by mutt to the sendmail command? I would like to
draft emails but have them sent out at a later time automatically.

Thanks for all ideas!
Peter


Re: specify time at which mutt sends a precomposed mail?

2016-02-03 Thread Michelle Konzack
Hello Peter,

On 2016-02-03 11:52:22 Peter P. hacked into the keyboard:
> I am wondering if there is any way during message composition in mutt to
> specify at which time (eg. 3pm, 10mins later,...) at which an email will
> actually be sent by mutt to the sendmail command? I would like to
> draft emails but have them sent out at a later time automatically.

I hade the need for such function many years ago...

I have installed a cron job which check  all  5 mins  a  maildir  folder
"~/Maildir/.Send_delayed/" and then send the mail according to a special
header "X-Send-delayed:" and  after  success,  the  mails  is  moved  to
"~/Maildir/.Send/".

It is easy to do and work with Maildir on a file system direct, however,
I use it also on my Courier IMAP server

> Thanks for all ideas!
> Peter

Have a nice day

-- 
Michelle KonzackITSystems
GNU/Linux Developer 0033-6-61925193


Re: specify time at which mutt sends a precomposed mail?

2016-02-03 Thread hymie
Mutt is not a daemon.  You will probably need to use "at".

(This is not tested, but it's taken from another command that I use.)

at 15:00
> mutt -x -s subject re...@fq.dn http://lactose.homelinux.net/~hymiehy...@lactose.homelinux.net

"Peter P." writes:
>I am wondering if there is any way during message composition in mutt to
>specify at which time (eg. 3pm, 10mins later,...) at which an email will
>actually be sent by mutt to the sendmail command? I would like to
>draft emails but have them sent out at a later time automatically.
>
>Thanks for all ideas!
>Peter


Re: Set time zone from folder-hook?

2014-12-24 Thread Ed Blackman

On Fri, Dec 19, 2014 at 08:59:01AM +1100, Cameron Simpson wrote:

On 18Dec2014 16:50, Bernard Massot bmas...@free.fr wrote:

Dates in the index are built following the index_format variable. For
this purpose, index_format uses the strftime function's string
expansion mechanism, which doesn't provide means to show time as UTC.
However the date program can build UTC dates, and mutt can use
external programs to build configuration variables.

[...]
_If_ you went that way (for the index performance; as Bernard points 
out his approach invokes an outside script for every index line - 
though probably only for every _displayed_ index line, not the whole 
mail folder at once),


I use an external script to set index_format.  My script varies the time 
display based on how old the message is: messages in the last 24 hours 
display the detailed time (eg, '6:41pm'), messages in the last week show 
weekday and abbreviated time (eg, 'Thu 6pm'), and so on.


I don't need to invoke date, as everything I want to do can be 
accomplished with shell-internal math, but it's still running my script 
for every displayed index line.


I can't visually tell the difference between turning the external script 
invocation off (aside from the loss of my variable time format) or 
keeping it on.  This is on Linux on a ~7 year old system, no brand new 
speed daemon.  So the OP might want to try it.


Note that Windows is reportedly much slower to create processes than 
Linux and probably OSX, so Windows users of mutt might see a slowdown 
using an external script where the same muttrc under Linux on the same 
machine might not, but modern systems are so ridiculously fast that it's 
worth a try anyway.


--
Ed Blackman


Re: Set time zone from folder-hook?

2014-12-18 Thread Bernard Massot
Hi Joachim,

On Thu, Dec 11, 2014 at 04:44:12PM +0100, Joachim Saul wrote:
 in one particular folder I collect messages for which I would like
 to display the date in the index as UTC. In all other folders I
 want to keep my local time zone.
Dates in the index are built following the index_format variable. For
this purpose, index_format uses the strftime function's string
expansion mechanism, which doesn't provide means to show time as UTC.
However the date program can build UTC dates, and mutt can use
external programs to build configuration variables.

Let's say you want to use the default index_format, except that you want
to display hour and minute as well, in local time by default, and in
UTC for the foobar folder.

First write a one-line shell script that displays a date given as
parameter in the UTC (and make it executable). For example
~/.mutt/index_utc.sh :

#!/bin/bash
echo %4C %Z $(date --utc --date $1 '+%b %d %H:%M') %-15.15L (%?l?%4l%4c?) 
%s%


Then, in ~/.muttrc, you create a default folder hook and a specific
folder hook for foobar box :

folder-hook . set index_format=\%4C %Z %[%b %d %H:%M] %-15.15L (%?l?%4l%4c?) 
%s\
folder-hook =foobar set index_format = \$HOME/.mutt/index_utc.sh '%[%Y-%m-%d 
%H:%M %Z]'|\


The pipe symbol at the end of the content of the index_format variable
tells mutt to build it using the output of the given command. Percentage
expansion is done before calling the command. If the output of the
command ends with %, percentage expansion is done again by mutt on the
output. This is explained in chapter 30.3 (Filters) of the official doc.

I tested this setup and it worked. It may be slow with huge boxes since
the script, and the date program, are called for each message.
-- 
Bernard Massot


Re: Set time zone from folder-hook?

2014-12-18 Thread Cameron Simpson

On 18Dec2014 16:50, Bernard Massot bmas...@free.fr wrote:

On Thu, Dec 11, 2014 at 04:44:12PM +0100, Joachim Saul wrote:

in one particular folder I collect messages for which I would like
to display the date in the index as UTC. In all other folders I
want to keep my local time zone.

Dates in the index are built following the index_format variable. For
this purpose, index_format uses the strftime function's string
expansion mechanism, which doesn't provide means to show time as UTC.
However the date program can build UTC dates, and mutt can use
external programs to build configuration variables.

[... skip Bernard's shell escape solution ...]

strftime can be told to work entirely in UTC, though, but it requires setting 
the environment variables that indicate your timezone.


Since mutt itself provides no direct mechanism to do that, you can't do it in a 
folder-hook as such. However, you can do it in a wrapper script which tweaks 
things and then invokes mutt.


As it happens I pretty much never switch folders within mutt; I always fire up 
mutt form the shell via a wrapper script (named +, so + mutt for example).  
This means I could set my timezone to UTC in the wrapper script for specific 
folders. Note that a sifde effect of that would be that _all_ programs invoked 
from within that mutt instance would work in UTC by default. Not necessarily 
what you want; your call there.


_If_ you went that way (for the index performance; as Bernard points out his 
approach invokes an outside script for every index line - though probably only 
for every _displayed_ index line, not the whole mail folder at once), _and_ you 
wanted to keep your stay in mutt and switch folders there current practice, 
it would be possible to write a macro setting 'c' (change-folder?) to 
something that ran a submutt as a command and end exited the current one, 
allowing you to use a wrapper script for the switch.


Just a thought.

Cheers,
Cameron Simpson c...@zip.com.au

quantum-dot anti-counterfeiting
- overhead by WIRED at the Intelligent Printing conference Oct2006


Set time zone from folder-hook?

2014-12-11 Thread Joachim Saul
Hi,

in one particular folder I collect messages for which I would like
to display the date in the index as UTC. In all other folders I
want to keep my local time zone.

Of course I can set the time zone to UTC globally by using the TZ
environment variable. But I would like to restrict that setting to
a particular folder, thus ideally by using a folder-hook.

Any idea how that might be achieved?

Cheers
Joachim


Re: SMTP one more time, with all the details

2014-11-08 Thread DaleKelly

On 11/08/2014 01:12 AM, John Niendorf wrote:

Dale,

What happens when you put this in your .muttrc file?

set smtp_url=smtps://your_email_addr...@email.server.com/465
set smtp_pass=your_password


same error, but thanks a lot

also tried adding
set smtp_authenticators=digest-md5:cram-md5
then
set smtp_authenticators=cram-md5
same error

--
(my whereabouts below)
http://www.dalekelly.org/


Re: SMTP one more time, with all the details

2014-11-08 Thread John Niendorf

Dale,

I'm curious, what email provider are you using? 
--

John


Re: SMTP one more time, with all the details

2014-11-08 Thread DaleKelly

On 11/08/2014 12:48 PM, John Niendorf wrote:

Dale,

I'm curious, what email provider are you using?


godaddy.com

same as my website

Thunderbird works with it

--
(my whereabouts below)
http://www.dalekelly.org/


SMTP one more time, with all the details

2014-11-07 Thread DaleKelly

(my ~/.muttrc is below)

I am compiling from source (1.5.1.23)
got the message on the dev list that SSLv3 had a security issue
don't know if a previous version has SMTP

I added --config-pop --config-smtp --with-ssl --with-sasl
to the ./comfigure command
then sudo make clean
then sudo make
then sudo make install

when I run

echo Test | mutt -s Hello d...@dalekelly.org

I get

TLSv1 connection using TLSv1/SSLv3 (DHE-RSA-AES256-SHA)
SMTP session failed: 530 authentication required
Could not send the message.

I get no prompt for username and password

I added only one change to the sample.muttrc
and saved it to ~/.muttrc
set smtp_url=smtps://smtpout.secureserver.net:465

I don't get a prompt for username or password
when I add
set stmp_user=
set smtp_pass=
it doesn't do anything different

if I do mutt -v I get

Mutt 1.5.23 (2014-03-12)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 3.13.0-39-generic (i686)
ncurses: ncurses 5.9.20140118 (compiled with 5.9)

Compiler:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs 
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.8 --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib 
--enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--enable-gnu-unique-object --disable-libmudflap --enable-plugin 
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk 
--enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre 
--enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 
--with-arch-directory=i386 
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc 
--enable-targets=all --enable-multiarch --disable-werror 
--with-arch-32=i686 --with-multilib-list=m32,m64,mx32 
--with-tune=generic --enable-checking=release --build=i686-linux-gnu 
--host=i686-linux-gnu --target=i686-linux-gnu

Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

Configure options: '--enable-pop' '--enable-smtp' '--with-ssl' '--with-sasl'

Compilation CFLAGS: -Wall -pedantic -Wno-long-long -g -O2

Compile options:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  +USE_FCNTL 
-USE_FLOCK

+USE_POP  -USE_IMAP  +USE_SMTP
+USE_SSL_OPENSSL  -USE_SSL_GNUTLS  +USE_SASL  -USE_GSS  +HAVE_GETADDRINFO
+HAVE_REGCOMP  -USE_GNU_REGEX
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME 
-CRYPT_BACKEND_GPGME

-EXACT_ADDRESS  -SUN_ATTACHMENT
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET 
+HAVE_LANGINFO_YESEXPR

+HAVE_ICONV  -ICONV_NONTRANS  -HAVE_LIBIDN  +HAVE_GETSID  -USE_HCACHE
-ISPELL
SENDMAIL=/usr/sbin/sendmail
MAILPATH=/var/mail
PKGDATADIR=/usr/local/share/mutt
SYSCONFDIR=/usr/local/etc
EXECSHELL=/bin/sh
-MIXMASTER
To contact the developers, please mail to mutt-...@mutt.org.
To report a bug, please visit http://bugs.mutt.org/.

HERE IS MY ~/.muttrc

# $Id$

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# ME's personal .muttrc (Mutt 0.92.5)
#
# The format of this file is one command per line.  Everything after a pound
# sign (#) is a comment, unless a backward slash (\) precedes it.  Note: In
# folder-hook and send-hook you need to account for two levels of dequoting
# (see manual).
#

# Note: $folder should be set _before_ any other path vars where `+' or `='
# is used because paths are expanded when parsed
#
#set folder=~/Mail  # where i keep my mailboxes

#set abort_unmodified=yes   # automatically abort replies if I don't
# change the message
set alias_file=~/.mail_aliases  # where I keep my aliases
#set allow_8bit # never do Q-P encoding on legal 8-bit chars
set arrow_cursor# use - instead of hiliting the whole line
#set ascii_chars# use ASCII instead of ACS chars for threads
#set askbcc
#set askcc
#set attribution=On %d, %n wrote:   # how to attribute replies
set autoedit# go to the editor right away when composing
#set auto_tag   # always operate on tagged messages
#set charset=iso-8859-1 # character set for your terminal
set noconfirmappend # don't ask me if i want to append to mailboxes
#set confirmcreate

Re: SMTP one more time, with all the details

2014-11-07 Thread David Champion
* On 07 Nov 2014, DaleKelly wrote: 
 
 I get no prompt for username and password

No, you wouldn't because nothing in your configuration indicates
definitively that you want AUTH-SMTP.

 I added only one change to the sample.muttrc
 and saved it to ~/.muttrc
 set smtp_url=smtps://smtpout.secureserver.net:465
 
 I don't get a prompt for username or password
 when I add
 set stmp_user=

You need EITHER:
  set smtp_url=smtps://usern...@smtpout.secureserver.net:465
OR:
  set smtp_user=username

I believe you'll be prompted for a password then.

-- 
David Champion • d...@bikeshed.us


Re: SMTP one more time, with all the details

2014-11-07 Thread DaleKelly

On 11/07/2014 11:28 PM, David Champion wrote:

* On 07 Nov 2014, DaleKelly wrote:


I get no prompt for username and password


No, you wouldn't because nothing in your configuration indicates
definitively that you want AUTH-SMTP.


I added only one change to the sample.muttrc
and saved it to ~/.muttrc
set smtp_url=smtps://smtpout.secureserver.net:465

I don't get a prompt for username or password
when I add
set stmp_user=


You need EITHER:
   set smtp_url=smtps://usern...@smtpout.secureserver.net:465
OR:
   set smtp_user=username

I believe you'll be prompted for a password then.



I tried smtp_user
same error
same no prompt for password
I have tried with and without 

--
(my whereabouts below)
http://www.dalekelly.org/


Re: SMTP one more time, with all the details

2014-11-07 Thread Patrick Shanahan
* DaleKelly d...@dalekelly.org [11-07-14 22:57]:
 (my ~/.muttrc is below)
 
 I am compiling from source (1.5.1.23)
 got the message on the dev list that SSLv3 had a security issue
 don't know if a previous version has SMTP
 
 I added --config-pop --config-smtp --with-ssl --with-sasl
 to the ./comfigure command
 then sudo make clean
 then sudo make
 then sudo make install

guess maybe you should try:
  make clean
  make
  sudo make install

still trying to figure why you find the need to compile rather than use
the binaries provided which usually have all the capabilites necessary.
-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
Registered Linux User #207535@ http://linuxcounter.net


Re: SMTP one more time, with all the details

2014-11-07 Thread DaleKelly

On 11/08/2014 12:15 AM, Patrick Shanahan wrote:

* DaleKelly d...@dalekelly.org [11-07-14 22:57]:

(my ~/.muttrc is below)

I am compiling from source (1.5.1.23)
got the message on the dev list that SSLv3 had a security issue
don't know if a previous version has SMTP

I added --config-pop --config-smtp --with-ssl --with-sasl
to the ./comfigure command
then sudo make clean
then sudo make
then sudo make install


guess maybe you should try:
   make clean
   make
   sudo make install


okay. that's next



still trying to figure why you find the need to compile rather than use
the binaries provided which usually have all the capabilites necessary.



I did try after I compiled, both had the same problems, I don't know how 
to remove a compiled version


for the binary in the Ubuntu repository, I just remove it with
sudo apt-get remove mutt

one thing to note is that my username is my email address, doesn't cause 
a problem in Thunderbird


but if I try it with smtp_user in my ~/.muttrc it gives my the same 
error as if no smtp_user

SMTP session failed: 530 authentication required

also tried putting my username in the smtp_url statement, same error


--
(my whereabouts below)
http://www.dalekelly.org/


Re: SMTP one more time, with all the details

2014-11-07 Thread John Niendorf

Dale,

What happens when you put this in your .muttrc file?

set smtp_url=smtps://your_email_addr...@email.server.com/465
set smtp_pass=your_password
--
John


Re: How do I set the time zone from which mutt sends email?

2014-07-11 Thread Cameron Simpson

On 10Jul2014 10:11, Mark H. Wood mw...@iupui.edu wrote:

On Wed, Jul 09, 2014 at 08:02:53PM -0400, Jon LaBadie wrote:

Emperical test, I'm in the Eastern US (EDT -4:00)
I sent myself a message on another system using an
altered TZ variable.

  TZ=PST8PDT mutt j...@mums.jgcomp.com

I'm old fashioned, so I used the old style TZ settings
for Western US.

The header Date: showed the PDT date/time.
The first Received: header showed the local system
received it using the actual local time (EDT).


Thank you for testing and reporting.  I would say that that is just as
it should be.

It *may* be possible to have your local timezone forwarded
automatically with your remote connection.  For example: if you set TZ
in your local environment, OpenSSH will try to set it in the remote
shell process.  The remote sshd would have to be configured to permit
this.  (See SendEnv in ssh_config(5) and AcceptEnv in sshd_config(5),
as well as ssh(1), for more details, IF you use OpenSSH.)  No matter
what you use to connect, this will likely require cooperation from the
remote sysadmin.


Provided you can run a remote command you should be good:

  ssh -t remotehost env TZ=$TZ mutt -f blah blah ...

Cheers,
--

Do you even know anything about perl? - AC replying to Tom Christiansen post


Re: How do I set the time zone from which mutt sends email?

2014-07-10 Thread Mark H. Wood
On Wed, Jul 09, 2014 at 08:02:53PM -0400, Jon LaBadie wrote:
 Emperical test, I'm in the Eastern US (EDT -4:00)
 I sent myself a message on another system using an
 altered TZ variable.
 
   TZ=PST8PDT mutt j...@mums.jgcomp.com
 
 I'm old fashioned, so I used the old style TZ settings
 for Western US.
 
 The header Date: showed the PDT date/time.
 The first Received: header showed the local system
 received it using the actual local time (EDT).

Thank you for testing and reporting.  I would say that that is just as
it should be.

It *may* be possible to have your local timezone forwarded
automatically with your remote connection.  For example: if you set TZ
in your local environment, OpenSSH will try to set it in the remote
shell process.  The remote sshd would have to be configured to permit
this.  (See SendEnv in ssh_config(5) and AcceptEnv in sshd_config(5),
as well as ssh(1), for more details, IF you use OpenSSH.)  No matter
what you use to connect, this will likely require cooperation from the
remote sysadmin.

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
Machines should not be friendly.  Machines should be obedient.


signature.asc
Description: Digital signature


How do I set the time zone from which mutt sends email?

2014-07-09 Thread Dave Kuhlman

My email server is in a different timezone from where I am.

How do I tell mutt to use my local timezone when sending an email? And, how 
do I tell mutt what my local timezone is?

I do remote login (with ssh) to my email account.

I looked at the mutt documentation on configuration and I also did several 
Web searches, but I could not find this.

Dave



Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Edward Toroshchin
Have you tried the TZ env variable? 

-- 
Edward


Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Derek Martin
On Wed, Jul 09, 2014 at 02:48:07AM +, Dave Kuhlman wrote:
 My email server is in a different timezone from where I am.
 
 How do I tell mutt to use my local timezone when sending an email? And, how 
 do I tell mutt what my local timezone is?

You don't... your system does that via its time configuration.  So as
long as your system's time (and timezone) are configured properly Mutt
is already using it.

 I do remote login (with ssh) to my email account.

So... you need to change your time zone on the mail server.  If you
can't do that system wide, you can set the TZ environment variable...
maybe.  No one really does this anymore so theoretically it should
still work, but you may have trouble finding documentation to give you
the right setting for your particular time zone.

 I looked at the mutt documentation on configuration and I also did several 
 Web searches, but I could not find this.

You won't, because this isn't really something Mutt does... As with
many things, Mutt tries to let the peice of software that specializes
in managing a given function do its job, and in this case that's your
OS.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpHvhHuTZxiJ.pgp
Description: PGP signature


Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Dave Kuhlman
Edward Toroshchin edward.hades at gmail.com writes:

 
 Have you tried the TZ env variable? 
 

Thanks to both Derek Martin and Edward for this suggestion.

I set my TZ variable as follows (I'm in California, US):

export TZ=US/Pacific

That seems to do what I want.  Now when I send an email, it has the time at 
which I wrote and sent it in California.

I'll have to remember to change that when I travel to a different timezone, 
of course.

FYI, on my mail server's machine (GNU/Linux), the list of timezone names is 
the directories and file names under:

/usr/share/zoneinfo/

Dave




Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Grant Edwards
On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
 On Wed, Jul 09, 2014 at 02:48:07AM +, Dave Kuhlman wrote:
 My email server is in a different timezone from where I am.
 
 How do I tell mutt to use my local timezone when sending an email? And, how 
 do I tell mutt what my local timezone is?

 You don't... your system does that via its time configuration.

You're assuming that the system's timezone and his local timezone are
the same.  That's not always true.  Some of the machines on which I
sometimes use mutt are in the US/Eastern zone, but my local timezone
is US/Central.  [When I'm using thse machines, I generally don't
bother trying to change the timezone.]

 So as long as your system's time (and timezone) are configured
 properly Mutt is already using it.

He doesn't want to use the system's timezone.  He wants to use his
local timezone.

Changing the TZ environment variable to match his local timezone
should work (modulo possibly broken libraries that don't handle the
case where a user's timezone and the system's timezone are different).

-- 
Grant Edwards   grant.b.edwardsYow! This ASEXUAL PIG
  at   really BOILS my BLOOD
  gmail.com... He's so ... so
   ... URGENT!!



Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Derek Martin
On Wed, Jul 09, 2014 at 06:33:40PM +, Grant Edwards wrote:
 On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
  On Wed, Jul 09, 2014 at 02:48:07AM +, Dave Kuhlman wrote:
  My email server is in a different timezone from where I am.
  
  How do I tell mutt to use my local timezone when sending an email? And, 
  how 
  do I tell mutt what my local timezone is?
 
  You don't... your system does that via its time configuration.
 
 You're assuming that the system's timezone and his local timezone are
 the same.  

At no point in my post did I assume any such thing.

 Changing the TZ environment variable to match his local timezone
 should work

...which would be why I said exactly that in my reply.  Thanks for
your post!

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpTmj7Ku9xRx.pgp
Description: PGP signature


Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Grant Edwards
On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
 On Wed, Jul 09, 2014 at 06:33:40PM +, Grant Edwards wrote:
 On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
  On Wed, Jul 09, 2014 at 02:48:07AM +, Dave Kuhlman wrote:
  My email server is in a different timezone from where I am.
  
  How do I tell mutt to use my local timezone when sending an email? And, 
  how 
  do I tell mutt what my local timezone is?
 
  You don't... your system does that via its time configuration.
 
 You're assuming that the system's timezone and his local timezone are
 the same.  

 At no point in my post did I assume any such thing.

The OP said he wanted mutt to use his local timezone.  You replied
that the system does that via its time configuration.  That can only
be true if the user's local timezone is the same as the system's
timezone, right?

-- 
Grant Edwards   grant.b.edwardsYow! !  Up ahead!  It's a
  at   DONUT HUT!!
  gmail.com



Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Derek Martin
On Wed, Jul 09, 2014 at 09:35:59PM +, Grant Edwards wrote:
 On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
  On Wed, Jul 09, 2014 at 06:33:40PM +, Grant Edwards wrote:
  On 2014-07-09, Derek Martin inva...@pizzashack.org wrote:
   On Wed, Jul 09, 2014 at 02:48:07AM +, Dave Kuhlman wrote:
   My email server is in a different timezone from where I am.
   
   How do I tell mutt to use my local timezone when sending an email? And, 
   how 
   do I tell mutt what my local timezone is?
  
   You don't... your system does that via its time configuration.
  
  You're assuming that the system's timezone and his local timezone are
  the same.  
 
  At no point in my post did I assume any such thing.
 
 The OP said he wanted mutt to use his local timezone.  

To be precise, he asked, HOW DO I TELL MUTT to use my local time zone
when sending an email? [emph. mine.]  I quite correctly replied that
you don't.  Mutt does not provide a way to tell it what time zone to
use; it relies on what the OS tells it the user is using, by whatever
means the user configures that.  What the OS tells it can not be
overridden in any way except by making the OS tell it something
else--i.e. by changing the system configuration.

 You replied that the system does that via its time configuration.
 That can only be true if the user's local timezone is the same as
 the system's timezone, right?

Close, but no, that's not precisely correct:  It can only be true if
the user's local time zone is the same as the system's CONFIGURED time
zone, irrespective of where the system actually is geographically
located (which would be what its time zone implies), or what its
DEFAULT is (a possible alternative interpretation of its time zone).
You are conflating system defaults and system configuration as
one.  The latter is a superset of the former.  Certainly, the system
administrator provides a wide variety of system-wide defaults at
system install time, and then generally any subsystem of the system
which is meant to be user-configurable (like your time zone, your
language configuration, your executable search path, etc.) is further
configured via environment variables, e.g. TZ.  The subsystems of the
system which care about those things universally (barring bugs) check
the value of those variables.  Thus the values of such variables are
part of the system configuration, in addition to any system-wide
defaults provided by the administrator.

And now for something completely different...

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpuxCk4lB1eu.pgp
Description: PGP signature


Re: How do I set the time zone from which mutt sends email?

2014-07-09 Thread Jon LaBadie
Emperical test, I'm in the Eastern US (EDT -4:00)
I sent myself a message on another system using an
altered TZ variable.

  TZ=PST8PDT mutt j...@mums.jgcomp.com

I'm old fashioned, so I used the old style TZ settings
for Western US.

The header Date: showed the PDT date/time.
The first Received: header showed the local system
received it using the actual local time (EDT).

So if just having the message Date: show your local time
when logged in from afar, set and export TZ appropriately.

Jon
-- 
Jon H. LaBadie j...@jgcomp.com
 11226 South Shore Rd.  (703) 787-0688 (H)
 Reston, VA  20190  (609) 477-8330 (C)


Re: Does mail_check work on IMAP? (Slow checking time)

2014-04-15 Thread Grant Edwards
On 2014-04-15, Chris Down ch...@chrisdown.name wrote:
 Grant Edwards writes:
 I though mutt supported IMAP's IDLE command.  That should reduce the
 latency to well under a second.

 At least in my experience, IMAP IDLE on mutt results in sporadic
 lockups (on Google Apps, at least). The only solution I found was to set
 mail_check and timeout to a low(ish) value. In the end I just downloaded
 my mail locally and read it from there.

Ah, that's good to know.  I gernally don't leave mutt running all the
time, so I never messed with IDLE or polling settings.  

I have a simple GTK IMAP mail notifier app which lights up a button on
my desktop when there's mail (clicking the button then starts a
terminal running mutt). The IMAP mail notifier does use IDLE with
gmail's IMAP server, and doesn't seem to have any problems.

-- 
Grant Edwards   grant.b.edwardsYow! As President I have
  at   to go vacuum my coin
  gmail.comcollection!



Re: Does mail_check work on IMAP? (Slow checking time)

2014-04-14 Thread Grant Edwards
On 2014-04-12, David Woodfall d...@dawoodfall.net wrote:

 I've been trying to get mutt to check IMAP mail more frequently. At
 the moment it seems to take 15 secs or so for a new message to appear
 after I've actually recieved it (I have an audible new mail
 notification that counts mailboxes for new mail).

I though mutt supported IMAP's IDLE command.  That should reduce the
latency to well under a second.

-- 
Grant Edwards   grant.b.edwardsYow! !  Up ahead!  It's a
  at   DONUT HUT!!
  gmail.com



Re: Does mail_check work on IMAP? (Slow checking time)

2014-04-14 Thread Chris Down
Grant Edwards writes:
 I though mutt supported IMAP's IDLE command.  That should reduce the
 latency to well under a second.

At least in my experience, IMAP IDLE on mutt results in sporadic
lockups (on Google Apps, at least). The only solution I found was to set
mail_check and timeout to a low(ish) value. In the end I just downloaded
my mail locally and read it from there.


pgpP3xkDgNaRf.pgp
Description: PGP signature


Does mail_check work on IMAP? (Slow checking time)

2014-04-12 Thread David Woodfall

Hi

I've been trying to get mutt to check IMAP mail more frequently. At
the moment it seems to take 15 secs or so for a new message to appear
after I've actually recieved it (I have an audible new mail
notification that counts mailboxes for new mail).

I know 15 secs isn't actually /that/ slow, but would prefer it faster.

The mail_check period doesn't seem to make much difference in the case
of IMAP. I've tried a few settings in (5) muttrc, but nothing seems to
help.

Any ideas?

Thanks

-Dave

--
Studioware. We provide the tools - You make the music.
http://www.studioware.org
irc.freenode.net #studioware
irc.oftc.net #studioware



Time Format

2013-02-14 Thread Konrad Vrba
Hello,

could somebody please advise how I can change the default time format,
which is displayed when I view my messages? At the moment, I see only
Month and day (ie, Aug 21). But I would like to see the year aswell,
as I am using mutt for reading through old archive of maildir, which
goes several years back.

I have tried SHIFT+? for help, but that did not get me very far. I am
new to mutt, I come from Alpine.

I would very much appreciate your help.

Konrad


Re: Time Format

2013-02-14 Thread Suvayu Ali
On Thu, Feb 14, 2013 at 02:14:35PM +0100, Konrad Vrba wrote:
 Hello,
 
 could somebody please advise how I can change the default time format,
 which is displayed when I view my messages? At the moment, I see only
 Month and day (ie, Aug 21). But I would like to see the year aswell,
 as I am using mutt for reading through old archive of maildir, which
 goes several years back.

Do you mean the timestamp in the index view (when you enter a mailbox)?
If so, look at $index_format in the manual.  You can specify display the
sender's time using %{fmt} where fmt is an strftime format string.

There is also a variable $date_format, but I'm not sure what it does.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.


Re: Time Format

2013-02-14 Thread christoph
On Thu, Feb 14, 2013 at 04:00:05PM +0100, Suvayu Ali wrote:
 On Thu, Feb 14, 2013 at 02:14:35PM +0100, Konrad Vrba wrote:
  Hello,
  
  could somebody please advise how I can change the default time format,
  which is displayed when I view my messages? At the moment, I see only
  Month and day (ie, Aug 21). But I would like to see the year aswell,
  as I am using mutt for reading through old archive of maildir, which
  goes several years back.
 
 Do you mean the timestamp in the index view (when you enter a mailbox)?
 If so, look at $index_format in the manual.  You can specify display the
 sender's time using %{fmt} where fmt is an strftime format string.

I have this index_format:
  set index_format=%Z %{%e.%m.%y %H:%M}  %-15.15F %s
which translates to lines like this one:
  L 14.02.13 14:14  Konrad Vrba Time Format

Hope this helps,
  christoph

 
 There is also a variable $date_format, but I'm not sure what it does.
 
 Hope this helps,
 
 -- 
 Suvayu
 
 Open source is the future. It sets us free.

-- 


Re: Time Format

2013-02-14 Thread s. keeling
Incoming from Konrad Vrba:
 
 could somebody please advise how I can change the default time format,
 which is displayed when I view my messages? At the moment, I see only
 Month and day (ie, Aug 21). But I would like to see the year aswell,

I use:

   set index_format=%4C %Z %-15.15F %{%d%b%y} (%4l) %s

which translates to DDMMMYY.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|: };:
- -


signature.asc
Description: Digital signature


Re: Time Format

2013-02-14 Thread Konrad Vrba
fantastic, that is exactly what I was looking for

many thanks

On 2/14/13, christoph christ...@kluenter.de wrote:
 On Thu, Feb 14, 2013 at 04:00:05PM +0100, Suvayu Ali wrote:
 On Thu, Feb 14, 2013 at 02:14:35PM +0100, Konrad Vrba wrote:
  Hello,
 
  could somebody please advise how I can change the default time format,
  which is displayed when I view my messages? At the moment, I see only
  Month and day (ie, Aug 21). But I would like to see the year aswell,
  as I am using mutt for reading through old archive of maildir, which
  goes several years back.

 Do you mean the timestamp in the index view (when you enter a mailbox)?
 If so, look at $index_format in the manual.  You can specify display the
 sender's time using %{fmt} where fmt is an strftime format string.

 I have this index_format:
   set index_format=%Z %{%e.%m.%y %H:%M}  %-15.15F %s
 which translates to lines like this one:
   L 14.02.13 14:14  Konrad Vrba Time Format

 Hope this helps,
   christoph


 There is also a variable $date_format, but I'm not sure what it does.

 Hope this helps,

 --
 Suvayu

 Open source is the future. It sets us free.

 --



Re: Time Format

2013-02-14 Thread s. keeling
Incoming from Konrad Vrba:
 On 2/14/13, christoph christ...@kluenter.de wrote:
 
  I have this index_format:
set index_format=%Z %{%e.%m.%y %H:%M}  %-15.15F %s
  which translates to lines like this one:
L 14.02.13 14:14  Konrad Vrba Time Format
 
 fantastic, that is exactly what I was looking for

Better:

   set index_format=%Z %{%y.%m.%e %H:%M}  %-15.15F %s

ISO-8601 compliant.  :-)

Thanks guys.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|: };:
- -


signature.asc
Description: Digital signature


Re: Time Format

2013-02-14 Thread Gary Johnson
On 2013-02-14, s. keeling wrote:
 Incoming from Konrad Vrba:
  On 2/14/13, christoph wrote:
  
   I have this index_format:
 set index_format=%Z %{%e.%m.%y %H:%M}  %-15.15F %s
   which translates to lines like this one:
 L 14.02.13 14:14  Konrad Vrba Time Format
  
  fantastic, that is exactly what I was looking for
 
 Better:
 
set index_format=%Z %{%y.%m.%e %H:%M}  %-15.15F %s
 
 ISO-8601 compliant.  :-)

The ISO-8601 date separator is a hyphen, not a period.

Regards,
Gary



Re: Mail times/date in local time zone

2012-03-31 Thread Kumar Appaiah
Dear Ed,

On Fri, Mar 30, 2012 at 05:23:38PM -0400, Ed Blackman wrote:
 On Fri, Mar 30, 2012 at 02:27:47PM -0500, Kumar Appaiah wrote:
 Often, I wish to know the time at which someone wrote me an e-mail
 converted to the local time zone. Since most of my contacts live in
 another time zone, (and some use the time zone + even though that
 isn't where they live), I have to do some mental calculations which
 I'd like to avoid sometimes.
 
 Currently, my workaround for this is to make Mutt unignore a header
 called X-Date, and add a procmail recipe like this:
 
 Your procmail recipe adds the date at the time the message is
 received.  Perhaps using %(fmt) in your index_format instead of
 the default %{fmt} would help you get the desired time format in
 the index.

I don't think so. For your message, my recipe:

:0 f:
* ^Date: *\/[^ ].*
| formail -a X-Date: `date  +\%a, %d %b %Y %H:%M:%S %z\ -d\$MATCH\`

gives me this:

 Date: Fri, 30 Mar 2012 17:23:38 -0400
 X-Date: Fri, 30 Mar 2012 16:23:38 -0500

The reason is because $MATCH parses the Date: header in the e-mail,
and passes it to the date command. In other words:

# date  +%a, %d %b %Y %H:%M:%S %z -dFri, 30 Mar 2012 17:23:38 -0400
Fri, 30 Mar 2012 16:23:38 -0500

It appears that that is the time you composed the e-mail?

 man muttrc and search for index_format to learn the difference
 between the two.  If you don't have an index_format set, the default
 is
 %4C %Z %{%b %d} %-15.15L (%?l?%4l%4c?) %s.  Experiment with
 %4C %Z %(%b %d) %-15.15L (%?l?%4l%4c?) %s instead.
 
 I don't think there's a way to change it in the pager.

That's sad. Thanks for the suggestions, but I'll stick to the X-Date,
since the pager is what I am interested in. I will fiddle around with
the index format, though.

Thanks.

Kumar
-- 
Kumar Appaiah


Re: Mail times/date in local time zone

2012-03-31 Thread Gary Johnson
On 2012-03-30, Kumar Appaiah wrote:
 Dear Mutt Users,
 
 Often, I wish to know the time at which someone wrote me an e-mail
 converted to the local time zone. Since most of my contacts live in
 another time zone, (and some use the time zone + even though that
 isn't where they live), I have to do some mental calculations which
 I'd like to avoid sometimes.

This is what I use.  It puts the local time at which a message was
sent in the status line at the bottom of the pager.

set pager_format=%4C %Z %[!%b %e at %I:%M %p]  %.20n  %s%* -- (%P)

Regards,
Gary



Re: Mail times/date in local time zone

2012-03-31 Thread Kumar Appaiah
Dear Gary,

On Sat, Mar 31, 2012 at 10:26:17AM -0700, Gary Johnson wrote:
 On 2012-03-30, Kumar Appaiah wrote:
  Dear Mutt Users,
  
  Often, I wish to know the time at which someone wrote me an e-mail
  converted to the local time zone. Since most of my contacts live in
  another time zone, (and some use the time zone + even though that
  isn't where they live), I have to do some mental calculations which
  I'd like to avoid sometimes.
 
 This is what I use.  It puts the local time at which a message was
 sent in the status line at the bottom of the pager.
 
 set pager_format=%4C %Z %[!%b %e at %I:%M %p]  %.20n  %s%* -- (%P)

An adapted version of this works fine. Thanks.

Kumar
-- 
Kumar Appaiah


Mail times/date in local time zone

2012-03-30 Thread Kumar Appaiah
Dear Mutt Users,

Often, I wish to know the time at which someone wrote me an e-mail
converted to the local time zone. Since most of my contacts live in
another time zone, (and some use the time zone + even though that
isn't where they live), I have to do some mental calculations which
I'd like to avoid sometimes.

Currently, my workaround for this is to make Mutt unignore a header
called X-Date, and add a procmail recipe like this:

:0 f:
* ^Date: *\/[^ ].*
| formail -a X-Date: `date  +\%a, %d %b %Y %H:%M:%S %z\ -d
\$MATCH\`

Naturally, this works only for e-mail delivered via procmail and not
if I use Mutt as an IMAP agent. I can live with this solution, but I
was wondering if you could come up with a better solution than this.

Thanks.

Kumar
-- 
Kumar Appaiah


Re: Mail times/date in local time zone

2012-03-30 Thread Ed Blackman

On Fri, Mar 30, 2012 at 02:27:47PM -0500, Kumar Appaiah wrote:

Often, I wish to know the time at which someone wrote me an e-mail
converted to the local time zone. Since most of my contacts live in
another time zone, (and some use the time zone + even though that
isn't where they live), I have to do some mental calculations which
I'd like to avoid sometimes.

Currently, my workaround for this is to make Mutt unignore a header
called X-Date, and add a procmail recipe like this:


Your procmail recipe adds the date at the time the message is received.  
Perhaps using %(fmt) in your index_format instead of the default 
%{fmt} would help you get the desired time format in the index.


man muttrc and search for index_format to learn the difference between 
the two.  If you don't have an index_format set, the default is

%4C %Z %{%b %d} %-15.15L (%?l?%4l%4c?) %s.  Experiment with
%4C %Z %(%b %d) %-15.15L (%?l?%4l%4c?) %s instead.

I don't think there's a way to change it in the pager.

--
Ed Blackman


signature.txt
Description: Digital signature


Re: time zone conversion

2012-01-24 Thread Michael Elkins

On Mon, Jan 23, 2012 at 08:56:01PM +0100, Sebastian Tramp wrote:

On Mon, Jan 23, 2012 at 01:32:33PM +, Paul wrote:


I'm looking for a way to convert the date header to my local time
zone in the mail detail view. I'm aware of the index format %D option
but need this for the (internal) pager.

Any ideas?

This is not fantastic, but it's worked for me:


Indeed, this works great. Now I only need to combine that with t-prot
but thats not a problem.


I've actually been thinking about this recently as well.  It's 
probably worth having support directly in the pager for rewriting 
the Date: field to your local timezome based on a configuration 
option.


time zone conversion

2012-01-23 Thread Sebastian Tramp
Hi all,

I'm looking for a way to convert the date header to my local time zone
in the mail detail view. I'm aware of the index format %D option but
need this for the (internal) pager.

Any ideas?

Best regards

Sebastian Tramp

-- 
WebID: http://sebastian.tramp.name


Re: time zone conversion

2012-01-23 Thread P. Mazart
Hi,

Sebastian Tramp schrieb am 23.01.2012 09:21:17:
 I'm looking for a way to convert the date header to my local time zone
 in the mail detail view. I'm aware of the index format %D option but
 need this for the (internal) pager.

Just noticed myself having this problem, too.
Thanks! :-) 

The only thing I can think of yet is using display_filter with an own 
script that uses formail or similar …

P.M.


Re: time zone conversion

2012-01-23 Thread Paul

On Monday, 23 January, 2012 at 08:21:17 GMT, Sebastian Tramp wrote:

I'm looking for a way to convert the date header to my local time zone
in the mail detail view. I'm aware of the index format %D option but
need this for the (internal) pager.

Any ideas?


This is not fantastic, but it's worked for me:

Create a new script, eg. mutt_date_filter.pl:

---

#!/usr/bin/env perl

use strict;
use warnings;

while () {
s/\b(..., \d{1,2} ... \d{4} \d\d:\d\d:\d\d [+-]?\d{4})\b/my $d;chomp($d=`date -d 
$1 +'%A, %d %B, %Y, %T %Z'`);$d/eg;
print $_;
}

---

It looks for a string format matching that regex, and passes it to the 'date' 
command, which outputs it in your local time zone. I also told it to reformat 
it according to my own taste.

In .muttrc:

set display_filter=mutt_date_filter.pl

Make sure it's in your path.

--

.


Re: time zone conversion

2012-01-23 Thread Gary Johnson
On 2012-01-23, Sebastian Tramp wrote:
 Hi all,
 
 I'm looking for a way to convert the date header to my local time zone
 in the mail detail view. I'm aware of the index format %D option but
 need this for the (internal) pager.
 
 Any ideas?

Would displaying that in the 'pager_format' line work for you?

Regards,
Gary



Re: time zone conversion

2012-01-23 Thread Sebastian Tramp
On Mon, Jan 23, 2012 at 01:32:33PM +, Paul wrote:

 I'm looking for a way to convert the date header to my local time
 zone in the mail detail view. I'm aware of the index format %D option
 but need this for the (internal) pager.
 
 Any ideas?

 This is not fantastic, but it's worked for me:

Indeed, this works great. Now I only need to combine that with t-prot
but thats not a problem.

ST

-- 
WebID: http://sebastian.tramp.name


Re: format string: time for today, date for others.

2011-01-20 Thread Ed Blackman

On Fri, Jan 07, 2011 at 05:29:32AM -0600, David Champion wrote:

Aha, finally I have discovered a use for mutt's %strftime expando.
You can optimize this one step further.

   set index_format=./format_date.sh '%[%Y%m%d]' '%%Y%m%d' |

   #!/bin/sh

   if [ $1 -eq $2 ]; then
echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   else
echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   fi

A single exec per message now; that's as good as it gets without
patching mutt.


Outstanding!  I didn't notice a slowdown from the extra exec, but saving 
cycles isn't a bad thing if you don't have to sacrifice clarity.


I went a little bit crazy with this, and now have different formats for 
less than a day old, more than a day but less than a week old, more than 
a week but less than 30 days, and more than 30 days.  I've attached it.


Here's a (censored) view of my index right before I started this 
message:


 102 12/16/10 xx...@xx.xx (   8) x - xxx xx. 
 103   +   Dec 27  xxx xxx xx (  80)  xx xxx xx 
 104   +   Jan 03 xx xxx  (  98) xx: xx xxx 
 105   T   Jan 04 xx  ( 104) xxx xxx xxx
 106   L   Jan 07 x   (  54) xx: xx xx:  xxx x, 
 xxx xx.
 107   Jan 07 x   (  92)  xx  xx  x 
 1/4 xxx
 108   +   Jan 12 xxx x x (  82) xx xx xxx xx 
 109   +   Jan 13 x, x(  23) xx: !
 110   +  Mon 9pm x xxx   (  20) xx: x4x xxx xx (xxx: x 
/ )
 111   T  Tue 2pm  xx ( 153) xxx xxx  x
 112   T Wed 11am xxx ( 157) xx
 113  Wed 3pm x xx( 266)  xxx xxx, xx 
x_xx__xx
 114   T   8:59pm x   (  21) x xxx xxx xxx xx x 
xxx
 115   +   9:11pm xx xxx  (  50) xx:  

The script relies on Unix epoch seconds for the calculation, so the break 
point is 24 hours ago, 168 hours ago, etc, not day boundaries, but 
that's what I want.  I think day boundaries would be possible with some 
work on the msg_age calculation, maybe $(( ($now/86400) - ($msg_date/86400) ))?


Ed
#!/bin/bash
# format_date
#
# In .muttrc:
# set index_format=/path/to/format_date '%[%s]' '%%s' |
#
# 
http://groups.google.com/group/de.comm.software.mailreader.misc/browse_thread/thread/ab966bddc0b424
 46/421549103438b830?q=#421549103438b830
# via Andreas Kneib apo...@web.de
# mutt-users Message-ID: 20110105233817.ga23...@andreas.kneib.biz
# Improvements by
# David Champion d...@uchicago.edu
# Ed Blackman e...@edgewood.to

msg_date=$1   # datetime of message in local timezone 
in epoch seconds
now=$2# current time in local timezone in 
epoch seconds
msg_age=$(( ($now - $msg_date) / 86400 )) # age of message in 
integer days

if [ $msg_age -ge 30 ]; then
  format=%[%m/%d/%y]  # '01/20/11'
elif [ $msg_age -ge 7 ]; then
  format=%8[%b %d]# '  Jan 20'
elif [ $msg_age -ge 1 ]; then
  format=%8[%a %-I%P] # ' Thu 6pm'
else
  format=%[ %_I:%M%P] # '  6:41pm'
fi

echo %4C %Z $format %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%


signature.txt
Description: Digital signature


Re: format string: time for today, date for others.

2011-01-07 Thread Yue Wu
On Wed, Jan 05, 2011 at 04:32:44PM -0600, David Champion wrote:
 * On 05 Jan 2011, Yue Wu wrote: 
  Hi list,
  
  Is there a date/time string that show the time only for today's emails
  but date for else? So, in the index, the emails that got today will
  show the time only, but the ones that got on other days will show the
  date and time.
 
 Not in out-of-box mutt.  For that you need the date_conditional patch by
 Aaron Schrab.  I don't see a version on the web that is rebased against
 current mutt but I can send you one if you're comfortable patching and
 compiling your own mutt.
 

Thank you all the infos, I don't know much about patching/compiling,
and it's not a must-have feature, so I will stick to the unpatched
mutt. I'm sorry if I've wasted your time, but the infos is useful, it
let me know that mutt hasn't such feature without patch, and it lets
guys who are interested in it know the patch to do the job.

Thanks again for infos!

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: format string: time for today, date for others.

2011-01-07 Thread Yue Wu
On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
 Hi,
 
 I improved the script to fulfill the author's the expectation(just display 
 time for today's mails),
 only 'if condition' changed.
 
 - du yang
 
 
 #!/bin/bash
 
 epoch=$1
 
 if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
  echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%   
 
 else  

  echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%   
 
 fi

Must it be bash script? No bash here, it fails the test with sh...

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: format string: time for today, date for others.

2011-01-07 Thread du yang
On Fri, Jan 07, 2011 at 18:21 +0800, Yue Wu wrote:
 On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
  Hi,
  
  I improved the script to fulfill the author's the expectation(just display 
  time for today's mails),
  only 'if condition' changed.
  
  - du yang
  
  
  #!/bin/bash
  
  epoch=$1
  
  if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
   echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 

  else
   
   echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 

  fi
 
 Must it be bash script? No bash here, it fails the test with sh...
 

Change '#!/bin/bash' to '#!/bin/sh' in the script header, then it may work.

else please post the error details.

-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


Re: format string: time for today, date for others.

2011-01-07 Thread Yue Wu
On Fri, Jan 07, 2011 at 06:32:44PM +0800, du yang wrote:
 
 Change '#!/bin/bash' to '#!/bin/sh' in the script header, then it may work.
 
 else please post the error details.
 

I've tried it, but many messages like:

usage: date [-jnu] [-d dst] [-r seconds] [-t west]
[-v[+|-]val[ymwdHMS]] ...
  [-f fmt date |
  [cc]yy]mm]dd]HH]MM[.ss]]
  [+format]

 [:-gt: unexpected operator

mess up my mutt index screen at all.

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: format string: time for today, date for others.

2011-01-07 Thread David Champion
* On 07 Jan 2011, Yue Wu wrote:
 On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
 
  if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
   echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
  else
   echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
  fi

 Must it be bash script? No bash here, it fails the test with sh...

This is a POSIX sh script, not Bourne, which is why it fails for you.
Specifically, $(command) is a POSIX construction that is not supported
by conventional Bourne shells.  You can fix it by replacing this:

if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then

with this:

now=`date '+%Y-%m-%d'`
if [ `date -d $now +%s` -gt $epoch ]; then

However, if I'm not mistaken that command still relies on GNU extensions
to the date command.  (Mixing POSIX and GNU is another common
portability problem in the Linux era.)  Since you appear to be using
FreeBSD you may have problems with that even after adapting the shell
syntax.  (In fact I think it's even more confusing.  Where the -d
option will simply fail on a pure POSIX system, I think it is actually
a completely different option on BSD, which has its own extensions
separate from GNU's.)

Remember that setting $index_format to a piped command means that the
command is run once each time a message is displayed on your index.  I
wrote the code to allow $index_format to be a piped command, and as I
remember the result is *not* cached.  Since the command in this case is
a shell script, it's actually going to run three commands: sh, date, and
another date.

For these reasons -- portability and performance -- I would not use
shell for this purpose.  I prefer Python, but Perl might be a better
choice since it typically has a lower startup time.  Naturally for
performance concerns, C would be the best choice.

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago


Re: format string: time for today, date for others.

2011-01-07 Thread du yang
On Fri, Jan 07, 2011 at 18:54 +0800, Yue Wu wrote:
 On Fri, Jan 07, 2011 at 06:32:44PM +0800, du yang wrote:
  
  Change '#!/bin/bash' to '#!/bin/sh' in the script header, then it may work.
  
  else please post the error details.
  
 
 I've tried it, but many messages like:
 
 usage: date [-jnu] [-d dst] [-r seconds] [-t west]
 [-v[+|-]val[ymwdHMS]] ...
   [-f fmt date |
   [cc]yy]mm]dd]HH]MM[.ss]]
   [+format]
   
[:-gt: unexpected 
 operator
 
 mess up my mutt index screen at all.
 

Oh it may be the symbol $() which caused the problem.
It is ok on my machine just because /bin/sh is a soft link to bash.
Here I post a new one.

if it still doesn't work, you may have to post the date command help('date 
--help') to see if it is a problem of your 'date'.

- du yang

==
#!/bin/sh

epoch=$1

_today=`date '+%Y-%m-%d'`
_yesterday=`date -d $_today +%s`

if [ $_yesterday -gt $epoch ]; then
echo %4C %Z %[%d-%m-%y] %?M?%-11.11F [%2M]%-16.16F? (%?c?%4c%4l?)  
%?H?[%H]?%s%
else
echo %4C %Z %[   %H:%M] %?M?%-11.11F [%2M]%-16.16F? (%?c?%4c%4l?)  
%?H?[%H]?%s%
fi 



-- 
  临江仙·滚滚长江东逝水--杨慎
滚滚长江东逝水,浪花淘尽英雄。
是非成败转头空。青山依旧在,几度夕阳红。
白发渔樵江渚上,惯看秋月春风。
一壶浊酒喜相逢。古今多少事,都付笑谈中。


Re: format string: time for today, date for others.

2011-01-07 Thread Yue Wu
On Fri, Jan 07, 2011 at 05:07:47AM -0600, David Champion wrote:
 * On 07 Jan 2011, Yue Wu wrote:
  On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
  
   if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   else
echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   fi
 
  Must it be bash script? No bash here, it fails the test with sh...
 
 This is a POSIX sh script, not Bourne, which is why it fails for you.
 Specifically, $(command) is a POSIX construction that is not supported
 by conventional Bourne shells.  You can fix it by replacing this:
 
 if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
 
 with this:
 
 now=`date '+%Y-%m-%d'`
 if [ `date -d $now +%s` -gt $epoch ]; then
 
 However, if I'm not mistaken that command still relies on GNU extensions
 to the date command.  (Mixing POSIX and GNU is another common
 portability problem in the Linux era.)  Since you appear to be using
 FreeBSD you may have problems with that even after adapting the shell
 syntax.  (In fact I think it's even more confusing.  Where the -d
 option will simply fail on a pure POSIX system, I think it is actually
 a completely different option on BSD, which has its own extensions
 separate from GNU's.)
 
 Remember that setting $index_format to a piped command means that the
 command is run once each time a message is displayed on your index.  I
 wrote the code to allow $index_format to be a piped command, and as I
 remember the result is *not* cached.  Since the command in this case is
 a shell script, it's actually going to run three commands: sh, date, and
 another date.
 
 For these reasons -- portability and performance -- I would not use
 shell for this purpose.  I prefer Python, but Perl might be a better
 choice since it typically has a lower startup time.  Naturally for
 performance concerns, C would be the best choice.
 

Thank you detailed explanation! I got it. I concern the performance,
and it isn't a must feature, it's just for curiosity :)

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: format string: time for today, date for others.

2011-01-07 Thread David Champion
* On 07 Jan 2011, du yang wrote: 
 Hi,
 
 I improved the script to fulfill the author's the expectation(just display 
 time for today's mails),
 only 'if condition' changed.
 ...
 if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
  echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%

It occurs to me that there is an optimization for this specific case.
Since the desired breaking point is simply the beginning of today,
you can exploit the fact that %Y%m%d is a monotonic function when you
interpret it as an integer.  (That is, it alpha-sorts and integer-sorts
in the same order as it date-sorts.)

set index_format=./format_date.sh '%[%Y%m%d]' |

#!/bin/sh

if [ $1 -eq `date +%Y%m%d` ]; then
 echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
else
 echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
fi

I'm still not sure about performance though.  I have a 58-row terminal
and do not want to run 116 processes for each page view in mutt. :)



Aha, finally I have discovered a use for mutt's %strftime expando.
You can optimize this one step further.

set index_format=./format_date.sh '%[%Y%m%d]' '%%Y%m%d' |

#!/bin/sh

if [ $1 -eq $2 ]; then
 echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
else
 echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
fi

A single exec per message now; that's as good as it gets without
patching mutt.

I 'stole' %strftime for my nested_if patch because it looked
completely useless, so if you happen to be using nested_if, this latter
version won't work.  Now that I see a purpose for %... I'll have to
revisit nested_if.  (Unfortunately all the paired symbols are used
already.)

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago


Re: format string: time for today, date for others.

2011-01-07 Thread du yang
On Fri, Jan 07, 2011 at 05:29 -0600, David Champion wrote:
 * On 07 Jan 2011, du yang wrote: 
  Hi,
  
  I improved the script to fulfill the author's the expectation(just display 
  time for today's mails),
  only 'if condition' changed.
  ...
  if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
   echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 
 It occurs to me that there is an optimization for this specific case.
 Since the desired breaking point is simply the beginning of today,
 you can exploit the fact that %Y%m%d is a monotonic function when you
 interpret it as an integer.  (That is, it alpha-sorts and integer-sorts
 in the same order as it date-sorts.)
 
 set index_format=./format_date.sh '%[%Y%m%d]' |
 
 #!/bin/sh
 
 if [ $1 -eq `date +%Y%m%d` ]; then
  echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 else
  echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 fi
 
 I'm still not sure about performance though.  I have a 58-row terminal
 and do not want to run 116 processes for each page view in mutt. :)
 
 
 
 Aha, finally I have discovered a use for mutt's %strftime expando.
 You can optimize this one step further.
 
 set index_format=./format_date.sh '%[%Y%m%d]' '%%Y%m%d' |
 
 #!/bin/sh
 
 if [ $1 -eq $2 ]; then
  echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 else
  echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 fi
 
 A single exec per message now; that's as good as it gets without
 patching mutt.
 
 I 'stole' %strftime for my nested_if patch because it looked
 completely useless, so if you happen to be using nested_if, this latter
 version won't work.  Now that I see a purpose for %... I'll have to
 revisit nested_if.  (Unfortunately all the paired symbols are used
 already.)
 

Excellent! 
your improvement is helpful for some slow machines and machines during high 
load such as compiling.

And mutt should be a single thread program, so it could just flush the terminal 
line by line, and would not fork many processes simultaneously.

- du yang
-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


Re: format string: time for today, date for others.

2011-01-07 Thread du yang
On Fri, Jan 07, 2011 at 18:21 +0800, Yue Wu wrote:
 On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
  Hi,
  
  I improved the script to fulfill the author's the expectation(just display 
  time for today's mails),
  only 'if condition' changed.
  
  - du yang
  
  
  #!/bin/bash
  
  epoch=$1
  
  if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
   echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 

  else
   
   echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 

  fi
 
 Must it be bash script? No bash here, it fails the test with sh...
 

you can first test it like this,
# ./format_date.sh 1294329609

-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


Re: format string: time for today, date for others.

2011-01-07 Thread du yang
On Fri, Jan 07, 2011 at 05:07 -0600, David Champion wrote:
 * On 07 Jan 2011, Yue Wu wrote:
  On Fri, Jan 07, 2011 at 03:40:12PM +0800, du yang wrote:
  
   if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   else
echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
   fi
 
  Must it be bash script? No bash here, it fails the test with sh...
 
 This is a POSIX sh script, not Bourne, which is why it fails for you.
 Specifically, $(command) is a POSIX construction that is not supported
 by conventional Bourne shells.  You can fix it by replacing this:
 
 if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
 
 with this:
 
 now=`date '+%Y-%m-%d'`
 if [ `date -d $now +%s` -gt $epoch ]; then
 
 However, if I'm not mistaken that command still relies on GNU extensions
 to the date command.  (Mixing POSIX and GNU is another common
 portability problem in the Linux era.)  Since you appear to be using
 FreeBSD you may have problems with that even after adapting the shell
 syntax.  (In fact I think it's even more confusing.  Where the -d
 option will simply fail on a pure POSIX system, I think it is actually
 a completely different option on BSD, which has its own extensions
 separate from GNU's.)
 
 Remember that setting $index_format to a piped command means that the
 command is run once each time a message is displayed on your index.  I
 wrote the code to allow $index_format to be a piped command, and as I
 remember the result is *not* cached.  Since the command in this case is
 a shell script, it's actually going to run three commands: sh, date, and
 another date.
 
 For these reasons -- portability and performance -- I would not use
 shell for this purpose.  I prefer Python, but Perl might be a better
 choice since it typically has a lower startup time.  Naturally for
 performance concerns, C would be the best choice.
 

You are absolutely correct. Considering performance in mind is always better.

But scripts and languages like java is still very important in computer world.
Because it allows people to accomplish their tasks easily without making any 
seriously mistake like core dump. It hides many system implementation details 
to whom doesn't care it. It frees programmers from memory tuning and it helps 
not-so clever programmers doing thing correctly.

Most cases for people, function is more important than performance. They just 
care working or not. Why Java is so popular in commercial world.. Simply 
because bosses like it.

At last not the least, for researching and system which is 
performance-sensitive, C/C++ is still the best choice.

- du yang
-- 
oooO:
(..):
:\.(:::Oooo::
::\_)::(..)::
:::)./:::
::(_/


Re: format string: time for today, date for others.

2011-01-06 Thread David Champion
* On 05 Jan 2011, Toby Cubitt wrote: 
 
 is dated less than 24h before the current time. That's *not* what I'm
 after. When the current time is 00:01 on the 6 Jan, I want an email that
 arrived at 23:59 on the 5 Jan to display Sun 05, even though the email
 is only two minutes old.

I understand now.  In your first post I read emphasis in the multiple
conditionality, not in the idea that yesterday is not the same as
less than one day ago.

Does your patch still support the original behavior of date_conditional?
I personally don't want everything to change at midnight.  (I'm more
sensitive to how long ago something happened than to what day it was at
the time.)  But if your version does both it's a more complete feature,
and I'm interested it using it instead.

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago


Re: format string: time for today, date for others.

2011-01-06 Thread Toby Cubitt
On Thu, Jan 06, 2011 at 03:09:53AM +, Toby Cubitt wrote:
 As far as I recall (it's a long time since I looked at it), the
 date_conditional patch straightforwardly compares the email date stamp
 against the current time. The 1d conditional is true whenever the email
 is dated less than 24h before the current time. That's *not* what I'm
 after. When the current time is 00:01 on the 6 Jan, I want an email that
 arrived at 23:59 on the 5 Jan to display Sun 05, even though the email
 is only two minutes old.

In case anyone's interested, I've put the modified version of the
date_conditional patch which implements the above behaviour at:

http://www.dr-qubit.org/download.php?file
=mutt/mutt-1.5.21-patch.tsc.date_conditional.1

[URL should all be on one line]

Note that you can still get the original date_conditional behaviour by
specifying a finer time unit in the date format. E.g. if you want to
specify a format for emails from the last 24 hours, use 24h as the time
span. If you want to specify a format for emails from today (as described
above), use 1d as the time span.

(Roughly speaking, in this version of the date_conditional patch, the
current time and the email's date stamp are converted to the unit of time
specified in the conditional, and the fractional part discarded, before
comparing the two.)

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ts...@cantab.net
web: www.dr-qubit.org


Re: format string: time for today, date for others.

2011-01-06 Thread du yang
Hi,

I improved the script to fulfill the author's the expectation(just display time 
for today's mails),
only 'if condition' changed.

- du yang


#!/bin/bash

epoch=$1

if [ $(date -d $(date '+%Y-%m-%d') +%s) -gt $epoch ]; then
 echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 
  
else
 
 echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s% 
  
fi


On Thu, Jan 06, 2011 at 00:38 +0100, Andreas Kneib wrote:
 Hi,
 
 * Yue Wu schrieb am Donnerstag, den 06. Januar 2011:
 
  Is there a date/time string that show the time only for today's emails
  but date for else? So, in the index, the emails that got today will
  show the time only, but the ones that got on other days will show the
  date and time.
 
 I use this script:
 http://groups.google.com/group/de.comm.software.mailreader.misc/browse_thread/thread/ab966bddc0b42446/421549103438b830?q=#421549103438b830
 
 In ~/.muttrc:
 #v+
 set index_format=./format_date.sh '%[%s]' |
 #v-
 
 #
 #!/bin/bash
 #
 # File: format_date.sh 
 
 epoch=$1
 
 if [ $(($(date '+%s') - $1)) -gt 86400 ]; then
 echo %4C %Z %{%d.%m.%y} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 else
 echo %4C %Z %{   %H:%M} %-15.15F (%?l?%4l%4c?) %?H?[%H]?%s%
 fi 
 #
 
 
 Andreas

-- 


format string: time for today, date for others.

2011-01-05 Thread Yue Wu
Hi list,

Is there a date/time string that show the time only for today's emails
but date for else? So, in the index, the emails that got today will
show the time only, but the ones that got on other days will show the
date and time.

-- 
Regards,
Yue Wu

Key Laboratory of Modern Chinese Medicines
Department of Traditional Chinese Medicine
China Pharmaceutical University
No.24, Tongjia Xiang Street, Nanjing 210009, China


Re: format string: time for today, date for others.

2011-01-05 Thread David Champion
* On 05 Jan 2011, Yue Wu wrote: 
 Hi list,
 
 Is there a date/time string that show the time only for today's emails
 but date for else? So, in the index, the emails that got today will
 show the time only, but the ones that got on other days will show the
 date and time.

Not in out-of-box mutt.  For that you need the date_conditional patch by
Aaron Schrab.  I don't see a version on the web that is rebased against
current mutt but I can send you one if you're comfortable patching and
compiling your own mutt.

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago


Re: format string: time for today, date for others.

2011-01-05 Thread Toby Cubitt
On Wed, Jan 05, 2011 at 04:32:44PM -0600, David Champion wrote:
 * On 05 Jan 2011, Yue Wu wrote: 
  Hi list,
  
  Is there a date/time string that show the time only for today's emails
  but date for else? So, in the index, the emails that got today will
  show the time only, but the ones that got on other days will show the
  date and time.
 
 Not in out-of-box mutt.  For that you need the date_conditional patch by
 Aaron Schrab.  I don't see a version on the web that is rebased against
 current mutt but I can send you one if you're comfortable patching and
 compiling your own mutt.

If I remember correctly, the date_conditional patch doesn't *quite* let
you have a different date/time string for today, rather it gives you a
different date/time string for the last 24h.

A while back, I wrote a modified version of the date_conditional patch so
that it could be used to produce different formats for mails from today,
from the current month, from the current year, etc. I haven't gotten
around to making it available online, but if you want a copy I'd be happy
to mail it to you.

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ts...@cantab.net
web: www.dr-qubit.org


  1   2   3   >