MTA Problems

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

MTA Problems

Postby Arthur_Dent » Sun Apr 06, 2014 4:44 pm

Hello All,

Due to a variety of reasons (mainly laziness) I have not updated my Fedora 17 server in a long while. This weekend I finally bit the bullet and did it - going from F17 -> F20.

This box is (amongst other things) a mail server. That's a bit too grand a description really because all it does is collect IMAP mail from a variety of different places, scan it, sort it and put it where I and my family can get it. (Note it's incoming mail only we're talking about here - I just use my MUA and the SMTP servers of my ISP to send outgoing mail).

For years I have been doing this with a fetchmail->procmail->(spamassassin/clamdscan)->Dovecot combination.

Now - upgrading to Fedora 20 I find that there is no MTA installed by default. I have never needed to bother with how mail got from fetchmail to procmail to dovecot - it just sort of happened.

So -deep breath - I installed postfix. No idea how to configure it. All the myriad guides and tutorials seem to be way more than I need. I just want messages moved around internally (I do NOT want anything leaving my network and risk spamming).

The problem is that now the mail is collected by fetchmail, but it never seems to hit procmail. It just vanishes. Nothing obvious in the logs.

Where do I start troubleshooting?

Any help gratefully accepted! (VERY gratefully!)

Thanks

Mark
Arthur_Dent
LXF regular
 
Posts: 219
Joined: Mon Jan 02, 2006 11:05 am
Location: London

Postby Arthur_Dent » Mon Apr 07, 2014 3:22 pm

Well I'm still no nearer solving this. Let me add a little more detail...

I don't particularly want postfix - but it seems that fetchmail won't work without it (I've tried stopping postfix and without it fetchmail complains when it tries to collect the mail).

I've tried adding the line
Code: Select all
mda "formail -s procmail"
to my .fetchmailrc in the hope that as soon as it's got the mail it would poke it into procmail. No joy.

The ONE thing I REALLY REALLY DON'T WANT is for postfix to bounce mail back out to the interweb - and that's exactly whats happening!

I've tried putting this in my /etc/postfix/main.cf:
Code: Select all
mailbox_command = /usr/bin/procmail -a $DOMAIN
...
mailbox_transport = procmail
and this in /etc/postfix/master.cf:
Code: Select all
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
procmail  unix  -       n       n       -       4       pipe
        flags=DRhu user=mail argv=/bin/procmail -a mark


I am at a loss now. All I want is to collect mail and feed it into procmail where my filters should still work from the previous install. I certainly don't want to spew bounce messages out.

Gratefully for any suggestions at this point...

Thanks

Mark
Arthur_Dent
LXF regular
 
Posts: 219
Joined: Mon Jan 02, 2006 11:05 am
Location: London

Postby Dutch_Master » Mon Apr 07, 2014 4:57 pm

Try configuring postfix afresh via Webmin, it'll take care of any syntax errors ;) You still need to know what you're doing though :(
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby Arthur_Dent » Mon Apr 07, 2014 8:44 pm

Dutch_Master wrote:You still need to know what you're doing though :(
Yeah - That's always going to be a problem!

Well I've made some progress.

After a lot of googling and tinkering I now have something that seems to be delivering mail via the procmail recipe. I still have many problems however.

The biggest problem is that, watching the logs, there seemed to be some dovecot index.cache corruption problems (It may have been down to selinux blocking some access - so I created some selinux modules to allow, and I don't get those messages any more ... BUT ... Although the mail is now being delivered to the correct mbox file I can't see it when I access mail either with Evolution or with mutt. It's like the mail does not exist. When I "cat /var/spool/mail/mark" however I can clearly see what looks like the email appended in the file. What gives? Is it corrupting the file somehow? If so where?

Sigh... One step forward two steps back...
Arthur_Dent
LXF regular
 
Posts: 219
Joined: Mon Jan 02, 2006 11:05 am
Location: London

Postby Dutch_Master » Mon Apr 07, 2014 9:22 pm

You may need to check permissions on the mail itself, if it's not owned by the user of the mailbox it may not show up. Nothing a simple chmod command can't fix ;)
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby Arthur_Dent » Tue Apr 08, 2014 6:56 am

Well that's a good point, but these are (or should be!) mbox files (not maildir)- so procmail should simply be appending to them. And indeed - I can open the file with cat or less and see that what looks like an email has been appended. Whether or not it is formatted correctly I have no idea.

I did have some messages showing earlier in my testing:
Code: Select all
Apr  7 20:13:02 Zaphod dovecot: imap(mark): Error: Cached message size smaller than expected (49154 < 49165)
Apr  7 20:13:02 Zaphod dovecot: imap(mark): Error: Corrupted index cache file /home/mark/mail/.imap/INBOX/dovecot.index.cache: Broken physical size for mail UID 9025
but these seem to have gone away (now that I have fixed selinux). Since then mail has (supposedly) been delivered to mbox files previously untouched by these problems and yet it's as if the mail does not exist.

I am confused and fed-up.
Arthur_Dent
LXF regular
 
Posts: 219
Joined: Mon Jan 02, 2006 11:05 am
Location: London


Return to Help!

Who is online

Users browsing this forum: No registered users and 3 guests