Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MTA Problems

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
Arthur_Dent
LXF regular


Joined: Mon Jan 02, 2006 11:05 am
Posts: 219
Location: London

PostPosted: Sun Apr 06, 2014 5:44 pm    Post subject: MTA Problems Reply with quote

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
Back to top
View user's profile Send private message
Arthur_Dent
LXF regular


Joined: Mon Jan 02, 2006 11:05 am
Posts: 219
Location: London

PostPosted: Mon Apr 07, 2014 4:22 pm    Post subject: Reply with quote

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:
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:
mailbox_command = /usr/bin/procmail -a $DOMAIN
...
mailbox_transport = procmail
and this in /etc/postfix/master.cf:
Code:
# ==========================================================================
# 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
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2430

PostPosted: Mon Apr 07, 2014 5:57 pm    Post subject: Reply with quote

Try configuring postfix afresh via Webmin, it'll take care of any syntax errors Wink You still need to know what you're doing though Sad
Back to top
View user's profile Send private message
Arthur_Dent
LXF regular


Joined: Mon Jan 02, 2006 11:05 am
Posts: 219
Location: London

PostPosted: Mon Apr 07, 2014 9:44 pm    Post subject: Reply with quote

Dutch_Master wrote:
You still need to know what you're doing though Sad
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...
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2430

PostPosted: Mon Apr 07, 2014 10:22 pm    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message
Arthur_Dent
LXF regular


Joined: Mon Jan 02, 2006 11:05 am
Posts: 219
Location: London

PostPosted: Tue Apr 08, 2014 7:56 am    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast