Mail server_Example data import - SomethingWithHorizons/mailserver GitHub Wiki
Fill the database with data used for testing throughout the guide
This procedure prepares the data that is needed in some of the intermediate test procedures mentioned in this guide. This action inherently verifies whether the setup of MySQL database/tables have been done successfully. The data entered represents the following use case:
The domain example.org is set to be a valid domain. For this domain, two users are created: john.doe and jack.doe. Mail sent to [email protected] is then forwarded to john.doe whereas any other addresses related to example.org are forwarded to [email protected]. This setup enables testing whether specific aliases is prioritized over the catch-all alias.
Procedure
-- Create a test DOMAIN 'example.org'
INSERT INTO `mailserver`.`domains` (`name`) VALUES ('example.org');
-- Create test users (password is 's3cret!' for both users)
INSERT INTO `mailserver`.`users` (`username`, `domain`, `password`) VALUES ('john.doe', 'example.org', '{SHA512-CRYPT}$6$RqETLc47s5f4HSYD$Nob4qs5TjkSvZwcVOe0Bkau86MlEzC1GANOpItuO.B8oW13C6LWSN9/gYkL3pkseZfOv9Pt6BwKlYUjyQRLcr0');
INSERT INTO `mailserver`.`users` (`username`, `domain`, `password`) VALUES ('jack.doe', 'example.org', '{SHA512-CRYPT}$6$RqETLc47s5f4HSYD$Nob4qs5TjkSvZwcVOe0Bkau86MlEzC1GANOpItuO.B8oW13C6LWSN9/gYkL3pkseZfOv9Pt6BwKlYUjyQRLcr0');
-- Create an ALIAS '[email protected]' forwarding to '[email protected]'
INSERT INTO `mailserver`.`aliases` (`domain`, `source`, `destination`) VALUES ('example.org', '[email protected]', '[email protected]');
-- Create a catch-all ALIAS forwarding mails sent to 'example.org' to '[email protected]'
INSERT INTO `mailserver`.`aliases` (`domain`, `source`, `destination`) VALUES ('example.org', '@example.org', '[email protected]');
:information_source:
Query OKimplies that the data is correctly inserted.