|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: p dont think (pdontthink_at_angrynerds.com)
Date: Mon Sep 02 2002 - 04:23:31 CDT
1. I LEFT OUT ONE MAJOR PIECE OF THE PUZZLE! It is simply this:
You need to reference the aliases.majordomo file in your main.cf alias_map parameter. Since all my other aliasing is done in MySQL, that is the only thing I have listed there:
In /etc/postfix/main.cf.....
alias_maps = hash:/etc/postfix/aliases.majordomo
2. I should have mentioned this: In my particular implementation of MySQL virtual hosting I have "virtualized" EVERYTHING including my local domain, such that ALL email into my host is delivered to virtual domains. That means ZERO local transport (except for root and now majordomo which I have specifically set to local transport). This is important in that if you have set up local transport for your main domain name (the entire thing -- all addresses... the entry in the TRANSPORT table would be 'my_host_domain.tld' --> 'local'), then you would need to make the appropriate adjustments; the entry in the transport table for 'sample-list
your.real.host' --> 'local' is the only one I can think of off the top of my head (just delete it, no replacement should be needed), but there may be more.
3. I like what is suggested here by Daniel in terms of standardizing list aliasing. To answer your question, Daniel, yes, much of this can easily be duplicated in a Postfix environment in an almost identical way - MySQL or not. In fact, I think it would make the process easier to set up (and understand after the fact) in some regards (as is the idea behind standardization - imagine that!). It would also be a convenient solution to having identically-named lists on different virtual domains, which my current setup will not support.
However, for a setup like mine (see my explanation above), this requires a 2nd level of indirection - not a big deal, but a little convoluted:
In VIRTUAL:
list-request
domain --> domain-list-request
localdomain
In TRANSPORT:
domain-list-request
localdomain --> local
Whereas if local delivery was already specified for the entire local host domain, the extra entry in TRANSPORT is not necessary.
When you start talking about how you implemented your .cf files and whatnot, we are, of course, beyond the world of the MTA, and thus the conversation applies across the board: I think you've come up with a much more elegant solution that I whole-heartedly endorse.
Postfix's /etc/postfix/aliases.majordomo file would start to look something like (warning, I've not tested this):
domain1-majordomo: "|/usr/bin/majordomo-1.94.5/majordomo -C /usr/bin/majordomo-1.94.5/domain1/majordomo.cf"
domain2-majordomo: "|/usr/bin/majordomo-1.94.5/majordomo -C /usr/bin/majordomo-1.94.5/domain2/majordomo.cf"
domain1-sample: "|/usr/bin/majordomo-1.94.5/resend -l sample -C /usr/bin/majordomo-1.94.5/majordomo.domain1.cf sample-list"
domain1-sample-list: :include:/usr/bin/majordomo-1.94.5/domain1/lists/sample
I plan to integrate these suggestions into a future version of what I have posted at the web address in my original email, although that won't be done for some time since (unfortunately) I currently have other projects that have to take priority.
Cheers!
> -----Original Message-----
> From: Daniel Liston [mailto:dliston
sonny.org]
> Sent: Sunday, September 01, 2002 3:33 PM
> To: p dont think
> Cc: 'Bjî’šn Patrick Swift'; 'Thomas -Balu- Walter'; postfix-users
postfix.org;
> 'Kenny Olano'; kirby
insanegenius.net; lpeet
lucastek.com; jon
csh.rit.edu;
> Majordomo-Users
greatcircle.com
> Subject: Re: majordomo + postifx + virtual domains + mysql
>
> EXCELLENT! WONDERFUL!! FANTASTIC!!!
>
> Thank you, thank you, thank you.
>
> It is always painful when someone asks about postfix and we (I) can
> not give an answer due to lack of knowledge/experience. I am saving
> your message in my quick reference archive, so I can refer people to
> it in the future.
>
> Now I have questions and suggestions that might help keep certain
> funtionality standardized? for virtual hosting.
>
> I think RFCs define some of this. I should go look before spouting
> off, but here I am anyway. In a non-hosted environment, majordomo
> uses -suffix identifiers, and sendmail has a historical owner- prefix
> that typically is no longer documented. I propose that hosted lists
> should (not must) use a domain identifier as a prefix. A special
> exception would be owner-domain- prefix to stay compliant with RFCs
> and sendmail. Here are some examples;
>
> #Non-Hosted list aliases (sendmail & majordomo)
> list:
> list-owner:
> list-request:
> list-approval:
> list-digest:
> list-digest-owner:
> list-digest-request:
> list-digest-approval:
> #Non-Hosted list aliases (sendmail & RFC?)
> owner-list:
>
> #Hosted list aliases (sendmail & majordomo)
> domain-list:
> domain-list-request:
> domain-list-approval:
> domain-list-digest:
> domain-list-digest-owner:
> domain-list-digest-request:
> domain-list-digest-approval:
> #Non-Hosted list aliases (sendmail & RFC?)
> owner-domain-list:
>
> Sendmail does its virtual domains via the virtusertable:
> address
domain otheraddress
localdomain
>
> In the case of hosted lists, the above example would have
> matching entries in the virtusertable such as;
> list
domain
> domain-list
localdomain
> list-owner
domain domain-list-owner
localdomain
> list-request
domain domain-list-request
localdomain
> list-approval
domain domain-list-approval
localdomain
> similar entries for the digest version of the list would be here too.
>
> In the case of owner- addresses, the MTA would only use those
> internally, and does not need them specified to the outside
> world by adding them the the virtusertable.
>
> Do you see any similarities that can be applied to postfix?
>
> As for using a majordomo.cf per hosted domain, sendmail requires
> this too. I take the approach of leaving the /usr/lib/majordomo
> directory alone, but making subdirectories of /var/lib/majordomo
> when hosting domains. Another example;
>
> My primary domain gets the primary /var/lib/majordomo directory, but
> each hosted domain gets a subdirectory by domainname hosted. This
> would be /var/lib/majordomo/domain. The heirarchy then becomes;
> /var/lib/majordomo/domain/Log
> /var/lib/majordomo/domain/temp/
> /var/lib/majordomo/domain/lists/
> /var/lib/majordomo/domain/digests/
> /var/lib/majordomo/domain/archives/
> /var/lib/majordomo/domain/majordomo.cf
>
> And if you are security conscious with user logins on the same
> server as majordomo, rather than having
> /var/lib/majordomo/domain/majordomo.cf, you would also have an
> additional subdirectory under /usr/lib/majordomo for configs.
> /usr/lib/majordomo/configs/majordomo.cf
> or
> /usr/lib/majordomo/configs/domain.cf
>
> The idea behind these file/directory architectures, is the
> ability to use the filename majordomo.cf in multiple locations
> rather than having to name the majordomo.cf something different
> for each hosted domain. (which is another choice) If you
> implement the /configs/ directory, you really have not choice
> but to name the majordomo.cf for each hosted domain. Example;
> domain.cf vs majordomo.cf.
>
> Speaking of majordomo.cf, I do one more thing that is not
> commonly practiced, but as long as I am offering a method
> of standardizing, will post it as well. I introduce a
> concept of $datadir to my majordomo.cf. Using this with
> $whereami, and my directory based heirarchy, it is easy to
> template the majordomo.cf for my hosted domains. Last example;
>
> $whereami = "domain";
> $whoami = "Majordomo\
$whereami";
> $whoami_owner = "Majordomo-Owner\
$whereami";
> if ( defined $ENV{"HOME"}) {
> $homedir = $ENV{"HOME"};
> } else {
> $homedir = "/usr/lib/majordomo";
> }
> $datadir = "/var/lib/majordomo/domain";
> $listdir = "$datadir/lists";
> $digest_work_dir = "$datadir/digests";
> $log = "$datadir/Log";
> $config'default_subscribe_policy = "open+confirm";
> $config'default_unsubscribe_policy = "open+confirm";
> $filedir = "$datadir/archives";
> $filedir_suffix = "";
> $TMPDIR = "$datadir/temp";
>
>
> Hopefully, I have inspired additional thought or logic in your
> process that may be adopted or rejected. Keep up the good
> work. Your contribution is greatly appreciated.
>
> Dan Liston
>
> p dont think wrote:
> > I wanted to follow up on this thread even though it is quite old. I was
> recently trying to do the same thing (get majordomo working with a postfix
> virtual domain setup that is stored completely in mysql) and only found partial
> hints in all my archive searches.
> >
> > Fortunately, between all the partial hints and this page:
> http://www.greatcircle.com/majordomo/majordomo-faq.html#3.12 I was able to
> work it out so that I essentially have a majordomo for each and every one of
> my virtual domains. I have posted these same instructions (crudely for the
> time being) to http://patiencehosting.net/email_how-to/majordomo.html
> >
> > This is how I did it (RH7.3, majordomo-1.94.5... your paths may differ):
> >
> >
> > 1. General setup
> >
> >
> > -- can't run piped commands unless from alias map stored in unix... too bad.
> > -- TRANSPORT TABLE:
> > --
> > insert into transport (domain, transport) values
> ('majordomo-domain1
domain1.com', 'local');
> > insert into transport (domain, transport) values
> ('majordomo-domain2
domain2.com', 'local');
> >
> >
> > -- VIRTUAL TABLE:
> > --
> > insert into virtual (address, goto) values ('majordomo-owner',
> 'you
yourdomain.com');
> > insert into virtual (address, goto) values ('owner-majordomo',
> 'majordomo-owner');
> > insert into virtual (address, goto) values ('majordomo
domain1.com',
> 'majordomo-domain1
domain1.com');
> > insert into virtual (address, goto) values ('majordomo
domain2.com',
> 'majordomo-domain2
domain2.com');
> >
> >
> > So what I did here was basically create a separate majordomo alias for each
> domain so I will be able to tell them apart when we get to the aliases file.
> Each of those aliases needs to be told to deliver locally, of course, to even
> reach the aliases file we set up next:
> >
> >
> > Create a file called /etc/postfix/aliases.majordomo and make it look like...
> >
> > majordomo-domain1: "|/usr/bin/majordomo-1.94.5/majordomo -C
> /usr/bin/majordomo-1.94.5/majordomo.domain1.cf"
> > majordomo-domain2: "|/usr/bin/majordomo-1.94.5/majordomo -C
> /usr/bin/majordomo-1.94.5/majordomo.domain2.cf"
> >
> >
> > Create one config file for each virtual domain in
> /usr/bin/majordomo-1.94.5/majordomo as such:
> > majordomo.domain1.cf
> > majordomo.domain2.cf
> >
> >
> > You'll want to edit each of these config files, changing the typical
> parameters, the nice thing being that you can set $whereami to be match each
> domain:
> >
> > $whereami = "domain1.com";
> >
> >
> > Also, in my case, I needed to help majordomo find the right execution path
> -- inside of each and every one of these config files, make the following change:
> >
> > old: # $homedir -- Where can I find my extra .pl files, like majordomo.pl?
> > # the environment variable HOME is set by the wrapper
> >
> > if ( defined $ENV{"HOME"}) {
> > $homedir = $ENV{"HOME"};
> > } else {
> > $homedir = "/usr/bin/majordomo";
> > }
> >
> > new: # $homedir -- Where can I find my extra .pl files, like majordomo.pl?
> > # the environment variable HOME is set by the wrapper
> > #
> > #if ( defined $ENV{"HOME"}) {
> > # $homedir = $ENV{"HOME"};
> > #} else {
> > # $homedir = "/usr/bin/majordomo";
> > #}
> > $homedir = "/usr/bin/majordomo-1.94.5";
> >
> >
> > Finally, make sure permissions and ownership are correct - the goal is to
> have the majordomo user be the one who accesses and runs all these scripts.
> In my case that user is called "majordomo.daemon" (yah, oops, this isn't
> necessary since I'm using Postifx, but I was too lazy to fix it, so you can
> probably just use "majordom"):
> >
> > # i ran this as root and needed permission enough to run
> > # the postalias command on the aliases file, thus we give
> > # this file root ownership only temporarily
> > #
> > chown root:majordomo.daemon /etc/postfix/aliases.majordomo
> > chmod 644 /etc/postfix/aliases.majordomo
> > /usr/sbin/postalias /etc/postfix/aliases.majordomo
> > # the asterisk at the end of this command is vital!...
> > chown majordomo.daemon:majordomo.daemon /etc/postfix/aliases.majordomo*
> > chown -R majordomo.daemon:majordomo.daemon /usr/bin/majordomo-1.94.5/*
> > chmod -R 750 /usr/bin/majordomo-1.94.5/*
> > chmod 770 /usr/bin/majordomo-1.94.5/lists
> > chmod 660 /usr/bin/majordomo-1.94.5/lists/*
> >
> >
> >
> > 2. Adding lists
> >
> >
> > Additions to /etc/postfix/aliases.majordomo (we'll call the list to be added
> "sample"):
> >
> > sample: "|/usr/bin/majordomo-1.94.5/resend -l sample -C
> /usr/bin/majordomo-1.94.5/majordomo.domain1.cf sample-list"
> > sample-list: :include:/usr/bin/majordomo-1.94.5/lists/sample
> > ### you'll laugh at what a majornewb I am to majordomo, but in my
> > ### preliminary tests, I did't need this:
> > ### sample-request: "|/usr/bin/majordomo-1.94.5/request-answer -C
> /usr/bin/majordomo-1.94.5/majordomo.domain1.cf sample"
> >
> >
> > Then these need to be inserted into MySQL email database:
> >
> > insert into transport (domain, transport) values ('sample
domain1.com',
> 'local');
> >
> > ## NOTE that this next one has to match the actual
> > ## domain of the machine you're working on!!
> > ## (because there's no easy way to tell majordomo
> > ## to go through "sample-list
domain1.com"...)
> > ## Otherwise this will fail trying to find
> > ## "sample-list
your.real.host", but this is all
> > ## OK in the end because mail still goes out from
> > ## your virtual domain!
> > ##
> > insert into transport (domain, transport) values
> ('sample-list
your.real.host', 'local');
> >
> > insert into virtual (address, goto) values ('sample-approval',
> 'owner-sample');
> > insert into virtual (address, goto) values ('sample-owner', 'owner-sample');
> > insert into virtual (address, goto) values ('owner-sample',
> 'you
yourdomain.com');
> >
> >
> > Finally, you need to re-run postmap and make sure your permissions are all
> still OK:
> >
> > chmod 660 /usr/bin/majordomo-1.94.5/lists/*
> > chown root:majordomo.daemon /etc/postfix/aliases.majordomo
> > chmod 644 /etc/postfix/aliases.majordomo
> > /usr/sbin/postalias /etc/postfix/aliases.majordomo
> > chown majordomo.daemon:majordomo.daemon /etc/postfix/aliases.majordomo*
> > /usr/sbin/postfix reload
> >
> >
> > Notice that I am actually only running just one installation of majordomo
> for all my domains, and thus a "lists" command to domain1.com turns up lists
> for ALL of my virtual domains. I believe you can also subscribe to
> domain2.com's lists thru majordomo
domain1.com (and I can't have a list for
> both domain1 and domain2 that have the exact same name). But if you really
> care (I don't), this would be a relatively easy fix -- just create a separate
> majordomo installation for each domain and everywhere you used the -C option
> in /etc/postfix/aliases.majordomo you should set the path appropriately. No
> big deal right?
> >
> > Hope this helps someone out there...
> >
> > Cheers!
> >
> >
>
-
To unsubscribe, send mail to majordomo
postfix.org with content
(not subject): unsubscribe postfix-users
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]