LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Postfix Problem (https://www.linuxquestions.org/questions/linux-networking-3/postfix-problem-12121/)

JimKyle 01-19-2002 11:31 AM

Postfix Problem
 
For some reason, postfix suddenly decided to send all messages addressed to "root" to "nobody" instead of to "jim" (the configuration I defined in the aliases file). This apparently happened after I attempted to correct the configuration files; I've not yet been able to get postfix to relay anything on to the outside world, despite following the instructions posted at http://michaelo.free.fr/linux/mdk8.1/postfix.php3 on achieving this goal.

Can anyone assist me in getting it to work? I don't need to use it for incoming mail since my routing handles that nicely. I just want logcheck and the other security tools to be able to send their reports to me and to send duplicate copies out through my ISP for safety...

lfslinux 01-19-2002 12:13 PM

Re: Postfix Problem
 
Quote:

Originally posted by JimKyle
For some reason, postfix suddenly decided to send all messages addressed to "root" to "nobody" instead of to "jim" (the configuration I defined in the aliases file). This apparently happened after I attempted to correct the configuration files; I've not yet been able to get postfix to relay anything on to the outside world, despite following the instructions posted at http://michaelo.free.fr/linux/mdk8.1/postfix.php3 on achieving this goal.

Can anyone assist me in getting it to work? I don't need to use it for incoming mail since my routing handles that nicely. I just want logcheck and the other security tools to be able to send their reports to me and to send duplicate copies out through my ISP for safety...

Please show the output of this:

postconf alias_database
postconf alias_maps

Usually it'll tell you it uses the same file for both. Check that file's contents and make sure the alias for root properly (mostly you'll be looking at /etc/postfix/aliases), like so:

#start of root alias definition
root: jim
#end of root alias definition

Run "postalias /etc/postfix/aliases" to recreate the alias database (/etc/postfix/aliases.db) and run 'postfix reload' to reload postfix immediately (if not you'll have to wait up to a few minutes for the new aliases to become active).

See if this does anything for you.

JimKyle 01-19-2002 01:58 PM

Thanks much!

Here's my captures:

capture of the two commands ->

[root@JKP200 jim]# postconf alias_database
alias_database = hash:/etc/postfix/aliases
[root@JKP200 jim]# postconf alias_maps
alias_maps = hash:/etc/postfix/aliases

clipped from aliases file ->

# Person who should get root's mail
root: jim

That entry was already in the file, but I hadn't run the remaining commands since it appeared that my cron.daily operation would do that for me automatically. However as soon as I finished it up, and posted a test message, it appeared in my own mailbox, so that part now seems to be working.

It doesn't seem to be sending anything externally yet, though. Hard to tell, since SW Bell's DNS is acting up this morning and only responding about one time out of five... I'd really like to copy it out to an external address for safety, if I can make that work.

lfslinux 01-19-2002 02:53 PM

Quote:

Originally posted by JimKyle
It doesn't seem to be sending anything externally yet, though. Hard to tell, since SW Bell's DNS is acting up this morning and only responding about one time out of five... I'd really like to copy it out to an external address for safety, if I can make that work.
The best way of doing it when you're with an ISP is to use your ISP's smtp server. Tell postfix to forward every single message that cannot be delivered locally to your ISP and your ISP will take care of the rest. Some ISP's don't even allow you to act as your own server. I'm with Bell Canada and they have blocked port 25 for outgoing traffic. You have to connect to port 25 of bell's smtp server (that's the only way it'll work). Well, there are always work arounds. It helps if you have a server located somewhere (i've configured linuxfromscratch.org to also listen on port 26 besides 25, so I use that server as my mail relay instead of my ISP. I only use my ISP for the internet connection I don't want to rely on them for anything else. An nimda is ought to strike again and that'll down their servers and my mail would be stuck)

Anyways, the setting to have postfix forward all mail to your isp is by using the relayhost variable in the main.cf file like:

relayhost=smtp.yourisp.com

JimKyle 01-19-2002 03:29 PM

Adding the "relayhost" line to main.cf was the action that triggered the original problem! The DNS did seem to stabilize somewhat and I was able to test; it does work now to send mail outside. My final question for this subject is "Can I set up two addresses in the root alias, one inside and the other outside? If so, how?"

Again many thanks for getting me on the right track. I knew it had to be some small thing I was overlooking!

lfslinux 01-19-2002 03:32 PM

Quote:

Originally posted by JimKyle
Adding the "relayhost" line to main.cf was the action that triggered the original problem! The DNS did seem to stabilize somewhat and I was able to test; it does work now to send mail outside. My final question for this subject is "Can I set up two addresses in the root alias, one inside and the other outside? If so, how?"

Again many thanks for getting me on the right track. I knew it had to be some small thing I was overlooking!

Ah ya with unstable DNS relayhosts won't work (it can't resolve into IP address). You could get around that, figure out the IP address of your ISP's smtp server and use that as the relayhost. Then at least the mail will get out of your box but will probably get stuck on your ISP for a while until DNS works again (unless their smtp servers run off a seperate DNS server which would be wise).

Yes, you can have multiple destinations for an alias. seperate it with comma's, like so:

root: tim,gerard@linuxfromscratch.org


All times are GMT -5. The time now is 04:50 AM.