Skip to main content

View/select the URLs in an email message or file

Project description

Contributors

Daniel Burrows <dburrows@debian.org> (Original Author)

Scott Hansen <firecat4153@gmail.com> (Maintainer)

Maxime Chatelle <xakz@rxsoft.eu> (Debian Maintainer)

Purpose and Requirements

Urlscan is a small program that is designed to integrate with the “mutt” mailreader to allow you to easily launch a Web browser for URLs contained in email messages. It is a replacement for the “urlview” program.

Requires: Python 2.6+ (including Python 3.x) and the python-urwid library

Features

Urlscan parses an email message or file and scans it for URLs and email addresses. It then displays the URLs and their context within the message, and allows you to choose one or more URLs to send to your Web browser. Alternatively, it send a list of all URLs to stdout.

Relative to urlview, urlscan has the following additional features:

  • Support for emails in quoted-printable and base64 encodings. No more stripping out =40D from URLs by hand!

  • The context of each URL is provided along with the URL. For HTML mails, a crude parser is used to render the HTML into text.

Installation and setup

To install urlscan, install from your distribution repositories, from Pypi, install the Archlinux Package , or install from source using setup.py.

Once urlscan is installed, add the following lines to your .muttrc:

macro index,pager cb “<pipe-message> urlscan<Enter>” “call urlscan to extract URLs out of a message”

macro attach,compose cb “<pipe-entry> urlscan<Enter>” “call urlscan to extract URLs out of a message”

Once this is done, Control-b while reading mail in mutt will automatically invoke urlscan on the message.

To choose a particular browser, set the environment variable BROWSER:

export BROWSER=/usr/bin/epiphany

Command Line usage

urlscan [-n] <file>

Urlscan can extract URLs and email addresses from emails, or any text file. Calling without the ‘-n’ flag will start the curses browser. Calling with ‘-n’ will just output a list of URLs/email addressess to stdout. Files can also be piped to urlscan using normal shell pipe mechanisms: cat <something> | urlscan or urlscan < <something>

Known bugs and limitations

  • Running urlscan sometimes “messes up” the terminal background. This seems to be an urwid bug, but I haven’t tracked down just what’s going on.

  • Extraction of context from HTML messages leaves something to be desired. Probably the ideal solution would be to extract context on a word basis rather than on a paragraph basis.

  • The HTML message handling is a bit kludgy in general.

  • multipart/alternative sections are handled by descending into all the sub-parts, rather than just picking one, which may lead to URLs and context appearing twice.

  • Configurability is more than a little bit lacking.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urlscan-0.8.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urlscan-0.8.1-py2.py3-none-any.whl (21.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file urlscan-0.8.1.tar.gz.

File metadata

  • Download URL: urlscan-0.8.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlscan-0.8.1.tar.gz
Algorithm Hash digest
SHA256 6d1aa85d74e19344e9b97e155a985453d266a2a14fa42bc95f0e64fa71de7b59
MD5 04edf70f97f19a989f93d3e0e19879e0
BLAKE2b-256 b863423c50902af4f7735df92d53ecee1daa0e5c0aab043c8c251bac32e7ce89

See more details on using hashes here.

File details

Details for the file urlscan-0.8.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for urlscan-0.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c7c5a5c28ab534d2508adafb4be8d8614e0b3e313ac60a1759c7424b2019dea3
MD5 9e29a99bc8d4c2d637dec5563dcb5719
BLAKE2b-256 5379636bbc725cc3d0707091ea343bc1497631e429c3139921a0032a5724d1d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page