sinntp-1.6/0000755000000000000000000000000013026007104011052 5ustar0000000000000000sinntp-1.6/utils.py0000644000000000000000000000431613026006755012603 0ustar0000000000000000# encoding=UTF-8 # Copyright © 2011-2016 # Jakub Wilk . # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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. import itertools import os import re _split_host_re = re.compile( r'^ (?: \[ ( [^\[\]]+ ) \] | ( [^:]+ ) | ( .* ) ) (?: : ([0-9]+) )? $', re.VERBOSE ) def split_host(host, default_port=None): match = _split_host_re.match(host) assert match is not None host1, host2, host3, port = match.groups() host = host1 or host2 or host3 if port is None: port = default_port else: port = int(port) return host, port class xdg(object): ''' tiny replacement for PyXDG's xdg.BaseDirectory ''' xdg_data_home = os.environ.get('XDG_DATA_HOME') or '' if not os.path.isabs(xdg_data_home): # “All paths […] must be absolute. If an implementation encounters a # relative path […] it should consider the path invalid and ignore it. # # […] # # If $XDG_DATA_HOME is either not set or empty, a default equal to # $HOME/.local/share should be used.” # # (XDG Base Directory Specification 0.8) xdg_data_home = os.path.join(os.path.expanduser('~'), '.local', 'share') @classmethod def save_data_path(xdg, resource): path = os.path.join(xdg.xdg_data_home, resource) try: os.makedirs(path, 0o700) except OSError: if not os.path.isdir(path): raise return path def join_lines(lst): r''' join the list of lines; ensure there's trailing \n at the end ''' if not lst: return b'\n' if lst[-1].endswith(b'\n'): itr = iter(lst) else: itr = itertools.chain(lst, [b'']) return b'\n'.join(itr) __all__ = [ 'join_lines', 'split_host', 'xdg', ] # vim:ts=4 sts=4 sw=4 et sinntp-1.6/tests.py0000644000000000000000000000651113026006755012604 0ustar0000000000000000# encoding=UTF-8 # Copyright © 2011-2016 # Jakub Wilk . # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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. try: import unittest2 as unittest except ImportError: import unittest import os try: # Python 3.4+ from importlib import reload except ImportError: # Python 3.3 or older from imp import reload import utils class test_split_host(unittest.TestCase): def test_domain(self): self.assertEqual( utils.split_host('news.icm.edu.pl', 119), ('news.icm.edu.pl', 119) ) def test_domain_and_port(self): self.assertEqual( utils.split_host('news.icm.edu.pl:42', 119), ('news.icm.edu.pl', 42) ) def test_ipv4(self): self.assertEqual( utils.split_host('213.135.51.10', 119), ('213.135.51.10', 119) ) def test_ipv4_and_port(self): self.assertEqual( utils.split_host('213.135.51.10:42', 119), ('213.135.51.10', 42) ) def test_ipv6(self): self.assertEqual( utils.split_host('2001:4de0:1::1:1', 119), ('2001:4de0:1::1:1', 119) ) def test_ipv6_in_brackets(self): self.assertEqual( utils.split_host('[2001:4de0:1::1:1]', 119), ('2001:4de0:1::1:1', 119) ) def test_ipv6_and_port(self): self.assertEqual( utils.split_host('[2001:4de0:1::1:1]:42', 119), ('2001:4de0:1::1:1', 42) ) class test_xdg(unittest.TestCase): def setUp(self): self._default_xdg_data_home = \ os.path.join(os.path.expanduser('~'), '.local', 'share') def _check_xdg_data_home(self, expected_path=None): if expected_path is None: expected_path = self._default_xdg_data_home reload(utils) self.assertEqual( utils.xdg.xdg_data_home, expected_path, ) def test_XDG_DATA_HOME_unset(self): os.environ.pop('XDG_DATA_HOME', None) self._check_xdg_data_home() def test_XDG_DATA_HOME_empty(self): os.environ['XDG_DATA_HOME'] = '' self._check_xdg_data_home() def test_XDG_DATA_HOME_relative(self): os.environ['XDG_DATA_HOME'] = 'eggs' self._check_xdg_data_home() def test_XDG_DATA_HOME_absolute(self): os.environ['XDG_DATA_HOME'] = '/eggs' self._check_xdg_data_home('/eggs') class test_join_lines(unittest.TestCase): def test_empty(self): lst = [] s = utils.join_lines(lst) self.assertEqual(s, b'\n') def test_trailing_lf(self): lst = [b'eggs', b'bacon', b'spam'] s = utils.join_lines(lst) self.assertEqual(s, b'eggs\nbacon\nspam\n') def test_no_trailing_lf(self): lst = [b'eggs', b'bacon', b'spam\n'] s = utils.join_lines(lst) self.assertEqual(s, b'eggs\nbacon\nspam\n') if __name__ == '__main__': unittest.main() # vim:ts=4 sts=4 sw=4 et sinntp-1.6/sinntp0000755000000000000000000003300413026006755012326 0ustar0000000000000000#!/usr/bin/env python3 # encoding=UTF-8 # Copyright © 2008-2016 # Piotr Lewandowski , # Jakub Wilk . # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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. from __future__ import print_function __author__ = ('Jakub Wilk', 'Piotr Lewandowski') __version__ = '1.6' from nntplib import NNTP, NNTP_PORT, NNTPTemporaryError, NNTPError import argparse import email import email.generator import errno import functools import io import logging import logging.handlers import mailbox import nntplib import os import os.path import signal import socket import sys import plugins import utils # nntplib limits line length to 2048 bytes to prevent denial of service # (CVE-2013-1752). But the line length limit doesn't buy us much, because # sinntp loads the whole message into memory anyway. So let's lift the limit to # 1 megabyte. # # References: # * https://github.com/jwilk/sinntp/issues/9 # * https://bugs.python.org/issue16040 nntplib._MAXLINE = 1 << 20 class Config(object): def __init__(self, hostname, port): self._hostname = hostname self._port = port self._root = os.getenv('SINNTP_HOME') if self._root: logging.warn('$SINNTP_HOME is deprecated in favor of $XDG_DATA_HOME. See the NEWS file for details.') return self._root = os.path.expanduser('~/.sinntp/') if os.path.exists(self._root): logging.warn('$HOME/.sinntp/ is deprecated in favor of $XDG_DATA_HOME. See the NEWS file for details.') return self._root = utils.xdg.save_data_path('sinntp') def _get_file_name(self, name): base_name = '%s@%s' % (name, self._hostname) if self._port != NNTP_PORT: base_name += '_%d' % self._port return os.path.join(self._root, base_name) def __getitem__(self, name): try: file = open(self._get_file_name(name), 'rt', encoding='ASCII') except IOError as ex: if ex.errno == errno.ENOENT: return 0 raise try: return int(file.read()) finally: file.close() def __setitem__(self, name, value): path = self._get_file_name(name) file = open(path + '_tmp', 'wt', encoding='ASCII') try: file.write(str(value)) os.fsync(file.fileno()) finally: file.close() os.rename(path + '_tmp', path) class Command(object): def get_option_parser(self): o = argparse.ArgumentParser(usage=self.__doc__.rstrip()) o.add_argument('--version', action='version', version='%(prog)s ' + __version__, help='show program\'s version number and exit') o.add_argument('-s', '--syslog', dest='syslog', action='store_true', help='use syslog for logging') o.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='be more verbose') o.add_argument('-q', '--quiet', dest='verbose', action='store_false', help='be less verbose') o.add_argument('-p', '--plugin', dest='plugins', action='append', metavar='PLUGIN', help='use plugin') o.add_argument('-S', '--server', metavar='HOST[:PORT]', dest='server', action='store', help='specify server address') o.add_argument('-U', '--username', dest='username', action='store', help='specify username') o.add_argument('-P', '--password', dest='password', action='store', help='specify password') o.add_argument('--no-netrc', dest='netrc', action='store_false', help='ignore credentials in ~/.netrc') o.add_argument('-t', '--timeout', dest='timeout', action='store', type=int, help='specify connection timeout') return o def __init__(self, argv): oparser = self.get_option_parser() self.options, self.args = oparser.parse_known_args(argv) try: self.command_name = self.args.pop(0) except IndexError: oparser.error('A command is expected') self.plugins = [] for spec in self.options.plugins or (): spec = spec.split(':') name = spec.pop(0) args = [arg for arg in spec if '=' not in arg] kwargs = dict(arg.split('=', 1) for arg in spec if '=' in arg) self.plugins += functools.partial(plugins.__dict__[name], *args, **kwargs), self.oparser = oparser def __call__(self): pass class Pull(Command): ''' nntp-pull [options] groupname[>filename] [groupname[>filename] ...] ''' def get_option_parser(self): o = Command.get_option_parser(self) o.add_argument('--limit', dest='limit', type=int, action='store', metavar='N', help='pull at most N messages') o.add_argument('--reget', dest='reget', action='store_true', help='start from the first available message') return o def __init__(self, argv): Command.__init__(self, argv) if not self.args: self.oparser.error('At least one group name is required') self.groups = self.args del self.args def fetch(self, connection, group_name, start): logging.info('Looking for group %r.', group_name) response, count, first, last, name = connection.group(group_name) count, first, last = (int(x) for x in (count, first, last)) i = max(start, first) count = max(last - i + 1, 0) logging.info('%(count)s message%(plural)s to download.' % dict( count = count if count else 'No', plural = 's' if count != 1 else '' )) while i <= last: try: connection.stat(str(i)) except NNTPTemporaryError: i += 1 else: break else: return no = str(i) while True: _, (_, message_id, body) = connection.article(no) logging.debug('Reading message %s.', message_id) yield int(no), body try: _, no, _ = connection.next() except NNTPTemporaryError as ex: if ex.response.startswith('421'): break raise def __call__(self, connection): config = Config(connection.host, connection.port) for group in self.groups: if '>' in group: group, mbox_name = group.split('>', 1) else: mbox_name = group mbox = None atime = None mode = None last = None start = config[group] if not self.options.reget else 0 if self.options.limit is not None: _, _, _, end, _ = connection.group(group) start = max(start, int(end) - self.options.limit + 1) try: for no, message in self.fetch(connection, group, start): if mbox is None: mbox = mailbox.mbox(mbox_name, create=True) mbox.lock() stat = os.stat(mbox_name) atime = stat.st_atime mode = stat.st_mode message = utils.join_lines(message) message = email.message_from_bytes(message) for plugin in self.plugins: message = plugin(message=message) if message is None: break if message is not None: mbox.add(message) last = no finally: if mbox is not None: mbox.close() if atime is not None: mtime = os.stat(mbox_name).st_mtime os.utime(mbox_name, (atime, mtime)) if mode is not None: os.chmod(mbox_name, mode) if last is not None: config[group] = last + 1 class Push(Command): ''' nntp-push [options] [newsgroups...] ''' def __call__(self, connection): message = email.message_from_binary_file(sys.stdin.buffer) if 'Newsgroups' not in message and self.args: message['Newsgroups'] = ','.join(self.args) for plugin in self.plugins: message = plugin(message=message) buffer = io.BytesIO() generator = email.generator.BytesGenerator(buffer, mangle_from_=False) generator.flatten(message) buffer.seek(0) connection.post(buffer) class Get(Command): ''' nntp-get message-id ''' def __init__(self, argv): Command.__init__(self, argv) if len(self.args) != 1: self.oparser.error('A single message-id is required') [self.message_id] = self.args if '@' not in self.message_id: self.oparser.error('Message-id is malformed (\'@\' is missing)') if self.message_id[0] + self.message_id[-1] != '<>': self.message_id = '<%s>' % self.message_id del self.args def __call__(self, connection): logging.debug('Reading message %s.', self.message_id) _, (_, _, message) = connection.article(self.message_id) message = utils.join_lines(message) sys.stdout.buffer.write(message) class List(Command): ''' nntp-list ''' def __init__(self, argv): Command.__init__(self, argv) if len(self.args) != 0: self.oparser.error('This command takes no arguments') def __call__(self, connection): _, groups = connection.list() for group, _, _, _ in groups: # RFC 3997 §10.2 says that group names SHOULD be restricted to # US-ASCII and that 8-bit encodings SHOULD NOT be used. # But non-UTF-8 group names have been seen in the wild, # so let's handle them gracefully. bgroup = group.encode('UTF-8', 'surrogateescape') sys.stdout.buffer.write(bgroup) sys.stdout.buffer.write(b'\n') class BaseCommand(Command): COMMANDS = dict( pull = Pull, push = Push, get = Get, list = List, ) __doc__ = ''.join( command.__doc__.rstrip() for command in COMMANDS.values() ) def get_option_parser(self): oparser = Command.get_option_parser(self) return oparser def __init__(self, argv): Command.__init__(self, argv) try: self.command_class = self.COMMANDS[self.command_name] except KeyError: self.oparser.error('Unknown command: %r.' % self.command_name) sys.argv[0] = 'nntp-%s' % self.command_name def setup_logging(syslog, verbose): logger = logging.getLogger() format = '%(message)s' if not syslog: handler = logging.StreamHandler() else: handler = logging.handlers.SysLogHandler( '/dev/log', facility = logging.handlers.SysLogHandler.LOG_NEWS ) format = ''.join((sys.argv[0], '[%(process)d]: ', format)) formatter = logging.Formatter(format, None) handler.setFormatter(formatter) logger.addHandler(handler) level = { True: logging.DEBUG, None: logging.INFO, False: logging.ERROR, }.get(verbose) logger.setLevel(level) class TerminatedBySignal(Exception): pass def setup_signal_handler(signame): def handler(signo, frame): raise TerminatedBySignal(signame) signal.signal(getattr(signal, signame), handler) def get_default_nntp_server(): server = os.getenv('NNTPSERVER') if server: return server try: file = open('/etc/news/server', encoding='ASCII') except IOError as exc: if exc.errno == errno.ENOENT: return raise with file: return file.readline().strip() if __name__ == '__main__': argv = sys.argv[1:] base_command = BaseCommand(argv) command = base_command.command_class(argv) setup_signal_handler('SIGTERM') setup_logging(command.options.syslog, command.options.verbose) if sys.version_info < (3, 2): # E-mail and NNTP modules are broken in Python 3.1: # https://docs.python.org/dev/whatsnew/3.2.html#new-improved-and-deprecated-modules logging.error('Python >= 3.2 is required') host = command.options.server or get_default_nntp_server() if host is None: sys.stderr.write('NNTP server is not specified.\n') sys.exit(2) host, port = utils.split_host(host, NNTP_PORT) socket.setdefaulttimeout(command.options.timeout) try: logging.info('Connecting to %s:%d...', host, port) connection = NNTP(host, port=port, user=command.options.username, password=command.options.password, readermode=True, usenetrc=command.options.netrc ) except socket.error as e: logging.error('Could not connect to %s:%d: %s', host, port, e.strerror) sys.exit(3) except NNTPError as e: logging.error('%s:%d returned an error: %s', host, port, e) sys.exit(4) try: command(connection) except NNTPError as e: logging.error('NNTP error: %s', e) sys.exit(4) connection.quit() logging.info('Connection to %s:%d closed.', host, port) # vim:ts=4 sts=4 sw=4 et sinntp-1.6/private/0000755000000000000000000000000013026007104012524 5ustar0000000000000000sinntp-1.6/private/update-version0000755000000000000000000000040613026006755015432 0ustar0000000000000000#!/bin/sh version=${1:?"no version number provided"} set -e set -x dch -m -v "$version" -u low -c doc/changelog sed -i -r -e "s/<(!ENTITY version) '[0-9.]+'>/<\1 '$version'>/" doc/manpages/*.xml sed -i -r -e "s/(__version__) = '[0-9.]+'/\1 = '$version'/" sinntp sinntp-1.6/private/run-pyflakes0000755000000000000000000000134213026006755015105 0ustar0000000000000000#!/bin/sh # Copyright © 2016 Jakub Wilk # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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. PYTHON=${PYTHON:-python3} "$PYTHON" -m pyflakes --version > /dev/null || exit 1 if [ $# -eq 0 ] then set -- \ $(grep -l -r '^#!.*python' .) \ $(find . -name '*.py') fi exec "$PYTHON" -m pyflakes "$@" # vim:ts=4 sts=4 sw=4 et sinntp-1.6/plugins.py0000644000000000000000000000214713026006755013124 0ustar0000000000000000# encoding=UTF-8 # Copyright © 2008-2015 # Piotr Lewandowski , # Jakub Wilk . # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License, version 2, as # published by the Free Software Foundation. # # 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. from __future__ import print_function def debug(*args, **kwargs): print('debug(*%r, **%r)' % (args, kwargs)) def strip_headers(headers='To,Cc,Bcc', message=None): headers = headers.split(',') for header in headers: del message[header] return message def mimify(type='text/plain', charset='US-ASCII', message=None): if 'Content-Type' not in message: message['Content-Type'] = '%(type)s; charset=%(charset)s' % locals() return message __all__ = [ 'debug', 'mimify', 'strip_headers', ] # vim:ts=4 sts=4 sw=4 et sinntp-1.6/nntp-push0000755000000000000000000000006013026006755012743 0ustar0000000000000000#!/bin/sh exec "${0%/*}/sinntp" "${0##*-}" "$@" sinntp-1.6/nntp-pull0000755000000000000000000000006013026006755012740 0ustar0000000000000000#!/bin/sh exec "${0%/*}/sinntp" "${0##*-}" "$@" sinntp-1.6/nntp-list0000755000000000000000000000006013026006755012737 0ustar0000000000000000#!/bin/sh exec "${0%/*}/sinntp" "${0##*-}" "$@" sinntp-1.6/nntp-get0000755000000000000000000000006013026006755012543 0ustar0000000000000000#!/bin/sh exec "${0%/*}/sinntp" "${0##*-}" "$@" sinntp-1.6/doc/0000755000000000000000000000000013026007104011617 5ustar0000000000000000sinntp-1.6/doc/COPYING0000644000000000000000000004325413026006755012675 0ustar0000000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. sinntp-1.6/doc/mutt-integration.txt0000644000000000000000000000170413026006755015707 0ustar0000000000000000============================ Integrating sinntp with mutt ============================ Since sinntp stores newsgroups in mboxes, adding them to mutt is simple, see description of ``mailboxes`` command in Mutt documentation for details. Posting to newsgroups requires adding folder hooks: :: folder-hook . unmy_hdr To folder-hook . unset sendmail `for group in ${SINNTP_HOME:-$HOME/.sinntp}/*; do \ group="$(basename $group | cut -d@ -f1)"; \ echo -n folder-hook \"^${group}$\" \" \ my_hdr To: $group \; \ set sendmail=\'nntp-push -p strip_headers\' \ \"\; ; \ done` Please pay attention to ``sendmail`` variable since it's unset in folder-hook which matches all folder names. You may want to set a default value there. ``autoedit`` variable is also worth noticing when posting to newsgroups since ``To:`` header is added automatically in above configuration. .. vim:ft=rst ts=4 sts=4 sw=4 et sinntp-1.6/doc/manpages/0000755000000000000000000000000013026007112013411 5ustar0000000000000000sinntp-1.6/doc/manpages/nntp-push.10000644000000000000000000000407513026007112015435 0ustar0000000000000000'\" t .\" Title: nntp-push .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/19/2016 .\" Manual: nntp-push manual .\" Source: nntp-push 1.6 .\" Language: English .\" .TH "NNTP\-PUSH" "1" "2016-12-19" "nntp-push 1\&.6" "nntp-push manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nntp-push \- send an article to the server .SH "SYNOPSIS" .HP \w'\fBnntp\-push\fR\ 'u \fBnntp\-push\fR [\fIoptions\fR...] \fInewsgroups\fR... .SH "DESCRIPTION" .PP Read a message in RFC 822 format from the standard input and send it to the server\&. Newsgroups can be specified in two manners: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} as a command\-line arguments, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} in the Newsgroups header of the message\&. .RE .sp The latter method takes precedence over command\-line arguments\&. Read message can be altered by the specified plugins which are described along with global options in \fBsinntp\fR(1)\&. .SH "SEE ALSO" .PP \fBsinntp\fR(1) .SH "COPYRIGHT" .br Copyright \(co 2009, 2010, 2011, 2012 Piotr Lewandowski, Jakub Wilk .br sinntp-1.6/doc/manpages/nntp-list.10000644000000000000000000000330413026007111015422 0ustar0000000000000000'\" t .\" Title: nntp-list .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/19/2016 .\" Manual: nntp-list manual .\" Source: nntp-list 1.6 .\" Language: English .\" .TH "NNTP\-LIST" "1" "2016-12-19" "nntp-list 1\&.6" "nntp-list manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nntp-list \- print a list of available newsgroups .SH "SYNOPSIS" .HP \w'\fBnntp\-list\fR\ 'u \fBnntp\-list\fR [\fIoptions\fR...] .SH "DESCRIPTION" .PP Print a list of available newsgroups to the standard output\&. .PP This commands takes neither command\-specific options nor arguments\&. .PP Global options are described in \fBsinntp\fR(1)\&. .SH "SEE ALSO" .PP \fBsinntp\fR(1) .SH "COPYRIGHT" .br Copyright \(co 2009, 2010, 2011, 2012 Piotr Lewandowski, Jakub Wilk .br sinntp-1.6/doc/manpages/sinntp.10000644000000000000000000001241613026007110015010 0ustar0000000000000000'\" t .\" Title: sinntp .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/19/2016 .\" Manual: sinntp manual .\" Source: sinntp 1.6 .\" Language: English .\" .TH "SINNTP" "1" "2016-12-19" "sinntp 1\&.6" "sinntp manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sinntp \- tiny non\-interactive NNTP client .SH "SYNOPSIS" .HP \w'\fBsinntp\fR\ 'u \fBsinntp\fR \fIcommand\fR [\fIoptions\fR...] [\fIargs\fR...] .SH "DESCRIPTION" .PP \fBsinntp\fR is a tiny NNTP client originally designed to work in non\-interactive mode\&. Following operations are supported: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} sending articles to the server, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} fetching new articles to the mbox file, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} downloading individual messages in RFC822 format, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} listing available newsgroups\&. .RE .SH "COMMANDS" .PP \fBsinntp\fR provides following commands: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} get, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} list, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} pull, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} push\&. .RE .sp Above commands may also be invoked via convenience wrappers named in \fBnntp\-\fR\fB\fIcommand\fR\fR scheme (e\&.g\&. \fBnntp\-get\fR)\&. See wrappers\*(Aq manual pages for command synopsis and description\&. .SH "GLOBAL OPTIONS" .PP \fB\-\-version\fR .RS 4 Show program\*(Aqs version number and exit\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show short help message end exit\&. .RE .PP \fB\-v\fR, \fB\-\-verbose\fR .RS 4 Be more verbose (use multiple times to increase verbosity)\&. .RE .PP \fB\-q\fR, \fB\-\-quiet\fR .RS 4 Be less verbose (use multiple times to decrease verbosity)\&. .RE .PP \fB\-p\fR, \fB\-\-plugin=\fR\fB\fIplugin\fR\fR .RS 4 Load and use \fIplugin\fR\&. .RE .PP \fB\-S\fR, \fB\-\-server=\fR\fB\fIhost\fR\fR, \fB\-\-server=\fR\fB\fIhost\fR\fR\fB:\fR\fB\fIport\fR\fR .RS 4 Connect to the specified \fIhost\fR and \fIport\fR\&. If omitted \fBsinntp\fR will use address stored in /etc/nntp/server file or in \fINNTPSERVER\fR variable (the latter takes precedence over the former)\&. .RE .PP \fB\-U\fR, \fB\-\-username=\fR\fB\fIusername\fR\fR .RS 4 Use specified \fIusername\fR for authentication\&. .RE .PP \fB\-P\fR, \fB\-\-password=\fR\fB\fIpassword\fR\fR .RS 4 Use specified \fIpassword\fR for authentication\&. .sp Use with caution! The password may be visible to other users of the system\&. .RE .PP \fB\-\-no\-netrc\fR .RS 4 Do not attempt to read authentication credentials (username, password) from the ~/\&.netrc file\&. .RE .PP \fB\-t\fR, \fB\-\-timeout=\fR\fB\fItimeout\fR\fR .RS 4 Wait maximum \fItimeout\fR seconds during communication with the server\&. .RE .PP Also, a particular command can support additional options\&. .SH "PLUGINS" .PP Pulled and pushed messages can be altered by the plugin mechanism\&. Currently \fBsinntp\fR package includes following plugins: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBmimify\fR \- add default charset to the message when it is not present, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBstrip_headers\fR \- strip specified headers from message\&. .RE .sp .SH "ENVIRONMENT VARIABLES" .PP NNTPSERVER .RS 4 Address of the default NNTP server\&. It can be overridden by \fB\-\-server\fR option\&. .RE .PP XDG_DATA_HOME .RS 4 Location of sinntp data directory\&. See \m[blue]\fBXDG Base Directory Specification\fR\m[]\&\s-2\u[1]\d\s+2 for details\&. .RE .SH "FILES" .PP /etc/news/server .RS 4 A file with NNTP server address\&. Can be overridden by \fINNTPSERVER\fR environment variable or \fB\-\-server\fR option\&. .RE .PP \fI$XDG_DATA_HOME\fR/sinntp/ .RS 4 Location of sinntp data files\&. .RE .SH "SEE ALSO" .PP \fBnntp-get\fR(1), \fBnntp-list\fR(1), \fBnntp-push\fR(1), \fBnntp-pull\fR(1) .SH "COPYRIGHT" .br Copyright \(co 2009, 2010, 2011, 2012 Piotr Lewandowski, Jakub Wilk .br .SH "NOTES" .IP " 1." 4 XDG Base Directory Specification .RS 4 \%https://specifications.freedesktop.org/basedir-spec/latest/ .RE sinntp-1.6/doc/manpages/nntp-pull.10000644000000000000000000000514313026007107015433 0ustar0000000000000000'\" t .\" Title: nntp-pull .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/19/2016 .\" Manual: nntp-pull manual .\" Source: nntp-pull 1.6 .\" Language: English .\" .TH "NNTP\-PULL" "1" "2016-12-19" "nntp-pull 1\&.6" "nntp-pull manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nntp-pull \- fetch articles from the server to the mbox .SH "SYNOPSIS" .HP \w'\fBnntp\-pull\fR\ 'u \fBnntp\-pull\fR [\fIoptions\fR...] \fIgroupname\fR [\fIgroupname\fR...] .SH "DESCRIPTION" .PP Fetch messages from the server and save them into the mailbox (mbox format)\&. Every argument is supposed to be a name of group, optionally followed by a \*(Aq>\*(Aq character and mbox filename\&. If the mbox filename is omitted, it defaults to the name of the group\&. .PP Besides global options (described in \fBsinntp\fR(1)), \fBnntp\-pull\fR command takes following options: .PP \fB\-\-limit=\fR\fB\fIN\fR\fR .RS 4 Pull at most \fIN\fR messages\&. .RE .PP \fB\-\-reget\fR .RS 4 Start from the first available message\&. .RE .SH "EXAMPLES" .PP \fBnntp\-pull \-\-server=news\&.example\&.org \-\-limit=50 \*(Aqcomp\&.os\&.linux>os\-linux\*(Aq\fR Fetches at most the 50 newest articles from the newsgroup comp\&.os\&.linux located on news\&.example\&.org server and appends them to the os\-linux mailbox file\&. .PP \fBnntp\-pull \-\-server=news\&.example\&.net \-\-reget \-\-limit=3 comp\&.os\&.windows\fR Fetches at most the 3 oldest articles from the newsgroup comp\&.os\&.windows located on news\&.example\&.net server and appends them to the comp\&.os\&.windows mailbox file\&. .SH "SEE ALSO" .PP \fBsinntp\fR(1) .SH "COPYRIGHT" .br Copyright \(co 2009, 2010, 2011 Piotr Lewandowski, Jakub Wilk .br sinntp-1.6/doc/manpages/nntp-get.10000644000000000000000000000352013026007106015232 0ustar0000000000000000'\" t .\" Title: nntp-get .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/19/2016 .\" Manual: nntp-get manual .\" Source: nntp-get 1.6 .\" Language: English .\" .TH "NNTP\-GET" "1" "2016-12-19" "nntp-get 1\&.6" "nntp-get manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" nntp-get \- print out a single article .SH "SYNOPSIS" .HP \w'\fBnntp\-get\fR\ 'u \fBnntp\-get\fR [\fIoptions\fR...] \fImessage\-id\fR .SH "DESCRIPTION" .PP Print a single article to the standard output\&. The requested article is specified by the value of Message\-Id header\&. .PP A single \fImessage\-id\fR argument is a value of the requested article\*(Aqs Message\-Id header\&. It can be provided with or without angle brackets\&. .PP Global options are described in \fBsinntp\fR(1)\&. .SH "SEE ALSO" .PP \fBsinntp\fR(1) .SH "COPYRIGHT" .br Copyright \(co 2009, 2010, 2011, 2012 Piotr Lewandowski, Jakub Wilk .br sinntp-1.6/doc/manpages/sinntp.xml0000644000000000000000000001666213026006755015475 0ustar0000000000000000 ]> &p; manual &p; 2009 2010 2011 2012 Piotr Lewandowski Jakub Wilk &p; 1 &version; &p; tiny non-interactive NNTP client &p; command options args Description &p; is a tiny NNTP client originally designed to work in non-interactive mode. Following operations are supported: sending articles to the server, fetching new articles to the mbox file, downloading individual messages in RFC822 format, listing available newsgroups. Commands &p; provides following commands: get, list, pull, push. Above commands may also be invoked via convenience wrappers named in nntp-command scheme (e.g. nntp-get). See wrappers' manual pages for command synopsis and description. Global options Show program's version number and exit. Show short help message end exit. Be more verbose (use multiple times to increase verbosity). Be less verbose (use multiple times to decrease verbosity). Load and use plugin. Connect to the specified host and port. If omitted sinntp will use address stored in /etc/nntp/server file or in NNTPSERVER variable (the latter takes precedence over the former). Use specified username for authentication. Use specified password for authentication. Use with caution! The password may be visible to other users of the system. Do not attempt to read authentication credentials (username, password) from the ~/.netrc file. Wait maximum timeout seconds during communication with the server. Also, a particular command can support additional options. Plugins Pulled and pushed messages can be altered by the plugin mechanism. Currently &p; package includes following plugins: mimify - add default charset to the message when it is not present, strip_headers - strip specified headers from message. Environment variables NNTPSERVER Address of the default NNTP server. It can be overridden by option. XDG_DATA_HOME Location of sinntp data directory. See XDG Base Directory Specification for details. Files /etc/news/server A file with NNTP server address. Can be overridden by NNTPSERVER environment variable or option. $XDG_DATA_HOME/sinntp/ Location of sinntp data files. See also nntp-get 1 , nntp-list 1 , nntp-push 1 , nntp-pull 1 sinntp-1.6/doc/manpages/nntp-push.xml0000644000000000000000000000350313026006755016104 0ustar0000000000000000 ]> &p; manual &p; 2009 2010 2011 2012 Piotr Lewandowski Jakub Wilk &p; 1 &version; &p; send an article to the server &p; options newsgroups Description Read a message in RFC 822 format from the standard input and send it to the server. Newsgroups can be specified in two manners: as a command-line arguments, in the Newsgroups header of the message. The latter method takes precedence over command-line arguments. Read message can be altered by the specified plugins which are described along with global options in sinntp 1 . See also sinntp 1 sinntp-1.6/doc/manpages/nntp-pull.xml0000644000000000000000000000543513026006755016107 0ustar0000000000000000 ]> &p; manual &p; 2009 2010 2011 Piotr Lewandowski Jakub Wilk &p; 1 &version; &p; fetch articles from the server to the mbox &p; options groupname groupname Description Fetch messages from the server and save them into the mailbox (mbox format). Every argument is supposed to be a name of group, optionally followed by a '>' character and mbox filename. If the mbox filename is omitted, it defaults to the name of the group. Besides global options (described in sinntp 1 ), &p; command takes following options: Pull at most N messages. Start from the first available message. Examples &p; --server=news.example.org --limit=50 'comp.os.linux>os-linux' Fetches at most the 50 newest articles from the newsgroup comp.os.linux located on news.example.org server and appends them to the os-linux mailbox file. &p; --server=news.example.net --reget --limit=3 comp.os.windows Fetches at most the 3 oldest articles from the newsgroup comp.os.windows located on news.example.net server and appends them to the comp.os.windows mailbox file. See also sinntp 1 sinntp-1.6/doc/manpages/nntp-list.xml0000644000000000000000000000274313026006755016105 0ustar0000000000000000 ]> &p; manual &p; 2009 2010 2011 2012 Piotr Lewandowski Jakub Wilk &p; 1 &version; &p; print a list of available newsgroups &p; options Description Print a list of available newsgroups to the standard output. This commands takes neither command-specific options nor arguments. Global options are described in sinntp 1 . See also sinntp 1 sinntp-1.6/doc/manpages/nntp-get.xml0000644000000000000000000000326413026006755015710 0ustar0000000000000000 ]> &p; manual &p; 2009 2010 2011 2012 Piotr Lewandowski Jakub Wilk &p; 1 &version; &p; print out a single article &p; options message-id Description Print a single article to the standard output. The requested article is specified by the value of Message-Id header. A single message-id argument is a value of the requested article's Message-Id header. It can be provided with or without angle brackets. Global options are described in sinntp 1 . See also sinntp 1 sinntp-1.6/doc/manpages/Makefile0000644000000000000000000000063313026006755015067 0ustar0000000000000000XSL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl XSLTPROC = xsltproc --nonet --param man.charmap.use.subset 0 XML_FILES = $(wildcard *.xml) MAN_FILES = $(XML_FILES:.xml=.1) .PHONY: all all: $(MAN_FILES) %.1: %.xml $(XSLTPROC) $(XSL) $(<) sed -i -e '/^[.]TH/ { s/"[0-9/]\{10\}"/"$(shell date +%F)"/ }' $(@) .PHONY: clean clean: rm -f $(MAN_FILES) # vim:ts=4 sts=4 sw=4 noet sinntp-1.6/doc/changelog.old0000644000000000000000000000265713026006755014273 0ustar0000000000000000sinntp (0.94) unstable; urgency=low * Check for lost connections. -- Jakub Wilk Fri, 22 Sep 2006 20:29:22 +0200 sinntp (0.93) unstable; urgency=low * Don't stop reading messages if reading a message failed. -- Jakub Wilk Sun, 10 Sep 2006 11:48:15 +0200 sinntp (0.92) unstable; urgency=low * Provide a manual page. * 'From ' quoting. * Better error handling. -- Jakub Wilk Fri, 1 Sep 2006 20:07:51 +0200 sinntp (0.91) unstable; urgency=low * Remove locks if reading a message failed. -- Jakub Wilk Thu, 20 Jul 2006 11:35:49 +0200 sinntp (0.90) unstable; urgency=low * Remove locks if accessing a newsgroup failed. -- Jakub Wilk Tue, 11 Jul 2006 09:59:29 +0200 sinntp (0.89) unstable; urgency=low * Fix a typo: sinttp -> sinntp -- Jakub Wilk Sat, 8 Apr 2006 10:10:54 +0200 sinntp (0.88) unstable; urgency=low * Fix the arguments parsing. -- Jakub Wilk Sat, 11 Mar 2006 19:16:03 +0100 sinntp (0.87) unstable; urgency=low * Write help and version messages. -- Jakub Wilk Fri, 24 Feb 2006 19:58:14 +0100 sinntp (0.86) unstable; urgency=low * Cosmetic fixes. -- Jakub Wilk Sat, 18 Feb 2006 23:08:43 +0100 sinntp (0.85) unstable; urgency=low * Initial release -- Jakub Wilk Thu, 17 Nov 2005 15:24:06 +0100 sinntp-1.6/doc/changelog0000644000000000000000000000734013026006755013510 0ustar0000000000000000sinntp (1.6) unstable; urgency=low * Use /usr/bin/env in shebangs. * Port to Python 3. Thanks to Ralf Ramsauer for the bug report and the initial porting work. -- Jakub Wilk Mon, 19 Dec 2016 17:41:13 +0100 sinntp (1.5.3) unstable; urgency=low * Drop support for Python 2.5. * Fix documentation typos. * Update bug tracker URLs. https://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html * Update the XDG Base Directory Specification URL. -- Jakub Wilk Fri, 11 Mar 2016 23:00:35 +0100 sinntp (1.5.2) unstable; urgency=low * Update the state file atomically. * Exit gracefully, updating the state file, when killed with SIGTERM. https://github.com/jwilk/sinntp/issues/15 -- Jakub Wilk Thu, 10 Jul 2014 12:14:38 +0200 sinntp (1.5.1) unstable; urgency=low * Lift the line length limit to 1 megabyte. https://github.com/jwilk/sinntp/issues/9 * If an exception occurred, don't bother sending the QUIT command to the server, to avoid provoking further exceptions with misleading tracebacks. -- Jakub Wilk Tue, 29 Apr 2014 21:42:47 +0200 sinntp (1.5) unstable; urgency=low * Always use our own implementation of XDG Base Directory instead of PyXDG. * Ignore relative paths in XDG_* variables. * Add --no-netrc option that ignores ~/.netrc credentials. Thanks to Dirk Griesbach for the bug report and the initial patch. https://bugs.debian.org/668927 -- Jakub Wilk Wed, 18 Apr 2012 20:52:07 +0200 sinntp (1.4) unstable; urgency=low * Use the argparse (rather than optparse) module to parse options. * Send a ‘mode reader’ command before authentication. Thanks to Pierre Habouzit for the bug report. * Allow specifying port number for the -S/--server option. https://github.com/jwilk/sinntp/issues/8 * Fall back to our own minimal XDG Base Directory implementation if PyXDG is not found. * Add some tests. -- Jakub Wilk Wed, 27 Jul 2011 18:01:51 +0200 sinntp (1.3.2) unstable; urgency=low * Fix Python 2.6 deprecation warnings. https://bugs.debian.org/585839 -- Jakub Wilk Wed, 23 Jun 2010 23:36:08 +0200 sinntp (1.3.1) unstable; urgency=low [ Piotr Lewandowski ] * Add missing commas in sinntp manpage. [ Jakub Wilk ] * Fix typos in the manual pages. * Include full copy of the GPL license. -- Piotr Lewandowski Wed, 13 Jan 2010 09:34:36 +0100 sinntp (1.3) unstable; urgency=low * Follow the XDG Base Directory Specification. * Add manual pages. https://github.com/jwilk/sinntp/issues/2 -- Piotr Lewandowski Thu, 17 Sep 2009 19:01:09 +0200 sinntp (1.2) unstable; urgency=low * Introduce the 'list' command. * Fix command name parsing. -- Piotr Lewandowski Tue, 18 Aug 2009 18:33:18 +0200 sinntp (1.1.1) unstable; urgency=low [ Piotr Lewandowski ] * Fix command line arguments parsing. https://github.com/jwilk/sinntp/issues/7 [ Jakub Wilk ] * Don't use symlinks. -- Jakub Wilk Sat, 27 Jun 2009 19:09:30 +0200 sinntp (1.1) unstable; urgency=low * Add the --quiet option. * Add the --timeout option. https://github.com/jwilk/sinntp/issues/6 * Handle socket exceptions gracefully. * Handle connection NNTP errors gracefully. * Allow providing newsgroup names as arguments for nntp-push. * Introduce the 'get' command and provide nntp-get symlink. -- Piotr Lewandowski Tue, 16 Jun 2009 15:09:53 +0200 sinntp (1.0) unstable; urgency=low * Rewritten from scratch in Python. -- Jakub Wilk Wed, 14 Jan 2009 14:17:36 +0100 sinntp-1.6/doc/NEWS0000644000000000000000000000101113026006755012322 0ustar0000000000000000sinntp (1.3) Support for $SINNTP_HOME environment variable was dropped in favor of respecting the XDG Base Directory Specification. If there is no $XDG_DATA_HOME variable set, sinntp stores its data in $HOME/.local/share/sinntp. You should move existing .sinntp directory to the new location before invoking a new version of sinntp. Support for the old location will be completely dropped in the next major release (2.0). -- Piotr Lewandowski Thu, 17 Sep 2009 17:44:22 +0200