<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — Catch for postmaster@, hostmaster@ and so on]]></title>
	<link rel="self" href="http://www.iredmail.org/forum/feed-atom-topic431.xml" />
	<updated>2009-11-18T11:39:56Z</updated>
	<generator>PunBB</generator>
	<id>http://www.iredmail.org/forum/topic431-catch-for-postmaster-hostmaster-and-so-on.html</id>
		<entry>
			<title type="html"><![CDATA[Re: Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1866.html#p1866" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>maxie_ro wrote:</cite><blockquote><p>ZhangHuangbin, you should include this in the next version/hotfix.</p></blockquote></div><p>I will consider merge it in next version, but it&#039;s not a hotFIX. <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Thanks for your testing and contribution <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2009-11-18T11:39:56Z</updated>
			<id>http://www.iredmail.org/forum/post1866.html#p1866</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1865.html#p1865" />
			<content type="html"><![CDATA[<p>Solution found.</p><p>For iRedOS 5.0:<br />1. Create new table in database <strong>vmail</strong>:<br /></p><div class="codebox"><pre><code>CREATE TABLE `vmail`.`common_alias` (
  `address` VARCHAR(128) NOT NULL COMMENT &#039;Received base address (without domain part)&#039;,
  `goto` VARCHAR(128) NOT NULL COMMENT &#039;Where to redirect (domain part MUST be included)&#039;,
  `created` DATETIME DEFAULT NULL,
  `modified` DATETIME DEFAULT NULL,
  `expired` DATETIME NOT NULL DEFAULT &#039;9999-12-31 00:00:00&#039;,
  `active` BOOLEAN NOT NULL DEFAULT 0,
  PRIMARY KEY (`address`)
)
ENGINE = MyISAM
CHARACTER SET utf8 COLLATE utf8_general_ci
COMMENT = &#039;Common aliases for all domains&#039;;</code></pre></div><p>2. Populate the above table with the values you need, for example:<br /></p><div class="codebox"><pre><code>INSERT INTO `common_alias` SET `address`=&#039;postmaster&#039;, `goto`=&#039;postmaster@example.com&#039;, `created`=NOW(), `modified`=NULL, `expired`=&#039;9999-12-31 00:00:00&#039;, `active`=1;

INSERT INTO `common_alias` SET `address`=&#039;abuse&#039;, `goto`=&#039;abuse@example.com&#039;, `created`=NOW(), `modified`=NULL, `expired`=&#039;9999-12-31 00:00:00&#039;, `active`=1;

INSERT INTO `common_alias` SET `address`=&#039;hostmaster&#039;, `goto`=&#039;hostmaster@example.com&#039;, `created`=NOW(), `modified`=NULL, `expired`=&#039;9999-12-31 00:00:00&#039;, `active`=1;

INSERT INTO `common_alias` SET `address`=&#039;webmaster&#039;, `goto`=&#039;webmaster@example.com&#039;, `created`=NOW(), `modified`=NULL, `expired`=&#039;9999-12-31 00:00:00&#039;, `active`=1;</code></pre></div><p>3. Create file /etc/postfix/mysql_virtual_common_alias_maps.cf, with the following contents:<br /></p><div class="codebox"><pre><code>user                = vmail
password    = your_password_here
hosts            = 127.0.0.1
port                = 3306
dbname        = vmail
query            =  SELECT goto FROM common_alias WHERE address = &#039;%u&#039; AND active=&#039;1&#039; AND expired &gt;= NOW() AND &#039;%d&#039; IN (SELECT domain FROM domain WHERE domain=&#039;%d&#039;);</code></pre></div><p>Be sure to modify &quot;your_password_here&quot; with your real password for user vmail.</p><p>4. Modify the entry in <strong>/etc/postfix/main.cf</strong> to include the new map:<br /></p><div class="codebox"><pre><code>virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_common_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_maps.cf</code></pre></div><p>If you use proxymap, adapt it for proxymap.</p><p>5. Test it.</p><br /><p>P.S.<br />ZhangHuangbin, you should include this in the next version/hotfix. <img src="http://www.iredmail.org/forum/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></content>
			<author>
				<name><![CDATA[maxie_ro]]></name>
				<uri>http://www.iredmail.org/forum/user381.html</uri>
			</author>
			<updated>2009-11-18T11:34:28Z</updated>
			<id>http://www.iredmail.org/forum/post1865.html#p1865</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1864.html#p1864" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>maxie_ro wrote:</cite><blockquote><p>I have a MySQL backend, so /etc/postfix/virtual is not used</p></blockquote></div><p>You can use multiple mysql query table, such as:<br /></p><div class="codebox"><pre><code>virtual_mailbox_maps = hash:/etc/postfix/virtual, mysql:/etc/xxx</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2009-11-18T11:31:45Z</updated>
			<id>http://www.iredmail.org/forum/post1864.html#p1864</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1863.html#p1863" />
			<content type="html"><![CDATA[<p>Yes, I saw those ones, unfortunately it won&#039;t work, because I have a MySQL backend, so /etc/postfix/virtual is not used, and I shouldn&#039;t enable it.</p><p>Hmmm, lemme see if I can put something in the database. I hope I won&#039;t crash postfix... <img src="http://www.iredmail.org/forum/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></content>
			<author>
				<name><![CDATA[maxie_ro]]></name>
				<uri>http://www.iredmail.org/forum/user381.html</uri>
			</author>
			<updated>2009-11-18T09:43:59Z</updated>
			<id>http://www.iredmail.org/forum/post1863.html#p1863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1861.html#p1861" />
			<content type="html"><![CDATA[<p>Search &#039;postfix catchall&#039; in Google, and you will get answer. Postfix supports this. <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>And here is another reference: <a href="http://www.cyberciti.biz/faq/howto-setup-postfix-catch-all-email-accounts/">http://www.cyberciti.biz/faq/howto-setu … -accounts/</a></p><p>Good luck <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2009-11-18T09:34:18Z</updated>
			<id>http://www.iredmail.org/forum/post1861.html#p1861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Catch for postmaster@, hostmaster@ and so on]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post1860.html#p1860" />
			<content type="html"><![CDATA[<p>Hi.</p><p>I have a small problem, and I&#039;m not sure how to tackle it.<br />I have a few domains on the server, like domain1.net, domain2.com and so on.</p><p>How can I catch all mail sent to postmaster@domain1.net, hostmaster@xyz.com, abuse@asdsa.org and so on to be automatically redirected to corresponding addresses on the main domain?</p><p>I would like to do this without declaring aliases for each domain. Something that works &quot;automagically&quot;, for existing domains and for other domains I will create in the future, without me needing to declare anything else.</p><p>Also, I want to receive only mails which were intended for abuse@, postmaster@, not for all existing or non-existing addresses.</p><p>Any clues?</p><p>Thanks!</p>]]></content>
			<author>
				<name><![CDATA[maxie_ro]]></name>
				<uri>http://www.iredmail.org/forum/user381.html</uri>
			</author>
			<updated>2009-11-18T09:23:36Z</updated>
			<id>http://www.iredmail.org/forum/post1860.html#p1860</id>
		</entry>
</feed>
