Commit Graph

226 Commits

Author SHA1 Message Date
Piotr F. Mieszkowski 1e7d33c1df Handle bytes properly
Fix bytes sequences handling after auto-migration.
2022-01-10 18:21:53 +01:00
Piotr F. Mieszkowski b2a01c15b0 Fix auto-migrated code
- Use b'' (byte strings) where appropriate.

- Fix indentation.

- Replace python2.x references with python3.x.
2022-01-10 18:21:40 +01:00
Piotr F. Mieszkowski 5f02223ec7 Perform automatic migration to Python 3.x
Use lib2to3 automatic migration tool provided by Python 2.x to convert
codebase to new idioms.

Command line:

find . -type f -name '*.py' \
    -exec python2.7 -m lib2to3 \
    -f all -f idioms -f buffer -f set_literal -f ws_comma -w \
    '{}' '+'
2022-01-10 18:21:20 +01:00
pfm ee0d65f6bb Merge pull request 'Add tests for Python code' (#51) from 39-add-tests into master
Reviewed-on: #51
Reviewed-by: muppeth <muppeth@no-reply@disroot.org>
2022-01-10 17:10:00 +00:00
Piotr F. Mieszkowski 3b9f714cdb Ignore random_seed
Do not keep test/keyhome/random_seed in repository.
2022-01-10 17:47:23 +01:00
Piotr F. Mieszkowski 1002da78fa Clean up test messages
Remove unused msgout files, fix addresses in msgin files.
2022-01-09 22:00:06 +01:00
Piotr F. Mieszkowski 2cf60dec40 Add unit tests for GnuPG command-line generator
Extract a function to calculate GPG commands to be executed and cover it with
unit tests.
2022-01-09 21:37:14 +01:00
Piotr F. Mieszkowski fc2779ef7d Improve test code structure
- Move things to configuration file where appropriate (logging format, etc.).

- Rework execute_e2e_test signature to simplify it and get rid of keyword
arguments.

- Simplify output.

- Include a header comment in configuration file.
2022-01-08 13:42:23 +01:00
Piotr F. Mieszkowski 98c4580775 Document E2E tests 2022-01-07 12:10:30 +01:00
Piotr F. Mieszkowski e90a29c9ff Ignore temporary test directory 2022-01-07 12:04:14 +01:00
Piotr F. Mieszkowski 01377f4dd2 Keep test/certs directory 2022-01-07 12:03:38 +01:00
Piotr F. Mieszkowski ff3f6aa793 Add a test overview, extract constants
To let the user know that tests produce logs, include a message at the end of
the test output informing about locations of E2E and Mailgate logs.

Also, extract some constants.
2022-01-07 12:00:50 +01:00
Piotr F. Mieszkowski f1a799d864 Adjust E2E tests to work with all scenarios
Since it's not so easy to encrypt a message exactly the same way twice, we
only verify if the message has been encrypted or not.

Introduce minor changes to the library itself, because it doesn't work very
well with modern GnuPG.

Also, include GnuPG directory (pointed at by --homedir option).
2022-01-06 16:34:47 +01:00
Piotr F. Mieszkowski f41adc0d53 Configure git to ignore temporary files and Emacs files 2022-01-06 16:34:47 +01:00
Piotr F. Mieszkowski 27d7481078 Set up ground for E2E tests
- Use an environment variable to point at the configuration file while
  strating gpg-mailgate.py.

- Unify paths: store temporary config, logs and anything else under 'test'
  directory.

- Configure more tests (RSA, Ed25519).

- Add test descriptions to be shown before they're started.
2022-01-06 16:33:21 +01:00
Piotr F. Mieszkowski 7a063a91b8 Polish E2E testing script and make it configurable 2021-11-09 21:25:41 +01:00
Piotr F. Mieszkowski f3f56a47bc Implement an E2E testing script 2021-11-08 22:52:22 +01:00
Piotr F. Mieszkowski a9506805fb Write a test mail relay
Provide a simple Python script that would linsten on a given port and print to
standard output any message received via SMTP on that port.

This script will then be used to automatically test gpg-mailgate with different
scenarios (unknown recipient key, RSA key, elliptic curve key).
2021-11-04 22:39:02 +01:00
Fede.- 0fb623c75a Merge pull request 'README file: Few typos fixed.' (#33) from fix_01 into master
Reviewed-on: #33
2021-04-21 06:54:11 +00:00
Fede.- 8095f1507e Few typos fixed. 2021-04-20 17:43:01 -03:00
muppeth 59566d1b27
Update readme to include info on new name and nlnet funding 2021-04-19 13:15:46 +02:00
TheGreatGooo ff0871b311
Merge pull request #1 from svenseeberg/feature/automatic-key-download
Install: automatic public key retrieval
2019-05-27 10:32:17 -04:00
TheGreatGooo e1c610cee5
Merge pull request #3 from mukesh610/master
Added starttls support for SMTP
2019-05-27 10:32:02 -04:00
Mukesh Sai Kumar 0b92307b23
Added starttls support for SMTP 2019-05-24 23:20:34 +05:30
Sven Seeberg 6406d90dcb
Install: automatic pub key retrieval
* Add information about enabling automatic
  public key download via gpg.conf
2019-03-10 17:06:04 +01:00
TheGreatGooo 29f902b27c Fix bug
Content type not passed to encrypted submime causing bug where is only html is sent for example, the email client will not decode the html before displaying the email.
2017-09-09 11:53:00 -04:00
TheGreatGooo ba0953a372 Update gpg-mailgate.py
decode payload before encryption
2016-04-21 10:29:22 -04:00
TheGreatGooo bb4d267785 Update gpg-mailgate.py
fixed issue with Content-Transfer-Encoding during encryption
2016-04-20 20:44:56 -04:00
fkrone 9c1f1db870 Some final clean up and adding necessary information to the installation instructions 2015-06-07 13:42:58 +02:00
fkrone aa24cc2b4b Inform the user if registration failed because GPG-Mailgate-Web could not be reached. 2015-06-04 21:52:39 +02:00
fkrone bbab1b1070 Making it possible to configure mailserver for register-handler and use the encryption port for sending messages. 2015-06-04 20:14:00 +02:00
fkrone 9cfbd24bdc All mails from cron script are now passed through the GPG-Mailgate so they are encrypted if possible. 2015-06-04 20:13:04 +02:00
fkrone 24cfe01d95 Fixing stupid bug with non existing variable. Copy & paste fail. Finding a default key for recipient in domain keymap crashed mailgate. 2015-06-04 19:04:27 +02:00
fkrone 0de0d6a1b1 Critical bugfix: Under some circumstances a mail which should be encrypted with PGP/MIME was not encrypted if at least one attachment ot the body itself contained the PGP-tags. 2015-06-04 16:45:22 +02:00
fkrone 4b7a187ac3 Forgot to change this value from a debug one to the real value 2015-05-29 23:15:05 +02:00
fkrone 11f70fb241 Added possibility to define a regex for finding recipients to decrypt for and also adding possibility to use default keys for domain ranges 2015-05-29 23:13:05 +02:00
fkrone 5fdbabc3b3 Disable PGP/INLINE decryption by default. It does work, however, it has some drawbacks (e.g. content type for files getting lost). 2015-05-25 22:49:42 +02:00
fkrone 2c0e342e5e Support for decrypting PGP encrypted mails. However, it has some drawbacks and might cause some security issues. So before using it please read carefully through the installation instructions. 2015-05-25 20:24:37 +02:00
fkrone 6a7dda969b Bugfix: The mailgate crashes with certain settings when mail is delivered locally 2015-05-25 00:28:55 +02:00
fkrone 4283c7ef4d Prefere keys in keymap over keys in keyring. Could be useful if you have a recipient with two keys. 2015-03-29 18:16:58 +02:00
fkrone d3bbb82072 Make the SMTP relay used by cron configurable via config. Use the same as the gateway does. 2015-03-28 19:41:40 +01:00
fkrone efe2187bb5 Logging for cron job does now work to syslog if defined so in the config file (previously it thought it should write to a file called 'syslog' instead of the real syslog) 2015-03-28 19:23:49 +01:00
fkrone dbb65bbf7f Bugfix: Missed return code for failed PGP encryption in log message 2015-03-16 14:58:01 +01:00
fkrone 49e0068f04 Bugfix: Typo in config file 2015-03-16 13:55:11 +01:00
fkrone 581973cdf9 Hopefully last push to fix installation instructions 2015-03-15 20:09:47 +01:00
fkrone 9152d17533 Try to fix it again. Sorry, I'm not good at markdown. 2015-03-15 20:07:32 +01:00
fkrone 71c189ba52 Try to fix installation instructions 2015-03-15 20:05:38 +01:00
fkrone 600b57e6ef Bugfix: Handle multipart messages and especially nested multipart messages correct and not mess up them 2015-03-14 21:52:33 +01:00
fkrone 8f2b256dab Updated installation instructions to make sure they are easier to follow 2015-03-08 17:01:25 +01:00
fkrone 46730ba8e6 Bugfix: Avoid nested encryptions of any kind 2015-03-02 21:01:05 +01:00