-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
m_inmail DB now located in $XDG_DATA_HOME/lbdb/m_inmail.db
For backward compatibility an already existing $HOME/.lbdb/m_inmail.utf-8 file is used as first preference (https://bugs.debian.org/843917)
- Loading branch information
1 parent
7fea476
commit eeb0604
Showing
7 changed files
with
70 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
.\" -*- nroff -*- | ||
.\" Copyright (c) 1998-2018 Roland Rosenfeld <[email protected]> | ||
.\" | ||
.\" Copyright (c) 1998-2023 Roland Rosenfeld <[email protected]> | ||
.\" | ||
.\" This program is free software; you can redistribute it and/or modify | ||
.\" it under the terms of the GNU General Public License as published by | ||
.\" the Free Software Foundation; either version 2 of the License, or | ||
.\" (at your option) any later version. | ||
.\" | ||
.\" | ||
.\" This program is distributed in the hope that it will be useful, | ||
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
.\" GNU General Public License for more details. | ||
.\" | ||
.\" | ||
.\" You should have received a copy of the GNU General Public License | ||
.\" along with this program; if not, write to the Free Software Foundation, | ||
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. | ||
|
@@ -20,7 +20,7 @@ | |
lbdb-fetchaddr \- grab addresses from mails and append them to lbdb database | ||
.SH SYNOPSIS | ||
.B lbdb-fetchaddr | ||
.RB [ -d | ||
.RB [ -d | ||
.IR dateformat ] | ||
.RB [ -x | ||
.IR headerfieldlist ] | ||
|
@@ -36,16 +36,20 @@ lbdb-fetchaddr \- grab addresses from mails and append them to lbdb database | |
.B lbdb-fetchaddr | ||
is a shell script which reads a mail on stdin. It extracts the | ||
contents of some header fields (default: | ||
.RB ` From: ', | ||
.RB ` To: ', | ||
.RB ` Cc: ', | ||
.RB ` Resent-From: ', | ||
.RB ` From: ', | ||
.RB ` To: ', | ||
.RB ` Cc: ', | ||
.RB ` Resent-From: ', | ||
and | ||
.RB ` Resent-To: ') | ||
from the mail header (only addresses with a real name) and appends | ||
them to the database file, which defaults to | ||
.IR $HOME/.lbdb/m_inmail.utf-8 . | ||
For performance issues | ||
.I $XDG_DATA_HOME/lbdb/m_inmail.db | ||
or | ||
.I $HOME/.lbdb/m_inmail.utf-8 | ||
if the latter already exists (backward compatibility). | ||
.PP | ||
For performance issues | ||
.B lbdb-fetchaddr | ||
appends new addresses to this file without removing duplicates. To get | ||
rid of duplicates, the program | ||
|
@@ -54,22 +58,22 @@ exists, which is run by | |
.B m_inmail | ||
if needed and removes duplicates. | ||
.PP | ||
To use this program, put the following lines into your | ||
To use this program, put the following lines into your | ||
.I $HOME/.procmailrc: | ||
.nf | ||
.nf | ||
:0hc | ||
| lbdb-fetchaddr | ||
.fi | ||
.fi | ||
.PP | ||
.B lbdb-fetchaddr | ||
writes the actual date to the third column of the database by using | ||
.BR strftime (3). | ||
It uses "%Y-%m-%d %H:%M" as the default date format (e.g. "1999-04-29 | ||
14:33"). You can change this by using the | ||
14:33"). You can change this by using the | ||
.B -d | ||
option to select a different date format string as parameter of | ||
lbdb-fetchaddr command like | ||
.nf | ||
.nf | ||
:0hc | ||
| lbdb-fetchaddr \-d "%y-%m-%d" | ||
.fi | ||
|
@@ -83,7 +87,7 @@ Print version number of lbdb-fetchaddr. | |
Print short help of lbdb-fetchaddr. | ||
.TP | ||
.BI -d " dateformat" | ||
Use the given date format using | ||
Use the given date format using | ||
.BR strftime (3) | ||
syntax. | ||
.TP | ||
|
@@ -104,13 +108,17 @@ mail address as real name. | |
.TP | ||
.BI -f " databasefile" | ||
Use the given file for storing the grabbed addresses instead of using | ||
the default | ||
.IR $HOME/.lbdb/m_inmail.utf-8 . | ||
.SH FILES | ||
the | ||
.I $XDG_DATA_HOME/lbdb/m_inmail.db | ||
resp. | ||
.I $HOME/.lbdb/m_inmail.utf-8 | ||
default. | ||
.SH FILES | ||
.I $XDG_DATA_HOME/lbdb/m_inmail.db | ||
.br | ||
.IR $HOME/.lbdb/m_inmail.utf-8 " (old version before using $XDG_DATA_HOME)" | ||
.br | ||
.IR $HOME/.lbdb/m_inmail.list " (old version used for ISO-8859-15 encoded addresses)" | ||
|
||
.br | ||
.I @libdir@/fetchaddr | ||
.br | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,18 @@ | |
# | ||
# -*-sh-*- | ||
# Copyright (C) 1998-2000 Thomas Roessler <[email protected]> | ||
# 1999-2022 Roland Rosenfeld <[email protected]> | ||
# | ||
# 1999-2023 Roland Rosenfeld <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. | ||
|
@@ -28,7 +28,9 @@ dotlock=@DOTLOCK@ | |
[ -n "$USE_LOCAL_LIB" ] && [ -x $USE_LOCAL_LIB/lbdb_dotlock ] && dotlock=$USE_LOCAL_LIB/lbdb_dotlock | ||
fetchaddr=${USE_LOCAL_LIB:-@libdir@}/fetchaddr | ||
|
||
db=$HOME/.lbdb/m_inmail.utf-8 | ||
db=${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db | ||
[ -f $HOME/.lbdb/m_inmail.utf-8 ] && db=$HOME/.lbdb/m_inmail.utf-8 | ||
|
||
datefmt='%Y-%m-%d %H:%M' | ||
additional_param="" | ||
|
||
|
@@ -43,17 +45,18 @@ usage() { | |
echo " -c 'charset' charset for the database storage" | ||
echo " -a also grep addresses without realname" | ||
echo " -f 'filename' database filename defaults to" | ||
echo " \$HOME/.lbdb/m_inmail.utf-8" | ||
echo " \$XDG_DATA_HOME/lbdb/m_inmail.db or" | ||
echo " \$HOME/.lbdb/m_inmail.utf-8 if already exists" | ||
} | ||
|
||
while [ $# -gt 0 ] | ||
do | ||
case "$1" in | ||
-v) | ||
-v) | ||
echo "lbdb-fetchaddr version $LBDB_VERSION" | ||
exit 0 | ||
;; | ||
-h) | ||
-h) | ||
usage | ||
exit 0 | ||
;; | ||
|
@@ -104,6 +107,8 @@ do | |
shift | ||
done | ||
|
||
|
||
|
||
if [ ! -f "$db" ]; then | ||
dbdir=$(dirname "$db") | ||
if [ ! -d "$dbdir" ]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
# ~/.lbdb/lbdbrc | ||
# ~/.lbdb/rc | ||
# (evaluated with ascending priority!) | ||
# | ||
# (c) 1999-2022 Roland Rosenfeld <[email protected]> | ||
# | ||
# (c) 1999-2023 Roland Rosenfeld <[email protected]> | ||
# | ||
|
||
# | ||
|
@@ -35,7 +35,7 @@ | |
# - m_palm search your Palm addressbook file. | ||
# - m_gnomecard search your GnomeCard address database files. | ||
# - m_bbdb search your BBDB (big brother database). | ||
# - m_ldap query an LDAP server | ||
# - m_ldap query an LDAP server | ||
# - m_wanderlust search your wanderlust ~/.addresses file. | ||
# - m_osx_addressbook search the OS X addressbook (only available on OS X). | ||
# - m_evolution search in the Ximan Evolution addressbook. | ||
|
@@ -46,9 +46,10 @@ METHODS="m_inmail m_passwd m_finger" | |
|
||
# | ||
# If you want to use a different database file for m_inmail, you can | ||
# define it in INMAIL_DB (defaults to $HOME/.lbdb/m_inmail.utf-8) | ||
# define it in INMAIL_DB (defaults to $XDG_DATA_HOME/lbdb/m_inmail.db or | ||
# $HOME/.lbdb/m_inmail.utf-8 if the latter exists) | ||
# | ||
#INMAIL_DB="$HOME/.lbdb/m_inmail.utf-8" | ||
#INMAIL_DB="${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db" | ||
|
||
# | ||
# If you want m_finger to ask other host then localhost, create a list here: | ||
|
@@ -149,7 +150,7 @@ METHODS="m_inmail m_passwd m_finger" | |
# - m_abook query the abook(1) program | ||
# | ||
# if you have more than one abook addressbook, use the ABOOK_FILES | ||
# variable. It contains a space separated list of all your files. | ||
# variable. It contains a space separated list of all your files. | ||
# Default is $HOME/.abook/addressbook $HOME/.abook.addressbook | ||
# ABOOK_FILES="$HOME/.abook/friends $HOME/.abook/work" | ||
|
||
|
@@ -183,7 +184,7 @@ METHODS="m_inmail m_passwd m_finger" | |
# address in m_inmail database is first). | ||
# If you set this to "name", lbdbq sorts the output by real name. | ||
# If you set this to "comment", lbdbq sorts the output by comment (column 3). | ||
# If you set this to "reverse_comment", lbdbq sorts the output by comment | ||
# If you set this to "reverse_comment", lbdbq sorts the output by comment | ||
# but with reverse order (column 3). | ||
# If you set this to "address", lbdbq sorts the output by addresses | ||
# (that's the default). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,17 @@ | |
# | ||
# Copyright (C) 1998-2000 Thomas Roessler <[email protected]> | ||
# 1999-2022 Roland Rosenfeld <[email protected]> | ||
# | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. | ||
|
@@ -21,7 +21,10 @@ prefix=@prefix@ | |
exec_prefix=@exec_prefix@ | ||
libdir=@libdir@ | ||
|
||
M_INMAIL_DB=${INMAIL_DB:-$HOME/.lbdb/m_inmail.utf-8} | ||
fallbackdb=${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db | ||
[ -f $HOME/.lbdb/m_inmail.utf-8 ] && fallbackdb=$HOME/.lbdb/m_inmail.utf-8 | ||
|
||
M_INMAIL_DB=${INMAIL_DB:-$fallbackdb} | ||
|
||
m_inmail_query() | ||
{ | ||
|