[Dovecot] tables between dovecot and postfix and a paradoxical question

Benny Pedersen me at junc.eu
Sun Jun 23 19:30:14 EEST 2013


Mohsen Pahlevanzadeh skrev den 2013-06-22 01:25:

> How can i combine together?

i created username like this:

# sql dump

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

CREATE TABLE IF NOT EXISTS `username` (
`concat(userid,"@",domain)` varchar(257)
);

CREATE TABLE IF NOT EXISTS `users` (
   `userid` varchar(128) NOT NULL,
   `domain` varchar(128) NOT NULL,
   `password` varchar(64) NOT NULL,
   `home` varchar(255) NOT NULL,
   `uid` int(11) NOT NULL,
   `gid` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `users` (`userid`, `domain`, `password`, `home`, `uid`, 
`gid`) VALUES
('me', 'example.org', 'password', 'homedir', 1000, 1000);

DROP TABLE IF EXISTS `username`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY 
DEFINER VIEW `username` AS select 
concat(`users`.`userid`,'@',`users`.`domain`) AS 
`concat(userid,"@",domain)` from `users`;

now username contains same info that postfixadmin creates :)

-- 
senders that put my email into body content will deliver it to my own 
trashcan, so if you like to get reply, dont do it


More information about the dovecot mailing list