LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-18-2005, 03:24 PM   #1
azrael808
Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Fedora and CentOS
Posts: 43

Rep: Reputation: 15
Angry Postfix forcing mail to be delivered to root


Hi everyone,

This may be a simple question to answer, but I haven't got a clue why my mail server is doing this:

I have configured a box running CentOS 4.1 with postfix, amavis, clamav and spamassassin as a mail server for a couple of domains that I manage. Took me a while of reading through example configurations and documentation, but I finally thought I'd cracked the virtual addressing (i.e. receiving mail for multiple domains and delivering them to local mailboxes), when things went a bit weird.

I wrote a file /etc/postfix/virtual containing the following:

webmaster@domain1 webmaster
webmaster@domain2 webmaster
webmaster@domain3 webmaster
webdesign@domain4 bob
webdesign@domain2 bob
webdesign@domain3 bob
info@domain1 nichols
@domain2 webmaster
@domain4 webmaster
@domain3 webmaster

Then used the postmap command to create /etc/postfix/virtual.db and restarted postfix.

When I started sending mail to any of the addresses above, it would appear to send successfully (i.e. I didn't get a "Mail Undeliverable" error email in return). However, as webmaster, for example, I did not have any new mails to read. After a bit of an investigation, I found that ALL the mail was being delivered to root. Note that mail would only be delivered to root if the virtual address existed above, if the address was not present in the above list, the sender receives a "Mail Undeliverable" email almost instantly.

I had a look in /var/log/maillog and for each mail received, there is an entry like:

Jul 18 21:15:02 www postfix/local[4655]: A1BDF1A58A9: to=<root@bexleyitservices.co.uk>, orig_to=<webmaster@bexleyitservices.co.uk>, relay=local, delay=0, status=sent (delivered to mailbox)

Even if I send mail to thisisstupid@bexleyitservices.co.uk, the maillog will have messages like the one above informing me that it has forwarded the mail onto webmaster, then root.

Could anybody explain what's going on? Or better yet, tell me where in the masses of postfix configuration, there could be something redirecting all my incoming mail to root?


Many thanks in advance.

Pete

Last edited by azrael808; 07-20-2005 at 03:44 PM.
 
Old 07-18-2005, 04:26 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
Could anybody explain what's going on? Or better yet, tell me where in the masses of postfix configuration, there could be something redirecting all my incoming mail to root
Try /etc/aliases or /etc/postfix/aliases.
 
Old 07-18-2005, 05:09 PM   #3
azrael808
Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Fedora and CentOS
Posts: 43

Original Poster
Rep: Reputation: 15
Superb!

Exactly the thing I was looking for - all those alias, were already defined in there pointing to root!

Thanks a lot mate, saved me a lot of bother + I learnt sommink new

Pete
 
Old 07-20-2005, 03:10 PM   #4
azrael808
Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Fedora and CentOS
Posts: 43

Original Poster
Rep: Reputation: 15
Lame!!!

Made the changes, but it's still only forwarding mail to root? Any ideas? Thats the /etc/postfix/virtual.db I've created, plus the /etc/aliases.db

Anywhere else I should be looking?

Thanks again,

Pete
 
Old 07-20-2005, 03:17 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Did you remember to run newaliases after editing your aliases file?
 
Old 07-20-2005, 03:42 PM   #6
azrael808
Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Fedora and CentOS
Posts: 43

Original Poster
Rep: Reputation: 15
Wow, that was a fast reply dude! lol

I hadn't actually run newaliases, but after I found out I needed to and actually running it, the problem was still there!

But now I think the problems solved - I just removed the catchall cases in the virtual.db. Seems to have sorted the problem.

Cheers for the help Berhanie, seems to be running like a charm now.

Now all I need to figure out is how to alter the selinux policy so I can use amavis without having to disable selinux...

Pete

Last edited by azrael808; 07-20-2005 at 03:49 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail not being delivered liquidcool Linux - Software 4 10-17-2004 03:44 PM
postfix not delivering mail to root pbaumgar Linux - Software 1 06-25-2004 12:44 AM
qmail log says mail delivered, mail nowhere to be found svartrev Linux - Software 0 03-24-2004 05:12 PM
no mail delivered to postfix box jules_fraser Linux - Networking 22 12-13-2003 02:42 PM
mail is not delivered thru the mail command aadilkhan Linux - General 1 11-18-2003 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration