A postfix smtp proxy which has the ability to interject smtp traffic and replace large files inside the mail with links
Find a file
Tyrolyean 022e400a2a
Added file handling
Signed-off-by: Tyrolyean <tyrolyean@tyrolyean.net>
2020-04-29 22:55:46 +02:00
include Added file handling 2020-04-29 22:55:46 +02:00
src Added file handling 2020-04-29 22:55:46 +02:00
.gitignore Added gitignore 2020-04-24 23:08:47 +02:00
LICENSE INITIAL COMMIT 2020-04-24 23:01:02 +02:00
Makefile Added tcp forwarder for postfix 2020-04-26 18:01:10 +02:00
README Added base 64 en-decode logic, detection 2020-04-29 19:19:38 +02:00

MAILATTACH

This program starts a process which listens on the LOOPBACKv4 address for
incoming connections from postfix. The postfix master should view this as an
advanced filter as explained in their documentation for post queue filtering:

http://www.postfix.org/FILTER_README.html

The original attempt was to implement this as a pre queue filter, but this
required the milter protocol and postfix currently does not implement the
replace body function from libmilter.

You can specify the following command line options:

--abort-pgp --noabort-pgp
	To either abort the attachment process if PGP encryption or signatures 
	have been detected or not. If true, the mail will not be modified.

--abort-dkim --noabort-dkim
	To either abort the attachment process if DKIM signatures have been
	detected or not. If true, the mail will not be modified.

--in-port -i
	The incoming smtp port/the port from which mail is received.

--out-port -o
	The outgoing smtp port/the port to which mail ist passed through.

--directory -d
	The directory inside of which the attachments will be stored in.

--url -u
	The base which should point to the same location as the directory does,
	for exaple if the directory is /var/www/html and the URL base is 
	https://example.com then a file in /var/www/html/attachment01.pdf should
	be linkable via https://example.com/attachment01.pdf
	Ah and please, please, pretty please disable directory indexing on your
	webserver! 
	That WILL BE a security riks!

HOWTO

We essentially are MITM sniffing your email traffic and playing proxy from your
postfix to your postfix. That's how this is intended to work according to the
postfix website.

This program needs to be started via it's own systemd service on system boot.
You need to add the in and oputput ports to your postfix queue as described in
the link above. More documentation is to a TODO