Scroll to navigation

PFTOBYFROM(1) User Contributed Perl Documentation PFTOBYFROM(1)

NAME

pftobyfrom - List "to" addresses by "from" whom in Postfix log file

Copyright (C) 2007-2025 by James S. Seymour, Release 1.3

SYNOPSIS pftobyfrom -[bhrRv] <sender> [mailfile]

    If no file(s) specified, reads from stdin.  Output is to stdout.

DESCRIPTION

    pftobyfrom parses Postfix log files to generate a list of "to" addresses,
    based on a specified "from" address or address fragment.

OPTIONS

    -b Include bounces
    -h Emit help message and exit
    -r Include rejects
    -R Hard rejects only
    -v Emit version and exit

RETURN VALUE

    pftobyfrom doesn't return anything of interest to the shell.

ERRORS

    Error messages are emitted to stderr.

EXAMPLES

    pftobyfrom example.com /var/log/maillog
    Generates a list of all the recipients of email from any senders
    in "example.com"
    As a convenience, pftobyfrom tries to intelligently determine how to
    handle regexp meta-characters.  If it's passed a search expression
    that does NOT contain meta-character escapes ("\"), it will assume
    that "." and "+" are literals, and will escape them for you.  In the
    example above, the "." in the FQDN part of the search term would've
    been automatically escaped for the user.  Likewise:
        pftobyfrom username+foo@example.com /var/log/maillog
    would have the "+" and "." escaped.  If you wanted to find all
    plussed senders for "username," you'd have to do:
        pftobyfrom 'username\+.+@example\.com' /var/log/maillog

SEE ALSO

    pflogsumm, pffrombyto

NOTES

    All search terms and searched fields are lower-cased.
    The pftobyfrom Home Page is at:
        http://jimsun.LinxNet.com/postfix_contrib.html

REQUIREMENTS

    Perl

LICENSE

    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 may have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
    USA.
    
    An on-line copy of the GNU General Public License can be found
    http://www.fsf.org/copyleft/gpl.html.
2025-05-22 1.1.11