Bump version and update Changes
[app-lastmsg.git] / lastmsg
CommitLineData
82af6c12
MG
1#!/usr/bin/perl
2use 5.014000;
3use strict;
4use warnings;
5
6use App::Lastmsg;
7
8App::Lastmsg::run;
9
10__END__
11
12=encoding utf-8
13
14=head1 NAME
15
16lastmsg - last(1) semblance for your inbox
17
18=head1 SYNOPSIS
19
20 # in ~/.lastmsgrc
21 inbox:
22 - /home/MGV/mail/inbox
23 - /home/MGV/mail/folder
24 sent:
25 - /home/MGV/mail/sent
26 track:
27 bestfriend:
28 - best@friend.com
29 - best.friend@freemail.com
30 someguy: SOMEGUY@cpan.org
31 nobody:
32 - nobody@example.com
33
34 # in your shell
35 mgv@somehost ~ $ lastmsg
36 bestfriend best@friend.com Sat 31 Dec 2016 12:34:56 EET
37 someguy SOMEGUY@cpan.org Thu 20 Nov 2016 12:00:00 EET
38 nobody NOT FOUND
39
40=head1 DESCRIPTION
41
42lastmsg reads your mail folders looking for emails you exchanged with
43a given set of people. Then for each person in the set it prints the
44time you last received an email from or sent an email to them and the
45email address used.
46
47The script takes no arguments (the settings are taken from a
48configuration file), and it prints a three-column table where the
49first column is the ID of a person, the second column is the email
50address last used (empty if you've never exchanged an email with that
51person), and the last column is the date of last contact (or the
52string C<NOT FOUND> if you've never exchanged an email). The rows are
53sorted by date of last contact (with the most recently contacted
54people at the top), and the people that you've never exchanged an
55email with are at the end.
56
57The configuration is in YAML format. Three keys are recognised:
58
59=over
60
61=item B<inbox>
62
63The path(s) to your inbox and other incoming mail folders (a single
64string or a list of strings). The C<From> field of these emails is
65scanned.
66
67If not provided, it defaults to F</var/mail/$ENV{USER}> and
e28b3c39
MG
68F<$ENV{HOME}/Maildir/>. If USER or HOME are not in the environment,
69the corresponding default directory is ignored. So on a system with
70neither of these variables defined, this option will default to an
71empty list.
82af6c12
MG
72
73B<NOTE:> See L<Email::FolderType> for information on how the type of a
74folder is identified. In short, the suffix of the folder is analyzed:
75If F</>, the format is Maildir. If F</.>, the format is MH. If F<//>,
76the format is Ezmlm. Otherwise, some heuristics are checked and the
77fallback is Mbox.
78
79=item B<sent>
80
81The path(s) to your sent and other outgoing mail folders (a single
82string or a list of strings). The C<To>, C<Cc>, and C<Bcc> fields of
83these emails are scanned.
84
85If not provided, it default to an empty list. See B<NOTE:> above for
86information on how the type of a folder is identified.
87
88=item B<track>
89
90A hash of people to track. Each entry represents a person. The key is
91the ID of that person (used for display), and the value is the email
92address of that person or a list of email addresses of that person.
93
94If not provided, the script will die with an error.
95
96=back
97
98The configuration file can be named F<lastmsgconfig>,
99F<lastmsg.config>, F<lastmsgrc>, or F<.lastmsgrc> and can be placed in
100the current directory, in your home directory, in F</etc/>, and in
101F</usr/local/etc/>. See L<Config::Auto> for more information.
102
103=head1 ENVIRONMENT
104
105The only recognised environment variable is B<LASTMSG_DEBUG>, which if
45e63402
MG
106set to a true value causes the script to emit a lot of information on
107STDERR about what it is doing.
82af6c12
MG
108
109=head1 TODO
110
111Should handle IRC and IM logs as well, not just emails. Should have
112better tests.
113
114=head1 AUTHOR
115
116Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
117
118=head1 COPYRIGHT AND LICENSE
119
77386ee0 120Copyright (C) 2016-2017 by Marius Gavrilescu
82af6c12
MG
121
122This library is free software; you can redistribute it and/or modify
123it under the same terms as Perl itself, either Perl version 5.24.1 or,
124at your option, any later version of Perl 5 you may have available.
125
126
127=cut
This page took 0.015814 seconds and 4 git commands to generate.