Anybody get Majordomo working with Postfix?

14 posts / 0 new
Last post
#1 Sat, 04/25/2009 - 17:45
mrwilder

Anybody get Majordomo working with Postfix?

Has anyone gotten majordomo to work with postfix?

I noticed the mailman thing and that looked pretty cool - but I have written a half dozen or so apps specifically for majordomo that I'd like to continue using for my mailings.

I'd be willing to try to port my apps over to Mailman, but the main problem with that is it APPEARS that mailman stores it's list of email addresses in a nontext encoded file ... majordomo just slaps them in a plaintext at /usr/local/majordomo/lists/listname, which is real handy for doing automated work with the lists.

If anyone knows that mailman stores its email address lists in a text file somewhere, let me know where, or, alternatively, how bout this...

I have tried everything I could think of to get majordomo working with postfix, but every time I send an email to somelist@domain.com, I always get "User unknown in virtual alias table", even though I've added the list aliases to majordomo.aliases, and/or etc/aliases, and called newaliases AND postalias on both of those files.

I don't even know where I might look since the aliases DO appear to exist. My guess is this has something to do with the virtual domain or chrooted environment preventing these aliases from being used, most likely because I followed the wrong procedure to set them up... but I'm not sure.

Indeed, I get the same message for majordomo itself "User unknown in virtual alias table" as I do for the lists.

Well, you guys have been astounding so far... thanks!

Tony<br><br>Post edited by: mrwilder, at: 2009/04/25 17:53

Sat, 04/25/2009 - 17:59
andreychek

Hi Tony,

I have not used Majordomo, and hopefully someone who has can chime in.

But it *should* work :-)

Something isn't quite right if there's an try in the aliases file, but Postfix says the address doesn't exist.

That sounds like a fixable setup issue :-)

What I'd recommend is to try it again, and then post these details in here:

1. The failure message in the email log

2. The exact line that shows up in /etc/aliases

So far, it sounds like the trouble you're running into is occurring before Majordomo is in the picture, so perhaps once we resolve why it's not recognizing the address you've added, you'll be closer to having this work.
-Eric

Sat, 04/25/2009 - 18:42 (Reply to #2)
Joe
Joe's picture

Eric's right here...majordomo and Postfix can definitely play well together. There's no fundamental issue there. It just sounds like a missing step or two in the configuration.

--

Check out the forum guidelines!

Sat, 04/25/2009 - 18:47 (Reply to #3)
Joe
Joe's picture

Here's some docs on the subject:

http://www.csh.rit.edu/~jon/projects/majordomo/

http://www.postfix.org/faq.html#majordomo-approve

http://www.redhat.com/support/resources/howto/RH-postfix-HOWTO/c480.html

Except for needing a patch to the approve command, it looks like pretty normal &quot;running a mailing list&quot; stuff. Not too different from using Mailman or any of the other mailing list packages out there.

--

Check out the forum guidelines!

Sat, 04/25/2009 - 19:43 (Reply to #4)
mrwilder

I'm a little uncertain about the aliases files and commands ...

I've not messed with postfix, but if I understand correctly:

postfix will use some mapping to run newaliases on /etc/aliases (and I added a hash:/usr/local/majordomo/majordomo.aliases as well) when you call newaliases. IIRC, these are actually sendmail's files (?)

Also, the command postalias /path/filename should be run either instead of, or in addition to newaliases... I'm not sure which.

Finally, there's a file at /etc/postfix/virtual that probably needs some kind of entry for majordomo, but I can't figure out the syntax just yet.

In any case, in order to make a clean attempt at it I tried to remove all my entries for majordomo lists, but as I'm exhausted from messing with this box for two days straight, I accidentally called &quot;postalias /etc/postfix/virtual&quot; and thus totally hosed the entire virtusertable and now NOBODY's getting any email.

I hoped that removing all the majordomo entries and calling newaliases, postalias /etc/aliases then restarting postfix would restore the server, but instead, in the mail log I'm getting

Apr 25 21:31:21 ns1 postfix/smtpd[8138]: NOQUEUE: reject: RCPT from imo-d22.mx.aol.com[205.188.144.208]: 554 5.7.1 &lt;mrwilder@domain.com&gt;: Relay access denied; from=&lt;somebody@aol.com&gt; to=&lt;mrwilder@domain.com&gt; proto=ESMTP helo=&lt;imo-d22.mx.aol.com&gt;

in the aol client, I received the following transcript:
----- Transcript of session follows -----
... while talking to mail.domain.com.:
&gt;&gt;&gt; DATA
&lt;&lt;&lt; 554 5.7.1 &lt;mrwilder@domain.com&gt;: Relay access denied
554 5.0.0 Service unavailable
&lt;&lt;&lt; 554 5.5.1 Error: no valid recipients

So to me, that looks like I need to rebuild the user tables, but I don't know what I'm forgetting.

Well, anyway, cutting to the chase: what's the SHORTEST path to reset postfix to it's initial state?

Sorry, yeah, I'm stupid. Thanks again for all that good advice... the &quot;trash it all and install CentOS&quot; worked out real well... loving it so far! (hehe...too bad I hosed the default install)

Thanks again,
Tony

Sat, 04/25/2009 - 20:11 (Reply to #5)
Joe
Joe's picture

<div class='quote'>Also, the command postalias /path/filename should be run either instead of, or in addition to newaliases... I'm not sure which.</div>

The following two commands are identical:

postalias /etc/aliases
newaliases

newaliases is a convenience command for folks accustomed to the sendmail way of doing things.

If you use Webmin or Virtualmin to modify your aliases or other map files, you won't need to run postalias or postmap.

<div class='quote'>Finally, there's a file at /etc/postfix/virtual that probably needs some kind of entry for majordomo, but I can't figure out the syntax just yet.</div>

The virtual map file is for virtual hosted domain email accounts. So, mailing lists for any domain created by Virtualmin needs entries in /etc/postfix/virtual. The format is a simple pair of addresses...the first is the visible virtual address (joe@virtualmin.com) while the second is the local address to actually deliver to (joe). Actually not much different from the aliases file...though there is no colon.

Mailing lists are slightly different, as they are usually piped into a command. So, you have to deliver to a local alias, and then use pipes like you're accustomed to.

There's a bit more in the Postfix docs on the subject:

http://www.postfix.org/VIRTUAL_README.html#mailing_lists

The Virtualmin Mailman module sets all of this stuff up for you for Mailman...so it might be worth setting up a mailman list just so you can see what a working Postfix virtual + mailing list configuration looks like. It's been so long since I've setup a mailing list manually that I don't actually remember all of the details. Virtualmin has made me lazy. ;-)

<div class='quote'>I accidentally called &quot;postalias /etc/postfix/virtual&quot; and thus totally hosed the entire virtusertable and now NOBODY's getting any email.</div>

The correct command to rebuild the virtual map (and most other maps in Postfix) is:

postmap hash:/etc/postfix/virtual

--

Check out the forum guidelines!

Sun, 04/26/2009 - 12:55 (Reply to #6)
mrwilder

I have no real big affinity for majordomo, and I'd LOVE to just use the lazy ... uh, I mean the mailman program, but I need to be able to manipulate the email address lists in c or perl or php or SOMETHING. This is very easy to do with majordomo, but I was unable to easily open any of the files that appeared to be the list files created by mailman.

Can anyone tell me what the nature of the mailman email address list files is? I'm guessing it's some type of binary file encoded into some database format, but, for all I know the lists are being stuck somewhere easy and I missed it.

What I REALLY want somebody to tell me is &quot;Hey man, you missed it! Mailman stores all of it's mailing lists as a text file at /etc/mailman/lists&quot; or &quot;Mailman stores all of it's mailing lists in MySQL table called lists&quot; or something handy like that.

While I'm waiting for the good news I'll go back to screwing my computer up with majordomo.

Sun, 04/26/2009 - 13:19 (Reply to #7)
Joe
Joe's picture

The files are probably some sort of Python serialized output. Maybe a gdbm database or something along those lines. But you don't need to touch the files directly.

Mailman provides shell tools (and Python bindings) for interacting with its databases. On RHEL/CentOS systems you can find them in /usr/lib/mailman/bin.

For example, to get a list of mailing list users (assuming /usr/lib/mailman/bin has been added to the path for your script):

list_members ListName

You can also add_members, list_admins, get more specific information (like who gets digest and who gets regular delivery), etc.

More advanced stuff requires use of withlist, which is basically a Python function wrapper for the shell...and requires a bit of reading of the API to make use of it. Before Virtualmin had built-in support for Mailman and lists, I used these command line tools to auto-create mailing lists. I also used it on an old Plone site to allow management of mailing list subscriptions from within the CMS. Mailman isn't exactly pretty to use programmatically, but it can be done. And you don't have to hit the files directly (and in some cases, it wouldn't be safe to do so, since Mailman locks its database files during some operations, and ignoring those locks could be disastrous or at the least result in undefined behavior).

--

Check out the forum guidelines!

Sun, 04/26/2009 - 13:21 (Reply to #8)
Joe
Joe's picture

Oh, and there are some example &quot;withlist&quot; scripts in that same directory. I think all of the .py files are intended to run with withlist, and require the environment that it sets up. So, if you do need to interact at a deeper level, looking at the fix_url.py, reset_pw.py, and convert.py scripts would be as good a start as any. If you don't speak Python, it can be intimidating...I speak Python reasonably well, and I find the Mailman code pretty frightful.

--

Check out the forum guidelines!

Sun, 04/26/2009 - 14:42 (Reply to #9)
mrwilder

*blank stare*

So... I'll be trying to set majordomo up. I'll use mailman for some other stuff, though.

Right now majordomo doesn't seem to be a recognized user because I've got the entries messed up somehow or another.

First, majordomo is not recognized as a user AT ALL at
majordomo@outmail.domain.com, outmail.domain.com being a subdomain of domain.com

majordomo is recognized (but still not working) as a user at
ns1.domain.com, ns1.domain.com being the actual name of the server itself

in aliases:
majordomo: &quot;|/usr/local/majordomo/wrapper majordomo&quot;
owner-majordomo: mrwilder@domain.com
majordomo-owner: mrwilder@domain.com

In majordomo.aliases, as well, which is probably bad:
majordomo: &quot;|/usr/local/majordomo/wrapper majordomo&quot;
owner-majordomo: mrwilder@domain.com
majordomo-owner: mrwilder@domain.com

in /etc/postfix/virtual:
majordomo@outmail.domain.com &quot;| /usr/local/majordomo/wrapper majordomo&quot;
owner-majordomo@outmail.domain.com mrwilder@domain.com
majordomo-owner@outmail.domain.com mrwilder@domain.com

This is not working.

When I send an email to majordomo@outmail.domain.com - the intended email address of majordomo- I get a no such user message. However, when I send to majordomo@ns1.domain.com I get the following in the client mailer app:

&lt;&quot;| /usr/local/majordomo/wrapper majordomo&quot;@ns1.domain.com&gt; (expanded from
&lt;majordomo@ns1.domain.com&gt;): unknown user: &quot;|
/usr/local/majordomo/wrapper
majordomo&quot;

The maillog reports
Apr 26 15:38:11 ns1 postfix/local[9329]: 32C2F13C00B8: to=&lt;|
/usr/local/majordomo/wrapper majordomo@ns1.domain.com&gt;,
orig_to=&lt;majordomo@ns1.domain.com&gt;, relay=local, delay=0.06,
delays=0.05/0/0/0.01, dsn=5.1.1, status=bounced (unknown user: &quot;|
/usr/local/majordomo/wrapper majordomo&quot;)
Apr 26 15:38:11 ns1 postfix/cleanup[9328]: 40DAD13C00BC:
message-id=&lt;20090426223811.40DAD13C00BC@ns1.domain.com&gt;

I don't blame you if you don't want to help me with this. It's not part of virtualmin and I can barely read this junk myself. It'd be nice to be able to manipulate the mailservice like I've been doing for eleven years now though....

In any case, thanks again,
Tony

Sun, 04/26/2009 - 15:10 (Reply to #10)
andreychek

Hmm, is the path for your wrapper correct?

What does this command show:

ls -l /usr/local/majordomo/wrapper

Sun, 04/26/2009 - 18:18 (Reply to #11)
Joe
Joe's picture

So, you're trying to make virtual deliver to a pipe. As I mentioned above, I think you have to deliver to a local alias, which then pipes to the command.

So, in virtual:

majordomo@outmail.domain.com majordomo

And then aliases stays the same:

majordomo: &quot;|/usr/local/majordomo/wrapper majordomo&quot;

The entry you currently have in virtual is just invalid.

--

Check out the forum guidelines!

Sun, 04/26/2009 - 15:22 (Reply to #12)
mrwilder

Yeah

-rwxr-xr-x 1 majordomo daemon 7679 Apr 25 17:08 /usr/local/majordomo/wrapper

but I think I screwed up because if I had to guess I should change at least one of the

majordomo: &quot;|/usr/local/majordomo/wrapper majordomo&quot;

entries to

majordomo: &quot;|/usr/local/majordomo/wrapper&quot;

somehwere.

or maybe postfix isn't friendly to the wrapper itself?

Sun, 05/03/2009 - 15:12
mrwilder

Thank you, the problem was indeed the syntax in the virtual file.

Thanks again,
Tony

Topic locked