LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix forcing mail to be delivered to root (https://www.linuxquestions.org/questions/linux-software-2/postfix-forcing-mail-to-be-delivered-to-root-344382/)

azrael808 07-18-2005 03:24 PM

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

Berhanie 07-18-2005 04:26 PM

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.

azrael808 07-18-2005 05:09 PM

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

azrael808 07-20-2005 03:10 PM

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

Berhanie 07-20-2005 03:17 PM

Did you remember to run newaliases after editing your aliases file?

azrael808 07-20-2005 03:42 PM

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... :study:

Pete


All times are GMT -5. The time now is 12:05 PM.