--
-- PostgreSQL database dump
--

-- Dumped from database version 15.6 (Ubuntu 15.6-1.pgdg20.04+1)
-- Dumped by pg_dump version 15.6 (Ubuntu 15.6-1.pgdg20.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

--
-- Name: allowed_logins(character varying); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.allowed_logins(sender_ character varying) RETURNS SETOF character varying
    LANGUAGE sql
    AS $$
SELECT mailbox.username FROM mailbox WHERE mailbox.username = sender_
UNION
SELECT unnest(sender_aliases.allowed_senders) FROM sender_aliases WHERE sender_aliases.alias = sender_
UNION
SELECT substring(sender_ FROM '^.*(?=@)') WHERE sender_ LIKE '%segfault.party';
$$;


ALTER FUNCTION public.allowed_logins(sender_ character varying) OWNER TO postgres;

--
-- Name: merge_quota(); Type: FUNCTION; Schema: public; Owner: postfix
--

CREATE FUNCTION public.merge_quota() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
        BEGIN
            UPDATE quota SET current = NEW.current + current WHERE username = NEW.username AND path = NEW.path;
            IF found THEN
                RETURN NULL;
            ELSE
                RETURN NEW;
            END IF;
      END;
      $$;


ALTER FUNCTION public.merge_quota() OWNER TO postfix;

--
-- Name: merge_quota2(); Type: FUNCTION; Schema: public; Owner: postfix
--

CREATE FUNCTION public.merge_quota2() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
        BEGIN
            IF NEW.messages < 0 OR NEW.messages IS NULL THEN
                -- ugly kludge: we came here from this function, really do try to insert
                IF NEW.messages IS NULL THEN
                    NEW.messages = 0;
                ELSE
                    NEW.messages = -NEW.messages;
                END IF;
                return NEW;
            END IF;

            LOOP
                UPDATE quota2 SET bytes = bytes + NEW.bytes,
                    messages = messages + NEW.messages
                    WHERE username = NEW.username;
                IF found THEN
                    RETURN NULL;
                END IF;

                BEGIN
                    IF NEW.messages = 0 THEN
                    INSERT INTO quota2 (bytes, messages, username) VALUES (NEW.bytes, NULL, NEW.username);
                    ELSE
                        INSERT INTO quota2 (bytes, messages, username) VALUES (NEW.bytes, -NEW.messages, NEW.username);
                    END IF;
                    return NULL;
                    EXCEPTION WHEN unique_violation THEN
                    -- someone just inserted the record, update it
                END;
            END LOOP;
        END;
        $$;


ALTER FUNCTION public.merge_quota2() OWNER TO postfix;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: admin; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.admin (
    username character varying(255) NOT NULL,
    password character varying(255) DEFAULT ''::character varying NOT NULL,
    created timestamp with time zone DEFAULT now(),
    modified timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL,
    superadmin boolean DEFAULT false NOT NULL,
    phone character varying(30) DEFAULT ''::character varying NOT NULL,
    email_other character varying(255) DEFAULT ''::character varying NOT NULL,
    token character varying(255) DEFAULT ''::character varying NOT NULL,
    token_validity timestamp with time zone DEFAULT '2000-01-01 00:00:00+00'::timestamp with time zone
);


ALTER TABLE public.admin OWNER TO postfix;

--
-- Name: TABLE admin; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.admin IS 'Postfix Admin - Virtual Admins';


--
-- Name: alias; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.alias (
    address character varying(255) NOT NULL,
    goto text NOT NULL,
    domain character varying(255) NOT NULL,
    created timestamp with time zone DEFAULT now(),
    modified timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL
);


ALTER TABLE public.alias OWNER TO postfix;

--
-- Name: TABLE alias; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.alias IS 'Postfix Admin - Virtual Aliases';


--
-- Name: alias_domain; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.alias_domain (
    alias_domain character varying(255) NOT NULL,
    target_domain character varying(255) NOT NULL,
    created timestamp with time zone DEFAULT now(),
    modified timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL
);


ALTER TABLE public.alias_domain OWNER TO postfix;

--
-- Name: TABLE alias_domain; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.alias_domain IS 'Postfix Admin - Domain Aliases';


--
-- Name: config; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.config (
    id integer NOT NULL,
    name character varying(20) NOT NULL,
    value character varying(20) NOT NULL
);


ALTER TABLE public.config OWNER TO postfix;

--
-- Name: config_id_seq; Type: SEQUENCE; Schema: public; Owner: postfix
--

CREATE SEQUENCE public.config_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.config_id_seq OWNER TO postfix;

--
-- Name: config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postfix
--

ALTER SEQUENCE public.config_id_seq OWNED BY public.config.id;


--
-- Name: domain; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.domain (
    domain character varying(255) NOT NULL,
    description character varying(255) DEFAULT ''::character varying NOT NULL,
    aliases integer DEFAULT 0 NOT NULL,
    mailboxes integer DEFAULT 0 NOT NULL,
    maxquota bigint DEFAULT 0 NOT NULL,
    quota bigint DEFAULT 0 NOT NULL,
    transport character varying(255) DEFAULT NULL::character varying,
    backupmx boolean DEFAULT false NOT NULL,
    created timestamp with time zone DEFAULT now(),
    modified timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL,
    password_expiry integer DEFAULT 0
);


ALTER TABLE public.domain OWNER TO postfix;

--
-- Name: TABLE domain; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.domain IS 'Postfix Admin - Virtual Domains';


--
-- Name: domain_admins; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.domain_admins (
    username character varying(255) NOT NULL,
    domain character varying(255) NOT NULL,
    created timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL,
    id integer NOT NULL
);


ALTER TABLE public.domain_admins OWNER TO postfix;

--
-- Name: TABLE domain_admins; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.domain_admins IS 'Postfix Admin - Domain Admins';


--
-- Name: domain_admins_id_seq; Type: SEQUENCE; Schema: public; Owner: postfix
--

CREATE SEQUENCE public.domain_admins_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.domain_admins_id_seq OWNER TO postfix;

--
-- Name: domain_admins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postfix
--

ALTER SEQUENCE public.domain_admins_id_seq OWNED BY public.domain_admins.id;


--
-- Name: fetchmail; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.fetchmail (
    id integer NOT NULL,
    mailbox character varying(255) DEFAULT ''::character varying NOT NULL,
    src_server character varying(255) DEFAULT ''::character varying NOT NULL,
    src_auth character varying(15) NOT NULL,
    src_user character varying(255) DEFAULT ''::character varying NOT NULL,
    src_password character varying(255) DEFAULT ''::character varying NOT NULL,
    src_folder character varying(255) DEFAULT ''::character varying NOT NULL,
    poll_time integer DEFAULT 10 NOT NULL,
    fetchall boolean DEFAULT false NOT NULL,
    keep boolean DEFAULT false NOT NULL,
    protocol character varying(15) NOT NULL,
    extra_options text,
    returned_text text,
    mda character varying(255) DEFAULT ''::character varying NOT NULL,
    date timestamp with time zone DEFAULT now(),
    usessl boolean DEFAULT false NOT NULL,
    sslcertck boolean DEFAULT false NOT NULL,
    sslcertpath character varying(255) DEFAULT ''::character varying,
    sslfingerprint character varying(255) DEFAULT ''::character varying,
    domain character varying(255) DEFAULT ''::character varying,
    active boolean DEFAULT false NOT NULL,
    created timestamp with time zone DEFAULT '2000-01-01 00:00:00+00'::timestamp with time zone,
    modified timestamp with time zone DEFAULT now(),
    src_port integer DEFAULT 0 NOT NULL,
    CONSTRAINT fetchmail_protocol_check CHECK (((protocol)::text = ANY (ARRAY[('POP3'::character varying)::text, ('IMAP'::character varying)::text, ('POP2'::character varying)::text, ('ETRN'::character varying)::text, ('AUTO'::character varying)::text]))),
    CONSTRAINT fetchmail_src_auth_check CHECK (((src_auth)::text = ANY (ARRAY[('password'::character varying)::text, ('kerberos_v5'::character varying)::text, ('kerberos'::character varying)::text, ('kerberos_v4'::character varying)::text, ('gssapi'::character varying)::text, ('cram-md5'::character varying)::text, ('otp'::character varying)::text, ('ntlm'::character varying)::text, ('msn'::character varying)::text, ('ssh'::character varying)::text, ('any'::character varying)::text])))
);


ALTER TABLE public.fetchmail OWNER TO postfix;

--
-- Name: fetchmail_id_seq; Type: SEQUENCE; Schema: public; Owner: postfix
--

CREATE SEQUENCE public.fetchmail_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fetchmail_id_seq OWNER TO postfix;

--
-- Name: fetchmail_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postfix
--

ALTER SEQUENCE public.fetchmail_id_seq OWNED BY public.fetchmail.id;


--
-- Name: log; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.log (
    "timestamp" timestamp with time zone DEFAULT now(),
    username character varying(255) DEFAULT ''::character varying NOT NULL,
    domain character varying(255) DEFAULT ''::character varying NOT NULL,
    action character varying(255) DEFAULT ''::character varying NOT NULL,
    data text DEFAULT ''::text NOT NULL,
    id integer NOT NULL
);


ALTER TABLE public.log OWNER TO postfix;

--
-- Name: TABLE log; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.log IS 'Postfix Admin - Log';


--
-- Name: log_id_seq; Type: SEQUENCE; Schema: public; Owner: postfix
--

CREATE SEQUENCE public.log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.log_id_seq OWNER TO postfix;

--
-- Name: log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postfix
--

ALTER SEQUENCE public.log_id_seq OWNED BY public.log.id;


--
-- Name: mailbox; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.mailbox (
    username character varying(255) NOT NULL,
    password character varying(255) DEFAULT ''::character varying NOT NULL,
    name character varying(255) DEFAULT ''::character varying NOT NULL,
    maildir character varying(255) DEFAULT ''::character varying NOT NULL,
    quota bigint DEFAULT 0 NOT NULL,
    created timestamp with time zone DEFAULT now(),
    modified timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL,
    domain character varying(255),
    local_part character varying(255) NOT NULL,
    phone character varying(30) DEFAULT ''::character varying NOT NULL,
    email_other character varying(255) DEFAULT ''::character varying NOT NULL,
    token character varying(255) DEFAULT ''::character varying NOT NULL,
    token_validity timestamp with time zone DEFAULT '2000-01-01 00:00:00+00'::timestamp with time zone,
    password_expiry timestamp with time zone DEFAULT '2000-01-01 00:00:00+00'::timestamp with time zone
);


ALTER TABLE public.mailbox OWNER TO postfix;

--
-- Name: TABLE mailbox; Type: COMMENT; Schema: public; Owner: postfix
--

COMMENT ON TABLE public.mailbox IS 'Postfix Admin - Virtual Mailboxes';


--
-- Name: quota; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.quota (
    username character varying(255) NOT NULL,
    path character varying(100) NOT NULL,
    current bigint DEFAULT 0 NOT NULL
);


ALTER TABLE public.quota OWNER TO postfix;

--
-- Name: quota2; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.quota2 (
    username character varying(100) NOT NULL,
    bytes bigint DEFAULT 0 NOT NULL,
    messages integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.quota2 OWNER TO postfix;

--
-- Name: sender_aliases; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.sender_aliases (
    alias text NOT NULL,
    allowed_senders text[]
);


ALTER TABLE public.sender_aliases OWNER TO postgres;

--
-- Name: uids; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.uids (
    uid integer,
    address text
);


ALTER TABLE public.uids OWNER TO postgres;

--
-- Name: vacation; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.vacation (
    email character varying(255) NOT NULL,
    subject character varying(255) NOT NULL,
    body text DEFAULT ''::text NOT NULL,
    created timestamp with time zone DEFAULT now(),
    active boolean DEFAULT true NOT NULL,
    domain character varying(255),
    modified timestamp with time zone DEFAULT now(),
    activefrom timestamp with time zone DEFAULT '2000-01-01 00:00:00+00'::timestamp with time zone,
    activeuntil timestamp with time zone DEFAULT '2038-01-18 00:00:00+00'::timestamp with time zone,
    interval_time integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.vacation OWNER TO postfix;

--
-- Name: vacation_notification; Type: TABLE; Schema: public; Owner: postfix
--

CREATE TABLE public.vacation_notification (
    on_vacation character varying(255) NOT NULL,
    notified character varying(255) NOT NULL,
    notified_at timestamp with time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.vacation_notification OWNER TO postfix;

--
-- Name: config id; Type: DEFAULT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.config ALTER COLUMN id SET DEFAULT nextval('public.config_id_seq'::regclass);


--
-- Name: domain_admins id; Type: DEFAULT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.domain_admins ALTER COLUMN id SET DEFAULT nextval('public.domain_admins_id_seq'::regclass);


--
-- Name: fetchmail id; Type: DEFAULT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.fetchmail ALTER COLUMN id SET DEFAULT nextval('public.fetchmail_id_seq'::regclass);


--
-- Name: log id; Type: DEFAULT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.log ALTER COLUMN id SET DEFAULT nextval('public.log_id_seq'::regclass);


--
-- Data for Name: admin; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.admin (username, password, created, modified, active, superadmin, phone, email_other, token, token_validity) FROM stdin;
postmaster@segfault.party	{CRAM-MD5}30338a9747b60151e18af41f2d9141bd2e4293f26a0adec8db1ee29203a53024	2016-08-18 10:51:03.844543+00	2016-08-18 10:51:03.844543+00	t	t				2000-01-01 00:00:00+00
\.


--
-- Data for Name: alias; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.alias (address, goto, domain, created, modified, active) FROM stdin;
s.vankampen@harrywf.nl	s.vankampen@harrywf.nl	harrywf.nl	2016-08-18 12:40:14.651367+00	2016-08-18 12:40:14.651367+00	t
r.wacanno@harrywf.nl	r.wacanno@harrywf.nl	harrywf.nl	2016-08-18 13:36:39.563972+00	2016-08-18 13:36:39.563972+00	t
w.stam@harrywf.nl	w.stam@harrywf.nl	harrywf.nl	2016-08-18 13:36:56.88205+00	2016-08-18 13:36:56.88205+00	t
a.luong@harrywf.nl	a.luong@harrywf.nl	harrywf.nl	2016-08-18 13:37:22.311793+00	2016-08-18 13:37:22.311793+00	t
hoofdredactie@harrywf.nl	s.vankampen@harrywf.nl,r.wacanno@harrywf.nl,w.stam@harrywf.nl,a.luong@harrywf.nl	harrywf.nl	2016-08-18 15:03:21.0743+00	2016-08-18 15:03:21.0743+00	t
printer@imgf.lt	printer@imgf.lt	imgf.lt	2024-01-12 23:24:25.478047+00	2024-01-12 23:24:25.478047+00	t
\.


--
-- Data for Name: alias_domain; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.alias_domain (alias_domain, target_domain, created, modified, active) FROM stdin;
\.


--
-- Data for Name: config; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.config (id, name, value) FROM stdin;
1	version	1844
\.


--
-- Data for Name: domain; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.domain (domain, description, aliases, mailboxes, maxquota, quota, transport, backupmx, created, modified, active, password_expiry) FROM stdin;
ALL		0	0	0	0		f	2016-08-18 10:49:36.478217+00	2016-08-18 10:49:36.478217+00	t	0
harrywf.nl	Schoolkrant!	20	20	10	2048	virtual	f	2016-08-18 11:29:41.049748+00	2016-08-18 11:30:11.170791+00	t	0
imgf.lt	Imagefault	20	20	10	2048	virtual	f	2018-09-18 10:38:28.409371+00	2018-09-18 10:38:28.409371+00	t	0
\.


--
-- Data for Name: domain_admins; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.domain_admins (username, domain, created, active, id) FROM stdin;
postmaster@segfault.party	ALL	2016-08-18 10:51:03.848779+00	t	1
\.


--
-- Data for Name: fetchmail; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.fetchmail (id, mailbox, src_server, src_auth, src_user, src_password, src_folder, poll_time, fetchall, keep, protocol, extra_options, returned_text, mda, date, usessl, sslcertck, sslcertpath, sslfingerprint, domain, active, created, modified, src_port) FROM stdin;
\.


--
-- Data for Name: log; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.log ("timestamp", username, domain, action, data, id) FROM stdin;
2016-08-18 10:51:03.852002+00	SETUP.PHP (84.107.84.219)		create_admin	postmaster@segfault.party	1
2016-08-18 11:29:41.067928+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_domain	harrywf.nl	2
2016-08-18 11:30:11.180476+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	edit_domain	harrywf.nl	3
2016-08-18 11:30:51.754512+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	s.vankampen@harrywf.nl	4
2016-08-18 12:39:17.480103+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	delete_alias	s.vankampen@harrywf.nl	5
2016-08-18 12:40:14.656465+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	s.vankampen@harrywf.nl	6
2016-08-18 12:40:15.230871+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_mailbox	s.vankampen@harrywf.nl	7
2016-08-18 13:36:39.571649+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	r.wacanno@harrywf.nl	8
2016-08-18 13:36:40.024424+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_mailbox	r.wacanno@harrywf.nl	9
2016-08-18 13:36:56.886066+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	w.stam@harrywf.nl	10
2016-08-18 13:36:57.010009+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_mailbox	w.stam@harrywf.nl	11
2016-08-18 13:37:22.315069+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	a.luong@harrywf.nl	12
2016-08-18 13:37:22.445061+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_mailbox	a.luong@harrywf.nl	13
2016-08-18 15:03:21.079889+00	postmaster@segfault.party (84.107.84.219)	harrywf.nl	create_alias	hoofdredactie@harrywf.nl	14
2017-08-18 19:21:36.768208+00	postmaster@segfault.party (213.124.216.143)	segfault.party	create_domain	segfault.party	15
2017-08-18 19:22:12.829333+00	postmaster@segfault.party (213.124.216.143)	segfault.party	create_alias	sam@segfault.party	16
2017-08-18 19:22:13.187711+00	postmaster@segfault.party (213.124.216.143)	segfault.party	create_mailbox	sam@segfault.party	17
2024-01-12 23:22:25.758188+00	postmaster@segfault.party (77.174.48.220)	harrywf.nl	delete_alias	abuse@harrywf.nl	18
2024-01-12 23:22:29.761888+00	postmaster@segfault.party (77.174.48.220)	harrywf.nl	delete_alias	hostmaster@harrywf.nl	19
2024-01-12 23:22:32.125882+00	postmaster@segfault.party (77.174.48.220)	harrywf.nl	delete_alias	postmaster@harrywf.nl	20
2024-01-12 23:22:34.343853+00	postmaster@segfault.party (77.174.48.220)	harrywf.nl	delete_alias	webmaster@harrywf.nl	21
2024-01-12 23:24:25.481485+00	postmaster@segfault.party (77.174.48.220)	imgf.lt	create_alias	printer@imgf.lt	22
2024-01-12 23:24:25.679022+00	postmaster@segfault.party (77.174.48.220)	imgf.lt	create_mailbox	printer@imgf.lt	23
\.


--
-- Data for Name: mailbox; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.mailbox (username, password, name, maildir, quota, created, modified, active, domain, local_part, phone, email_other, token, token_validity, password_expiry) FROM stdin;
a.luong@harrywf.nl	{CRAM-MD5}3ae8284d792270df1865fbeccc37cb643d0005e270ce07cc1d1f9b25cde8eaee	Angela Luong	harrywf.nl/a.luong@harrywf.nl/	51200000	2016-08-18 13:37:22.364761+00	2016-08-18 13:37:22.364761+00	f	harrywf.nl	a.luong				2000-01-01 00:00:00+00	2000-01-01 00:00:00+00
w.stam@harrywf.nl	{CRAM-MD5}4f9855d59297f56fc5a4071093c0039324fb5d0b5b3a1ffaccbf3453fd4e4d72	Wilco Stam	harrywf.nl/w.stam@harrywf.nl/	51200000	2016-08-18 13:36:56.948458+00	2016-08-18 13:36:56.948458+00	f	harrywf.nl	w.stam				2000-01-01 00:00:00+00	2000-01-01 00:00:00+00
r.wacanno@harrywf.nl	{CRAM-MD5}f6673fde8caf5e33c8e0649771e8263c7146cfede855a6c0aa964e7dfb308bad	Robin Wacanno	harrywf.nl/r.wacanno@harrywf.nl/	51200000	2016-08-18 13:36:39.681613+00	2016-08-18 13:36:39.681613+00	f	harrywf.nl	r.wacanno				2000-01-01 00:00:00+00	2000-01-01 00:00:00+00
s.vankampen@harrywf.nl	{CRAM-MD5}f6cfb988312c5ade2dc3b7dc60830ddc8fd21c077802e00c04c0e524f0b15b37	Sam van Kampen	harrywf.nl/s.vankampen@harrywf.nl/	51200000	2016-08-18 12:40:14.722105+00	2016-08-18 12:40:14.722105+00	f	harrywf.nl	s.vankampen				2000-01-01 00:00:00+00	2000-01-01 00:00:00+00
sam@imgf.lt	{CRAM-MD5}f6cfb988312c5ade2dc3b7dc60830ddc8fd21c077802e00c04c0e524f0b15b37	Sam van Kampen	imgf.lt/sam@imgf.lt/	51200000	2018-09-18 10:40:30.074013+00	2018-09-18 10:40:30.074013+00	t	imgf.lt	sam				2000-01-01 00:00:00+00	2000-01-01 00:00:00+00
printer@imgf.lt	{CRAM-MD5}e12d1609c63f3795451967895d48a4cdd0a9818df6a51c23c0fee880436bd054	Printer	imgf.lt/printer/	10240000	2024-01-12 23:24:25.524173+00	2024-01-12 23:24:25.524173+00	t	imgf.lt	printer		sam@tehsvk.net		2024-01-12 23:24:25+00	2024-01-12 23:24:00+00
\.


--
-- Data for Name: quota; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.quota (username, path, current) FROM stdin;
\.


--
-- Data for Name: quota2; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.quota2 (username, bytes, messages) FROM stdin;
\.


--
-- Data for Name: sender_aliases; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.sender_aliases (alias, allowed_senders) FROM stdin;
hoofdredactie@harrywf.nl	{a.luong@harrywf.nl,s.vankampen@harrywf.nl,r.wacanno@harrywf.nl,w.stam@harrywf.nl}
\.


--
-- Data for Name: uids; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.uids (uid, address) FROM stdin;
1003	sam@segfault.party
1002	jan@segfault.party
1000	bots@segfault.party
1007	git@segfault.party
\.


--
-- Data for Name: vacation; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.vacation (email, subject, body, created, active, domain, modified, activefrom, activeuntil, interval_time) FROM stdin;
\.


--
-- Data for Name: vacation_notification; Type: TABLE DATA; Schema: public; Owner: postfix
--

COPY public.vacation_notification (on_vacation, notified, notified_at) FROM stdin;
\.


--
-- Name: config_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postfix
--

SELECT pg_catalog.setval('public.config_id_seq', 1, true);


--
-- Name: domain_admins_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postfix
--

SELECT pg_catalog.setval('public.domain_admins_id_seq', 1, true);


--
-- Name: fetchmail_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postfix
--

SELECT pg_catalog.setval('public.fetchmail_id_seq', 1, true);


--
-- Name: log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postfix
--

SELECT pg_catalog.setval('public.log_id_seq', 23, true);


--
-- Name: admin admin_key; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.admin
    ADD CONSTRAINT admin_key PRIMARY KEY (username);


--
-- Name: alias_domain alias_domain_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.alias_domain
    ADD CONSTRAINT alias_domain_pkey PRIMARY KEY (alias_domain);


--
-- Name: alias alias_key; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.alias
    ADD CONSTRAINT alias_key PRIMARY KEY (address);


--
-- Name: sender_aliases alias_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sender_aliases
    ADD CONSTRAINT alias_unique PRIMARY KEY (alias);


--
-- Name: config config_name_key; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.config
    ADD CONSTRAINT config_name_key UNIQUE (name);


--
-- Name: config config_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.config
    ADD CONSTRAINT config_pkey PRIMARY KEY (id);


--
-- Name: domain_admins domain_admins_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.domain_admins
    ADD CONSTRAINT domain_admins_pkey PRIMARY KEY (id);


--
-- Name: domain domain_key; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.domain
    ADD CONSTRAINT domain_key PRIMARY KEY (domain);


--
-- Name: fetchmail fetchmail_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.fetchmail
    ADD CONSTRAINT fetchmail_pkey PRIMARY KEY (id);


--
-- Name: log log_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.log
    ADD CONSTRAINT log_pkey PRIMARY KEY (id);


--
-- Name: mailbox mailbox_key; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.mailbox
    ADD CONSTRAINT mailbox_key PRIMARY KEY (username);


--
-- Name: quota2 quota2_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.quota2
    ADD CONSTRAINT quota2_pkey PRIMARY KEY (username);


--
-- Name: quota quota_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.quota
    ADD CONSTRAINT quota_pkey PRIMARY KEY (username, path);


--
-- Name: vacation_notification vacation_notification_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.vacation_notification
    ADD CONSTRAINT vacation_notification_pkey PRIMARY KEY (on_vacation, notified);


--
-- Name: vacation vacation_pkey; Type: CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.vacation
    ADD CONSTRAINT vacation_pkey PRIMARY KEY (email);


--
-- Name: alias_address_active; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX alias_address_active ON public.alias USING btree (address, active);


--
-- Name: alias_domain_active; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX alias_domain_active ON public.alias_domain USING btree (alias_domain, active);


--
-- Name: alias_domain_idx; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX alias_domain_idx ON public.alias USING btree (domain);


--
-- Name: domain_domain_active; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX domain_domain_active ON public.domain USING btree (domain, active);


--
-- Name: log_domain_timestamp_idx; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX log_domain_timestamp_idx ON public.log USING btree (domain, "timestamp");


--
-- Name: mailbox_domain_idx; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX mailbox_domain_idx ON public.mailbox USING btree (domain);


--
-- Name: mailbox_username_active; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX mailbox_username_active ON public.mailbox USING btree (username, active);


--
-- Name: vacation_email_active; Type: INDEX; Schema: public; Owner: postfix
--

CREATE INDEX vacation_email_active ON public.vacation USING btree (email, active);


--
-- Name: quota mergequota; Type: TRIGGER; Schema: public; Owner: postfix
--

CREATE TRIGGER mergequota BEFORE INSERT ON public.quota FOR EACH ROW EXECUTE FUNCTION public.merge_quota();


--
-- Name: quota2 mergequota2; Type: TRIGGER; Schema: public; Owner: postfix
--

CREATE TRIGGER mergequota2 BEFORE INSERT ON public.quota2 FOR EACH ROW EXECUTE FUNCTION public.merge_quota2();


--
-- Name: alias_domain alias_domain_alias_domain_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.alias_domain
    ADD CONSTRAINT alias_domain_alias_domain_fkey FOREIGN KEY (alias_domain) REFERENCES public.domain(domain) ON DELETE CASCADE;


--
-- Name: alias alias_domain_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.alias
    ADD CONSTRAINT alias_domain_fkey FOREIGN KEY (domain) REFERENCES public.domain(domain);


--
-- Name: alias_domain alias_domain_target_domain_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.alias_domain
    ADD CONSTRAINT alias_domain_target_domain_fkey FOREIGN KEY (target_domain) REFERENCES public.domain(domain) ON DELETE CASCADE;


--
-- Name: domain_admins domain_admins_domain_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.domain_admins
    ADD CONSTRAINT domain_admins_domain_fkey FOREIGN KEY (domain) REFERENCES public.domain(domain);


--
-- Name: mailbox mailbox_domain_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.mailbox
    ADD CONSTRAINT mailbox_domain_fkey1 FOREIGN KEY (domain) REFERENCES public.domain(domain);


--
-- Name: vacation vacation_domain_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.vacation
    ADD CONSTRAINT vacation_domain_fkey1 FOREIGN KEY (domain) REFERENCES public.domain(domain);


--
-- Name: vacation_notification vacation_notification_on_vacation_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postfix
--

ALTER TABLE ONLY public.vacation_notification
    ADD CONSTRAINT vacation_notification_on_vacation_fkey FOREIGN KEY (on_vacation) REFERENCES public.vacation(email) ON DELETE CASCADE;


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
-- Name: TABLE admin; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.admin TO postfix;


--
-- Name: TABLE alias; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.alias TO postfix;


--
-- Name: TABLE alias_domain; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.alias_domain TO postfix;


--
-- Name: TABLE config; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.config TO postfix;


--
-- Name: TABLE domain; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.domain TO postfix;


--
-- Name: TABLE domain_admins; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.domain_admins TO postfix;


--
-- Name: TABLE fetchmail; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.fetchmail TO postfix;


--
-- Name: TABLE log; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.log TO postfix;


--
-- Name: TABLE mailbox; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.mailbox TO postfix;


--
-- Name: TABLE quota; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.quota TO postfix;


--
-- Name: TABLE quota2; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.quota2 TO postfix;


--
-- Name: TABLE sender_aliases; Type: ACL; Schema: public; Owner: postgres
--

GRANT SELECT ON TABLE public.sender_aliases TO postfix;


--
-- Name: TABLE uids; Type: ACL; Schema: public; Owner: postgres
--

GRANT SELECT ON TABLE public.uids TO postfix;


--
-- Name: TABLE vacation; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.vacation TO postfix;


--
-- Name: TABLE vacation_notification; Type: ACL; Schema: public; Owner: postfix
--

GRANT SELECT ON TABLE public.vacation_notification TO postfix;


--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres
--

ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT SELECT ON TABLES  TO postfix;


--
-- PostgreSQL database dump complete
--

