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

@social-mail/social-mail-web-server

v1.7.54

Published

## Phase 1

Downloads

14,579

Readme

Social-Mail Web-Server

Social Mail Server is a simple mail and file server.

Social Media features such as Like, comment and subscribe are planned in future release.

Self hosted

Social Mail Server is a self hosted web/mail server. You can choose to host anyway you like it. No more privacy nightmares and big forms to sign up and lots of terms and conditions. Just communicate with your audience simply through email.

Docker Container

  1. Create vars.env files with the variables from the following table.
  2. Run following
docker pull neurospeech/social-mail-web-server:latest
docker volume socialmaildata
docker run --name=socialmail --env-file vars.env -p 25:25 -p 443:443 -p 80:80 -v socialmaildata:/data --restart=always -d neurospeech/social-mail-web-server:latest
docker image prune -f
docker volume prune -f
docker builder prune -a -f

Custom Build

  1. You will need NodeJS + ClamAV + PostgresSQl.
  2. After you have installed all of the above, run following steps. a. mkdir social-mail b. cd social-mail c. npm init Press enter for all defaults. d. npm install -s @social-mail/social-mail-web-server. e. node --enable-source-maps ./node_modules/@social-mail/social-mail-web-server/index.js

Upcoming Social Features

Social Mail Server will adds few tricks to send/receive social messages through emails. The best part is, you will be able to communicate with everyone even if they are not on same mail server. You can basically communicate/socialize with your friends and family without having to go through big tech.

Environment Variables

| Environment Variable |Required | Defaults | | |------------------------------------|---------|--------------|-----------------------------| | SOCIAL_MAIL_HOST |Yes | | | | SOCIAL_MAIL_PATH | | / | Root path for all API | | SOCIAL_MAIL_HOSTED_EMAIL_DOMAIN | | | For sending Email notifications | | SOCIAL_MAIL_EXTERNAL_LOGIN | | | | | SOCIAL_MAIL_ALT_HOSTS | | | | | SOCIAL_MAIL_NAME | | Social Mail | PWA Name | | SOCIAL_MAIL_CDN | | | | | SOCIAL_MAIL_ADMIN_PASSWORD |Yes | social-admin | This will be set only first time | | SOCIAL_MAIL_SECRET_KEY |Yes | | Used to encrypt secrets | | SOCIAL_MAIL_AV | | ClamAV | Anti Virus Scanner | | SOCIAL_MAIL_AV_PORT | | ClamAVDef | Anti Virus Scanner Port | | SOCIAL_MAIL_AV_DEBUG | | false | true to enable debug mode | | SOCIAL_MAIL_SMTP_PORT | | 25 | 0 to disable | | SOCIAL_MAIL_SSL_MODE | | lets-encrypt | none,lets-encrypt,self-signed | | SOCIAL_MAIL_SSL_PORT | | 443 | SSL Port, 0 to disable | | SOCIAL_MAIL_SSL_HOSTS | | | Additional SSL Hosts, all must point to same IP address. | | SOCIAL_MAIL_SSL_LE_EMAIL |[Yes] | | Email for Lets Encrypt | | SOCIAL_MAIL_SSL_LE | | staging | Change to production | | SOCIAL_MAIL_SSL_ACME_EP | | | Zero SSL End Point for ACME | | SOCIAL_MAIL_SSL_ACME_EAB_KID | | | Key ID | | SOCIAL_MAIL_SSL_ACME_EAB_HMAC | | | HMAC | | SOCIAL_MAIL_SSL_PATH | | /data/cert | Certificates folder | | SOCIAL_MAIL_TMP_PATH | | /tmp | Temporary files | | SOCIAL_MAIL_TMP_SIZE | | 7gb | Temporary Storage Size | | SOCIAL_MAIL_STORAGE |Yes | s3 | s3,volume,azure,db | | SOCIAL_MAIL_STORAGE_PATH | | | Volume Path | | SOCIAL_MAIL_AZURE_BLOB_CONN_STRING |[Yes] | | Blob Connection String | | SOCIAL_MAIL_AZURE_BLOB_CONTAINER |[Yes] | | Blob Container (Must Exist) | | SOCIAL_MAIL_S3_END_POINT |Yes | | | | SOCIAL_MAIL_S3_BUCKET |Yes | | | | SOCIAL_MAIL_S3_ACCESS_KEY | | | | | SOCIAL_MAIL_S3_SECRET | | | | | SOCIAL_MAIL_DB_SERVER | | postgres | postgres | | SOCIAL_MAIL_DB_HOST | | localhost | | | SOCIAL_MAIL_DB_PORT | | 5432 | | | SOCIAL_MAIL_DB_DATABASE | | SocialMails | | | SOCIAL_MAIL_DB_USER | | postgres | | | SOCIAL_MAIL_DB_PASSWORD | | postgres | | | SOCIAL_MAIL_DB_SSL | | true | Set false for local/testing | | SOCIAL_MAIL_AUTH_COOKIE | | sm-a1 | Name of HTTP Cookie | | SOCIAL_MAIL_AUTH_COOKIE_SECURE | | true | Enable HTTPS only Cookie | | SOCIAL_MAIL_BACKUP | | | s3, azure | | SOCIAL_MAIL_BACKUP_S3_BUCKET | | | |

Hosting Modes

  1. Self Hosted Cluster with Lets Encrypt

Why not pm2?

  1. Not needed, difficult to setup ACME certificates.
  2. pm2 doesn't offer anything more than what inbuilt cluster is offering.

Indexing Variance

  1. Table with status columns such as 'sent', 'received' etc.. does not need tokenization as the index size difference is less than 1% due to less number of different values.
  2. Table with email address would certainly benefit from tokenization as the storage itself would need number of bytes for single row as well as the index size would be significantly smaller. e.g.

MailboxContactEmails table with Rows 486917 has following size differences. Size Without Tokenization PK 37MB, Index 31MB, Total 68MB Size With Tokenization PK 19MB, Index 16MB, Total 32MB

So Tokenization has more than 50% Improvement.

Reason behind this improvement is size of email address itself, most email addresses would require on an average 30 bytes, where else tokenized bigint would only need 8 bytes.

In short, if the column contains very few different values, tokenization is not helpful. But if the column can contain randome values, the tokenization would reduce the size and increase performance by more than 50% easily.