王朝网络
分享
 
 
 

关于Postfix虚拟域的相关释疑

王朝other·作者佚名  2008-05-31
宽屏版  字体: |||超大  

在Postfix 1.1.x中,virtual_maps及virtual_mailbox_maps容易搞混,而在未来的Postfix 2.x中,virtual_*相关的设置也会有所变动。因此有必要搞清楚两者之间的区别和联系,以及虚拟域在Postfix中的实现和相关含义。

寄件者:"James T. Richardson, Jr." (james.richardson@wickander.com)

主旨:Postifix %26amp; Virtual Domains

View this article only

新闻群组:mailing.postfix.users

日期:2002-11-26 15:12:06 PST

After setting up Postfix + MySQL I'm having a hard time getting "virtual

aliases" working.

I'm wanting to use Virtual Mailbox Domains (not Postfix-Style, nor

Sendmail-Style).

Mail is delivered to both my local domain and to my virtual domains. At

least for my users that have Maildir's defined.

Relevant sectionof the config:

---

myhostname = mail-gateway.mydomain.com

myorigin = $mydomain

mydestination = $myhostname, localhost.$mydomain $mydomain

local_recipient_maps = $alias_maps unix:passwd.byname

alias_maps = hash:/etc/postfix/aliases

alias_database = $alias_maps

transport_maps = mysql:/etc/postfix/transport.cf

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virt.cf

hash:/etc/postfix/virtual

virtual_uid_maps = mysql:/etc/postfix/uids.cf

virtual_gid_maps = mysql:/etc/postfix/gids.cf

virtual_mailbox_base = /var/mail/vhosts

---

The "mysql_virt.cf" file looks like:

user=postfix

password=sekret

dbname=maildb

table=users

select_field_maildir

where_field=address

hosts=localhost

Following instructions by Victor Duchovni

(http://groups.google.com/groups?hl=en%26amp;lr=%26amp;ie=UTF-8%26amp;oe=UTF-8%26amp;selm=ajh5mv

$h93$1@FreeBSD.csie.NCTU.edu.tw%26amp;rnum=1):

I call such domains *virtual-mailbox* domains. To define a virtual-mailbox

domain, just a "domain whatever" entry to one of the tables listed in

$virtual_mailbox_maps. For now it is also necessary to add the domain to

the transport table in order to arrange for mail to the domain to be

handled by a suitable virtual delivery agent (presumably but not

necessarily the Postfix "virtual" delivery agent).

I created a simple hash (for now) files of "domain whatever" (and ran

postmap on it) and stuck it on the end of virtual_mailbox_maps.

Now, I'm not sure where to create these aliases or where to tell Postfix

about them. I tried putting an alias to postmaster@domain underneath the

"domain whatever" line in the virtual file, but that didn't work. I got

a

To=, relay=virtual, delay=0, status=deferred

(recipient postmaster@domain: uid not found in virtual_uid_maps)

Surely my aliases don't need assciated UID/GID's? do they?

---

James T. Richardson, Jr.

james.richardson@wickander.com

Post a follow-up to this message

Message 2 in thread

寄件者:Russell Mosemann (mose@ns.cune.edu)

主旨:Re: Postifix %26amp; Virtual Domains

View this article only

新闻群组:mailing.postfix.users

日期:2002-11-26 15:33:51 PST

On Tue, 26 Nov 2002, James T. Richardson, Jr. wrote:

After setting up Postfix + MySQL I'm having a hard time getting "virtual

aliases" working.

I'm wanting to use Virtual Mailbox Domains (not Postfix-Style, nor

Sendmail-Style).

Mail is delivered to both my local domain and to my virtual domains. At

least for my users that have Maildir's defined.

Relevant sectionof the config:

---

myhostname = mail-gateway.mydomain.com

myorigin = $mydomain

mydestination = $myhostname, localhost.$mydomain $mydomain

local_recipient_maps = $alias_maps unix:passwd.byname

alias_maps = hash:/etc/postfix/aliases

alias_database = $alias_maps

transport_maps = mysql:/etc/postfix/transport.cf

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virt.cf

hash:/etc/postfix/virtual

virtual_uid_maps = mysql:/etc/postfix/uids.cf

virtual_gid_maps = mysql:/etc/postfix/gids.cf

virtual_mailbox_base = /var/mail/vhosts

---

The "mysql_virt.cf" file looks like:

user=postfix

password=sekret

dbname=maildb

table=users

select_field_maildir

where_field=address

hosts=localhost

Following instructions by Victor Duchovni

(http://groups.google.com/groups?hl=en%26amp;lr=%26amp;ie=UTF-8%26amp;oe=UTF-8%26amp;selm=ajh5mv

$h93$1@FreeBSD.csie.NCTU.edu.tw%26amp;rnum=1):

I call such domains *virtual-mailbox* domains. To define a virtual-mailbox

domain, just a "domain whatever" entry to one of the tables listed in

$virtual_mailbox_maps. For now it is also necessary to add the domain to

the transport table in order to arrange for mail to the domain to be

handled by a suitable virtual delivery agent (presumably but not

necessarily the Postfix "virtual" delivery agent).

I created a simple hash (for now) files of "domain whatever" (and ran

postmap on it) and stuck it on the end of virtual_mailbox_maps.

Now, I'm not sure where to create these aliases or where to tell Postfix

about them. I tried putting an alias to postmaster@domain underneath the

"domain whatever" line in the virtual file, but that didn't work. I got

a

To=, relay=virtual, delay=0, status=deferred

(recipient postmaster@domain: uid not found in virtual_uid_maps)

Surely my aliases don't need assciated UID/GID's? do they?

I don't think you read Victor's message very carefully. A virtual domain

is different from a virtual mailbox domain. virtual_maps are used not

only for redirecting email from one address to one or more other

addresses, it is also used for virtual domains. virtual_mailbox_maps are

used for virtual mailbox domains and for mailboxes on the local computer

that do not have an associated Unix account. You are mixing the two, and

that is the cause of your problems.

----

Russell Mosemann, Ph.D. * Computing Services * Concordia University, Nebraska

"A penny saved is a penny earned." "Penny wise, pound foolish."

Post a follow-up to this message

Message 3 in thread

寄件者:Victor.Duchovni@morganstanley.com (Victor.Duchovni@morganstanley.com)

主旨:Re: Postifix %26amp; Virtual Domains

View this article only

新闻群组:mailing.postfix.users

日期:2002-11-26 19:12:51 PST

On Tue, 26 Nov 2002, James T. Richardson, Jr. wrote:

Following instructions by Victor Duchovni

(http://groups.google.com/groups?hl=en%26amp;lr=%26amp;ie=UTF-8%26amp;oe=UTF-8%26amp;selm=ajh5mv

$h93$1@FreeBSD.csie.NCTU.edu.tw%26amp;rnum=1):

I call such domains *virtual-mailbox* domains. To define a virtual-mailbox

domain, just a "domain whatever" entry to one of the tables listed in

$virtual_mailbox_maps. For now it is also necessary to add the domain to

the transport table in order to arrange for mail to the domain to be

handled by a suitable virtual delivery agent (presumably but not

necessarily the Postfix "virtual" delivery agent).

I created a simple hash (for now) files of "domain whatever" (and ran

postmap on it) and stuck it on the end of virtual_mailbox_maps.

Now, I'm not sure where to create these aliases or where to tell Postfix

about them. I tried putting an alias to postmaster@domain underneath the

"domain whatever" line in the virtual file, but that didn't work. I got

a

To=, relay=virtual, delay=0, status=deferred

(recipient postmaster@domain: uid not found in virtual_uid_maps)

You actually searched for and found some documentation and mostly

followed it correctly! You deserve a break.

Your issue is that you are trying to specify address rewriting rules

("aliases" of sorts) for virtual mailbox domains in the

virtual_mailbox_maps tables. These tables define the pathname of the

virtual user's mailbox, not an alternate address.

For virtual mailbox users the only available address rewriting mechanism

is $virtual_maps. Don't put the "domain anything" keys for virtual

mailbox domainsthere, but do put address rewriting rules there.

So

virtual_mailbox_maps = hash:/etc/postfix/vmboxdomains, mysql:mumble

virtual_maps = mysql:fumble

/etc/postfix/vmboxdomains will have all the "domain anything" keys. List

it first, as these lookups will be very fast in comparison to mysql.

mysql:mumble will map virtual users to their mailbox path.

mysql:fumble (or hash:fumble) will map "aliased" virtual users to the

correct email address(es).

--

Viktor.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
>>返回首页<<
推荐阅读
 
 
频道精选
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有