unveiledsolectveganraspiContactLog inRegister
  • solect
  • vegan
  • raspi
  • Contact

  • Register

Raspberry Pi

  • Front Page
  • Latest pages
  • Latest comments
  1. Raspberry Pi
  2. Server 128
  3. Email Server
  4. Postfix Config
Posted on 19 Aug 2021 at 12:43 pm :: Last edit on 21/08/21 09:00 am

Postfix Config

This is the Postfix Configuration screen

CLI Postfix Configiration

  1. However there are no options and the CLI is unresponsive, no internet guidance on this so going to search Rasp Pi Postfix

    Switching guide to samhobbs.co.uk . . raspberry-pi . . . postfix
  2. OK back did dozens of commands removed postfix, reinstalled etc. for many hours to no avail
  3. AH! I have now managed to scroll the screen and find the ok button, upon which the options were shown.
  4. Selected Internet as advised and use rogerlovejoy.uk as domain

Moving on to jackstromberg.com/2020/01/. . .email-server-on-a-raspberrypi-postfix . . .

August 20th

  1. When back to previous post and set up a PTR record
  2. Jack's guide instructs to create a database before installing postfix but I will created database, user etc. now ~ . . .
  3. create database ???????;
    GRANT SELECT ON .??????? TO ???????@127.0.0.1 IDENTIFIED BY '???????';
    FLUSH PRIVILEGES;
    ✓

  4. Create Tables see comment 1 ✓
  5. Create User see comment 2 ✓
  6. August 21st

    I have decided to re-installed postfix and associated packages as per Jack's guide
    sudo apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql most of which was already OK ✓

2 comments

Comment from: roger

Create a table for each of the domain names to be used for email addresses.

CREATE TABLE `mailserver`.`virtual_domains` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



Create a table that will hold each of the users that will need mailboxes.

CREATE TABLE `mailserver`.`virtual_users` (
`id` int(11) NOT NULL auto_increment,
`domain_id` int(11) NOT NULL,
`password` varchar(106) NOT NULL,
`email` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



Create a table that will hold aliases (additional email addresses) for a particular user.

CREATE TABLE `mailserver`.`virtual_aliases` (
`id` int(11) NOT NULL auto_increment,
`domain_id` int(11) NOT NULL,
`source` varchar(100) NOT NULL,
`destination` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

20/08/21 @ 05:22 pm

Comment from: roger

Insert a new user into the database

First, we need to add our first domain name into the domains table

INSERT INTO mailserver . virtual_domains (name) VALUES ('rogerlovejoy.uk');

Second, we need to create the user. Replace mysupersecretpassword with your password.

INSERT INTO mailserver.virtual_users (`domain_id`, `password` , `email`)
VALUES ('1', ENCRYPT('mysupersecretpassword', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), '######@rogerlovejoy.uk');

Third, we can optionally specify an alias (secondary email address) for the user. INSERT INTO `mailserver`.`virtual_aliases`
(`domain_id`, `source`, `destination`)
VALUES
('1', 'firstname.lastname@mydomain.com', 'myuser@mydomain.com');

Type exit once you are done to leave the context of MariaDB.

20/08/21 @ 05:46 pm


Form is loading...

Content Hierarchy

  • Desktop OS 64
  • Server 128
    • Public Access
    • Apache2
    • MariaDB
    • VNC Server
    • Install B2evo
    • Email Server
      • Getting started
      • Postfix Config
      • postfix/main.cf
  • Hardware
Multiple blogs done right!

This collection ©2022 by roger • Contact • Help • CMS + email marketing

Cookies are required to enable core site functionality.