Example data import

<!-- GOAL ONE-LINER --> <p>Fill the database with data used for testing throughout the guide</p> <!-- RATIONALE --> <p>Have test data available. Additionally, importing data of this specific structure, inherently verifies whether the MySQL database/tables structure is valid. The data entered represents the following use case:</p> <p>The domain <code>example.org</code> is set to be a valid domain. For this domain, two users are created: <code>john.doe</code> and <code>jack.doe</code>. Mail sent to <code>jane.doe@example.org</code> is then forwarded to <code>john.doe</code> whereas any other addresses related to <code>example.org</code> are forwarded to <code>jack.doe@example.org</code>. This setup enables testing whether specific aliases is prioritized over the catch-all alias.</p> <!-- NUANCE --> <h2>Procedure</h2> <!-- NARRATIVE FORM --> <!-- STEP BY STEP --> <pre><code class="language-sql">-- 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 'jane.doe@example.org' forwarding to 'john.doe@example.org' INSERT INTO `mailserver`.`aliases` (`domain`, `source`, `destination`) VALUES ('example.org', 'jane.doe@example.org', 'john.doe@example.org'); -- Create a catch-all ALIAS forwarding mails sent to 'example.org' to 'jack.doe@example.org' INSERT INTO `mailserver`.`aliases` (`domain`, `source`, `destination`) VALUES ('example.org', '@example.org', 'jack.doe@example.org');</code></pre> <blockquote> <p>:information_source: <code>Query OK</code> implies that the data is correctly inserted.</p> <!-- REFERENCES --> </blockquote>