Thursday, June 14, 2007

Troubleshooting mailman - receiving posts, but not sending messages


After some struggle, I've just solved quite strange problem with mailman. I will share my new knowledge with you.

So the symptoms are:
  1. You or other people are sending emails to the group
  2. They get through your SMTP server (Exim here, with a line in log similar to:
    => list <list@domain.com> R=mailman_router T=mailman_transport

  3. It goes directly to mailman script via pipe - you can verify that (i.e. exim -d -v list@domain.com)
  4. Mailman doesn't send a bit, and nothing appears in it's logs from the moment it receives new message. It doesn't start sending it out, and nothing new is written in smtp.log, post.log, nor vette.log.

We have the following environment:
  1. Fedora 7 system
  2. Exim 4.62 as the mail exchanger (installed from RPM) - probably doesn't matter at all
  3. Mailman 2.1.9 (from RPM)
  4. On Exim, we use mailman_transport, working on pipe driver, executing mailman command /var/mailman/mail/mailman
  5. Local dns server, everything above on this very machine

Resolution:
It turned out to be a problem with localhost dns name resolving. When I tried to use ping localhost it started to ping wrong address. The problem was in /etc/hosts - you have to make sure, that localhost is pointed to 127.0.0.1. It might be a problem in Mailman itself, because no problem was logged. Still - it is quite important to set up proper localhost (loopback) binding.
After fixing hosts, I could ping myself with ping localhost, and mailman magically started to work.


Other steps worth trying when mailman is dead:
  • Check if your exim routing is set properly: exim -bt list@domain.com - this should result in printing something with "mailman" in it, for example:
    list@domain.com
    router = mailman_router, transport = mailman_transport
  • use the delivery debug in exim: exim -d -v list@domain.com This will tell you if the message actually arrives at mailman router and then mailman transport. After running the command, it will stop near Recipients: - there you have to press CTRL+D.
    You should look for something similar to:
    mailman_transport transport entered
    direct command:
    argv[0] = /var/mailman/mail/mailman
    argv[1] = ${if def:local_part_suffix {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} {post}}
    argv[2] = $local_part
    direct command after expansion:
    argv[0] = /var/mailman/mail/mailman
    argv[1] = post
    argv[2] = list

    ....

    mailman_transport transport yielded 0
    This means the command executed successfully, and mailman actually gets the message.

Useful pages:

If you still have problems, write me and I'll gladly help.

1 comment:

  1. Anonymous11:38 AM

    Thanks about the 'localhost' issue. Same happened here. I killed two to three hours of work and it was resolved with just a few changes to /etc/hosts. Damn that's a big mailman bug ...

    ReplyDelete