[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

BSMTP on debian.net

Hi all,

As suggested, I have setup BSMTP in a rather neato way I think. Well,
mostly, it is still kind of experimental. :>

The first group of people I am aiming this at are people with relatively
stable connectivity, such as a DSL or cable modem user. These people will
be able to run a SMTP server and reasonably expect their IP to stay
constant for months at least.

These folks will register a debian.net entry, pointing to their
quasi-static IP with a mx 0 pointing to their entry and a mx 10 to
klecker. When their IP changes (since it is only quasi static) mail will
spool quietly on klecker until the DNS IP is changed, then it will spool
back out to the SMTP server. [1]

Now, there is nothing special about that. However, lets say that they
move. Under normal circumstances being without connectivity for a long
time would be extremely bad for their mail. But now, all they need to do
is change the MX entries so that klecker is mx 0. This will automatically
spool all their mail to ~/bsmtp/foo.debian.net for retrival by some other
means. (see below) 

The next group would be people who can't receive list mail because their
ISP doesn't like a couple meg of mail going into their mailbox every day.
These people can register a debian.net name and just spool eveything into
the BSMTP bundle and pick it up over ssh.

I have been using this scheme for years now whenever I move to spool my
domain, but never for long enough to make serious SSH transport scripts.

The advantage over something like POP is
  1) mail is compressed, quite well actually..
  2) You get a whole domain
  3) Encryption is enforced :>
  4) You can switch to and from direct delivery and pickup quite
  5) Having people direct list mail (particularly) directly to their
     machine, rather than relaying through master *makes me happy* 

Thus, I would like someone else(s) to do the following
  1) Write a proper script for pull BSMTP transport over ssh.
  2) Write a nice howto I can put on db.debian.org using the debian.org

Finally, here are some details to get people started. To get a debian.net
mx domain:

wakko{jgg}~#cat /tmp/b
wakko in a
wakko in mx 0 wakko.debian.net.
wakko in mx 10 klecker.debian.org.

wakko{jgg}~#cat /tmp/b | gpg --clearsign -a | mail changes@db.debian.org
klecker{jgg}~#host -a wakko.debian.net
wakko.debian.net        MX      0 wakko.debian.net
wakko.debian.net        MX      10 klecker.debian.org
wakko.debian.net        TXT     "Jason Gunthorpe <jgg@debian.org>"
wakko.debian.net        TXT     "PGP 64 BE 13 19 CC F6 D3  93 BF 87 FF 93 58 A6 D4 EE"
wakko.debian.net        A

This is for cable users like myself. Joseph is setup for pure BSMTP:

klecker{jgg}~#host -a tank.debian.net
tank.debian.net         TXT     "Joseph Carter <knghtbrd@debian.org>"
tank.debian.net         TXT     "PGP E8 D6 84 81 E3 A8 BB  77 8E E2 29 96 C9 44 5F BE"
tank.debian.net         TXT     "PGP 20F6 2261 F185 7A3E  79FC 44F9 8FF7 D7A3 DCF9 DAB3"
tank.debian.net         MX      0 klecker.debian.org
tank.debian.net         A

klecker{root}~#ls -la ~knghtbrd/bsmtp/                
total 16
drwx------    2 knghtbrd Debian       4096 Feb 15 22:30 ./
drwxr-xr-x    3 knghtbrd Debian       4096 Feb 15 22:07 ../
-rw-------    1 knghtbrd Debian       6769 Feb 15 22:12 tank.debian.net

Note that exim will create the ~/bsmtp  dir for you with the right

To actually do a SSH download I used a simple (dangerous!) script that
  1) lock the smtp spool, the lock file should be ~/bsmtp/foo.lock, as
     though it was for a mailbox
  2) mv the spool to foo.transit.
  3) gzip -9 and cat it (since this is being called from ssh this 
     did the transfer
  4) erase the transit file.

If the transfer aborts you need to 'reget' the transit file..

The receive end just does sendmail -bs < foo after getting the batch.

Refinements are to use bzip2, some automated error handling, use a
persistant SSH connection and SMTP tunneling to immediately grab new mail,

Someone doing this may want to study the APT 4 ssh method. It has some
very innovative mechanisms from Ben for doing these sorts of things over
ssh. In fact using such a scheme it is possible to have a safe, fast,
entirely client side implementation. 

Finally, one also needs to setup your local mailer to respond to the
debian.net addy. Oh, if you screw it up and start sending your cron mails
to root@debian.org, I will box you up and send you Branden so he may have
his way with you. 


Note 1 - Of course if your IP changes often there is a chance that the new
owner might also be running a mail server and might just trash all your
mail, kind of sucks, but hey.. 

Because of this effect I really only recommend this be done for list
mails, unless you can assure that non-list mails are archived someplace
else before being sent.. 

Reply to: