Giter Club home page Giter Club logo

bitmessage-email-gateway's Introduction

bitmessage-email-gateway

This software is a bi-directional email gateway implementation for the Bitmessage network.

This software will take a standard email MTA setup using a catchall address and MailDir as its storage type and will act as a email <-> bitmessage gateway.

For more information about Bitmessage, please visit https://www.bitmessage.org

Features

  • Allows users to register for and deregister from the service via Bitmessage
  • Drops message requests from unregistered users
  • Allows registered users to send emails from their registered account to the Internet using their Bitmessage client software
  • Allows Internet users to send messages to registered users using the user's @domain.com email address
  • Auto purges bitmessages and emails immediately after sending
  • Transparently encrypts emails destined for addresses with published PGP keys (multiple key servers supported)

System Requirements

Python Dependencies

  • Gnupg
  • BeautifulSoup3
  • Possibly others that I have forgotten about

Installation Instructions

useradd bitmessage
passwd bitmessage
su bitmessage
  • Install Postfix (or other MTA) for your domain name and make sure a catch-all address is set up to forward all emails to [email protected]
  • Make sure Postfix (or other MTA) is configured to use MailDir as its storage method! You can send a test email to [email protected] to see if it's delivered to /home/bitmessage/MailDir/new
  • Download the newest version of this software and unzip
wget https://github.com/darkVPN/bitmessage-email-gateway/archive/master.zip
unzip master.zip
rm -rf ./master.zip
cd bitmessage-email-gateway/
  • Open bitmessage-gateway.py and edit the Bitmessage API connection settings:
## API connection information
api = {
	'conn' : '',
	'username' : 'your-bitmessage-api-user',
	'password' : 'your-bitmessage-api-password',
	'host' : '127.0.0.1',
	'port' : '8442'

}
  • Next, modify the application's general settings:
## system configuration details
config = {
	'domain_name' : 'your-domain.com',
	'mail_folder' : '/home/bitmessage/MailDir/new/',
	'log_filename' : '/var/log/bitmessage-gateway.log',
	'process_interval' : 10,
	'receiving_address_label' : 'your-domain.com Generic Receive Address',
	'sending_address_label' : 'your-domain.com Generic Sender Address',
	'registration_address_label' : 'your-domain.com Registration Address',
	'deregistration_address_label' : 'your-domain.com Deregistration Address',
	'bug_report_address_bitmessage' : 'you-bitmessage-address',
	'bug_report_address_email' : 'your-email',
	'debug' : True,
	'respond_to_invalid' : True
}
  • Setup the log file for use:
touch /var/log/bitmessage-gateway.log
chown bitmessage:bitmessage /var/log/bitmessage-gateway.log
  • Add the required bitmessage addresses for your service (registration, deregistration, sender, and receiver'):
chmod +x bitmessage-gateway.py
./bitmessage-gateway.py -a 'your-domain.com Generic Receive Address'
./bitmessage-gateway.py -a 'your-domain.com Generic Sender Address'
./bitmessage-gateway.py -a 'your-domain.com Registration Address'
./bitmessage-gateway.py -a 'your-domain.com Deregistration Address'
  • Check to make sure all required addresses have been added successfully. Note: you should see the four labels (and corresponding addresses) that you set in your config!
./bitmessage-gateway.py -l

An example response:

####################################
Internal Address List
####################################
goDark Deregistration Address                   BM-2cTDKufxNFY6iAafxartJUHodHDQ8BabNR
goDark Registration Address                     BM-2cX1rp2LmTxn2yZERVuMGqCNuTbBwqLA4e
goDark Generic Receive Address                  BM-2cW5Yvp5x9mL8gwjGdm65H9ombKG6JvRHg
goDark Generic Sender Address                   BM-2cWPQvSfwEzDnG8xd8DGwz1p3Lj8FGk3tT
  • Now it's time to distribute these addresses to your users via a website, Twitter, etc!

When users send a message to your 'domain.com Registration Address' bitmessage address with their desired username in the subject field, the system will automatically register them and send a welcome email. This welcome email describes how to use the system and how to contact you about bugs/comments. You can change the welcome email content by editing the bitmessage-gateway.py script.

Users can deregister by sending a message to the 'domain.com Deregistration Address' bitmessage address listed in the last step.

Users can send outbound emails to the Internet by sending a message to the 'domain.com Receive Address' bitmessage address with the destination email in the subject field. Outbound emails destined for addresses with known public PGP keys will be encrypted automatically. Email responses will automatically be forwarded to your users.

People of the Internets can send emails to your users by simply emailing their [email protected] address.

  • Run the application!
./bitmessage-gateway.py

Comments / Bug Reports

Fork away if you're a developer ;)

bitmessage-email-gateway's People

Contributors

mailchuck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitmessage-email-gateway's Issues

outbound thread crash

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/bitmessage-email-gateway/bitmessage-gateway.py", line 633, in check_bmoutbox
    if a_message['status'] == 'ackreceived':
KeyError: 'status'

bminbox crash

Exception in thread BMIn:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/bitmessage-email-gateway/bitmessage-gateway.py", line 586, in check
_bminbox
    retval = send_email(bm_receiver, bm_sender, bm_subject, bm_body, bm_id, user
data = userdata)
  File "/opt/bitmessage-email-gateway/bitmessage-gateway.py", line 223, in send_
email
    server.quit()
  File "/usr/lib/python2.7/smtplib.py", line 768, in quit
    res = self.docmd("quit")
  File "/usr/lib/python2.7/smtplib.py", line 393, in docmd
    self.putcmd(cmd, args)
  File "/usr/lib/python2.7/smtplib.py", line 341, in putcmd
    self.send(str)
  File "/usr/lib/python2.7/smtplib.py", line 333, in send
    raise SMTPServerDisconnected('please run connect() first')
SMTPServerDisconnected: please run connect() first

Crash

Exception in thread BMIn:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/bitmessage-email-gateway/bitmessage-gateway.py", line 589, in check_bminbox
retval = send_email(bm_receiver, bm_sender, bm_subject, bm_body, bm_id, userdata = userdata)
File "/opt/bitmessage-email-gateway/bitmessage-gateway.py", line 227, in send_email
for rcpt in e.recipients:
AttributeError: 'SMTPServerDisconnected' object has no attribute 'recipients'

Unicode crash

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/src/bitmessage-email-gateway/bitmessage-gateway.py", line 732, in handle_email
    msg_subject = unicode(msg_subject[0], msg_subject[1])
UnicodeDecodeError: 'utf8' codec can't decode byte 0xee in position 1: invalid continuation byte

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.