npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smtp2http

v1.1.2

Published

SMTP to HTTP gateway

Downloads

3

Readme

smtp2http

SMTP to HTTP gateway

Usage

Usage: smtp2http [-v|--verbose] [-s|--silent|-q|--quiet]
    [-T|--tls=<tls_opt>] [[-H|--header=<header>], ...] ENDPOINT

 -H --header=<header>   HTTP header to send with requests
 -q --quiet             Do not log to STDERR
 -s --silent            Alias for --quiet
 -T --tls=<tls_opt>     colon-delimited list of cert files
                        q.v. TLS Option below
 -v --verbose           Log information to STDOUT

TLS Option
The --tls option accepts a colon-delimited list of certificate files.
You can specify a single combined PFX file, a cert file followed by a
key file, or a cert file followed by a key file followed by a signing
authority certificate.

Examples

Begin listening for incoming SMTP messages, parse them, and post them to the specified HTTP endpoint.

smtp2http https://example.com/foo

TLS Support

Enable TLS using separate certificate and key files with signing CA cert.

CERT=/etc/private/ssl/example.com.crt
KEY=/etc/private/ssl/example.com.key
CA=/etc/private/ssl/example.com-ca.crt
smtp2http -T$CERT:$KEY:$CA https://example.com/foo

Enable TLS using cert and key files only.

CERT=/etc/private/ssl/example.com.crt
KEY=/etc/private/ssh/example.com.key
smtp2http -T$CERT:$KEY https://example.com/foo

Enable TLS using single PFX combined cert file.

CERT=/etc/private/ssl/example.com.pfx
smtp2http -T$CERT https://example.com/foo

Install

git clone [email protected]:Zingle/smtp2http.git
cd smtp2http
npm install -g

Development

The SMTP protocol does not provide any way to set the TCP port used for communication. Because of this, development can be difficult if trying to use public mail providers because you must have an internet facing server listening on port 25.

You can run something like the following to set up a reverse tunnel using a public server to which you have SSH access.

ssh -fNR 25:localhost:2025 [email protected]
SMTP_PORT=2025 smtp2http

In this example, example.com is the public server to which you have access, root is a user with access to open low-numbered ports on that host, 25 is the port this host will listen on (standard SMTP port), and 2025 is the port smtp2http will listen on.

Appendix - Generating a PFX cert

If you have a typical PEM cert with separate key and cert files, you may wish to generate a PFX cert which is simple to specify.

openssl pkcs12 -export \
    -out example.com.pfx \
    -in example.com.crt -inkey example.com.key \
    -certfile example.com-ca.crt