These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for email stuck in root account on the new forum.
Hi, All of the domain names I have on my server send their email to the root account when I am using the mail function from website scripts rather then sending them out to my mail server (another box on the same network) as they should for proper processing. How do I set the server to just pass these along as I have done (it should "just work" right?) for years with no problems on my WAMP server?
I'm curious why you changed your WAMP setup if it were working so well for so long :-)
However, it sounds like you're asking how to have Postfix use another server as your mail relay.
You can do that by logging into Virtualmin, and click Webmin -> Servers -> Postfix -> General Options. Then, put the hostname or IP address of your email relay server in the "Send outgoing mail via host" field. Then click "Save and Apply" at the bottom.
-Eric
Hi, Thanks for the response but that did not work. What i want to do is have the mail sent from a php script sent to the actual address it was intended to go to. Right now any domain hosted on the server will grab a mail sent from a server side php script to that domain and drop it into the root mail postfix inbox rather then sending to my mail server so it can get to the intended user.
In answer to your question, outside of apache crashing on average 7 times a day for the last year, all of my php scripts sending mail form the server worked great :)
Any ideas guys? I have tried the network ip, the machine name, the external ip, and the smb:// name and still nothing. The mail server is a windows box if that matters.
I can't believe this is the best you have to offer for support. You left my last question unanswered too even after other people said they had the same problem. I may be a small player but I do spend many thousands of dollars a year on software and hardware and would expect more from a company trying to sell their open source software.
You also made light of my comments about windows being reliable for email. I have been a sys admin for over 20 years now. I worked with basic on IBM's when they first hit the market and have run everything since then focusing on windows as that is where the market it at. I have started this experiment (running Linux) again, as I have every few years for at least the last ten, to see if things had progressed. I see the same attitudes and the same complaints from the Linux community that they have bitched about for years.
Here is the bottom line for those who have ears to hear, that's anyone working on Linux related software that wants to have a piece of the real market, you have an attitude that if someone does not spend the same amount of time mulling over countless misleading articles regarding the most mundane items as you have they are unworthy of your efforts of assistance. For example, the above problem posed to you took all of about 30 seconds to solve on a windows box. It has now been over two days on this forum and four days of my searching for an answer altogether. This is unacceptable in the real world. And for my effort I get an answer that clearly does not solve the problem. Even I know that Postfix needs more configuration than you specified to contact a SMTP server requiring authorization but you make no effort whatsoever to explain this.
Good luck guys, I wish you the best.
Howdy,
It wasn't my intention to make light of your problem, and I'm sorry that you're frustrated.
The whole reason Webmin even exists is to provide assistance to Linux sysadmins, making their lives easier. It's also the reason we provide free support here in the forums, and paid support using the Support tracker.
However, to have Postfix submit your email to a different email server for delivery -- it really should be as simple as specifying a mail relay hostname in that spot.
You don't need to setup authentication to simply have email forwarded for delivery on your mail server.
Now, to actually relay email through your mail server, some sort of authentication may be required, or the mail server needs to be configured to allow relaying from your Linux server based on it's IP address -- but that's not the problem here.
If the email is still being delivered locally on your Linux server, something isn't working right, and you may want to make sure the configuration took by running a "postconf -n" on the command line, where you can verify that there's a relay_host specified.
We try to answer questions as best we can, but please remember that the forums are an unofficial support channel. It's not always possible to get to every question, nor do we always know the answer to every question. Even with that in mind, we still do our best to provide a response to the majority of inquiries that pass through here.
It matters to me that folks get things working, regardless of the size of their organization. We provide assistance to folks in the forums whether they're GPL users, Pro users, and sometimes not even Virtualmin users at all.
I was in fact planning on working with you today on this, and had your post in my inbox with the intent on digging into the issue this afternoon :-)
-Eric
Thank you for taking the issue back up. Here is what I get for the config:
main.cf
non-default parameters alias_maps hash:/etc/aliases broken_sasl_auth_clients yes home_mailbox Maildir/ mailbox_command /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME mailq_path /usr/bin/mailq.postfix manpage_directory /usr/share/man mydestination $myhostname, localhost.$mydomain, localhost, localhost.localdomain, xxx.com newaliases_path /usr/bin/newaliases.postfix readme_directory /usr/share/doc/postfix-2.3.3/README_FILES relayhost 192.168.1.75 sample_directory /usr/share/doc/postfix-2.3.3/samples sender_bcc_maps hash:/etc/postfix/bcc sendmail_path /usr/sbin/sendmail.postfix smtpd_recipient_restrictions permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_auth_enable yes virtual_alias_maps hash:/etc/postfix/virtual
But when the mail is sent from a script here is what the transaction looks like in the log file:
May 14 10:48:14 xxx postfix/local[19732]: C53211470001: to=root@xxx.com, orig_to=webmaster@xxx.com, relay=local, delay=792, delays=792/0.08/0/0.09, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) May 14 10:48:14 xxx postfix/qmgr[19728]: C53211470001: removed May 14 10:48:14 xxx postfix/local[19733]: D36501470002: to=root@xxx.com, orig_to=webmaster@xxx.com, relay=local, delay=607, delays=607/0.09/0/0.08, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) May 14 10:48:14 xxx postfix/qmgr[19728]: D36501470002: removed May 14 10:48:14 xxx postfix/local[19732]: D54F81470003: to=root@xxx.com, orig_to=webmaster@xxx.com, relay=local, delay=77, delays=77/0.16/0/0.01, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) May 14 10:48:14 xxx postfix/qmgr[19728]: D54F81470003: removed
Thank you for taking the issue back up. Here is what I get for the config:
It's no problem, though to clarify, I never stopped -- I fully intended on continuing to help you get this sorted out :-)
I also know this stuff can be frustrating when it doesn't work as expected -- and in cases like that, the time waiting for someone to reply can seem like an eternity!
As far as your issue goes -- I'm surprised to see it attempting to deliver locally, the addition of the relay_host in your Postfix config I thought would resolve that.
However, I suspect the issue is the existence of the "xxx.com" in the "mydestination" line of your /etc/postfix/main.cf file.
My suggestion is to edit /etc/postfix/main.cf, and look for this line:
mydestination $myhostname, localhost.$mydomain, localhost, localhost.localdomain, xxx.com
Then, remove the "xxx.com" from the end of that line (as well as the "," right before that).
Save the file, and then restart Postfix:
/etc/init.d/postfix restart
Does that help?
-Eric
I added the xxx to the data I pasted to obfuscate the domain name. It is one of the local domains on the web server and the one I have been testing with. When that domain is not listed on that line then postfix says the mail has looped back on itself and failed to deliver even locally. Even with it listed it still only delivers locally. I have checked the logs at the mail server as well and do not see an attempt to connect by the postfix server. The transaction seems to stop cold at postfix locally.
I added the xxx to the data I pasted to obfuscate the domain name.
Sure, I understand... that also appears to be what's making Postfix think it needs to deliver locally though.
Two other questions then --
What is the output of the command "hostname" -- is it that same "xxx.com", or is it something else?
Does "xxx.com" appear anywhere in your /etc/postfix/virtual file?
-Eric
Hostname is a different .com but it is also hosted on the server. I took the xxx.com domain off of that line and tried to send another mail and it reported: mail for 192.168.1.75 loops back to myself. Looking at the logs I found this: warning: host 192.168.1.75[192.168.1.75]:25 greeted me with my own hostname. I checked this out and found that while the mail box itself had a different hostname the software running it had the same primary hostname as the Linux box. I changed the hostname the software on the mail server was using and the mail went through.
I appreciate your help with this and would like to apologize for my above comments as they relate to you or this forum. The abandonment of my last post (regarding the apache modules screen) and the general attitude of the Linux community lent to this feeling although I am sure it does not apply here. I remember how adamant I was concerning PC Tools 7 and DOS and how I argued with early windows users about the inability to fully control the OS so I do understand where the average Linux user is coming from. I also remember buying an atram card and buying each 256K memory module on a weekly basis (could only afford one a week) and then the sheer joy of configuring my own conventional, extended, and expanded memory. I really get it. In the interest of furthering the community though, the above issues I stressed will have to be overcome if it is to ever find its way out of the dusty server room and onto the average desktop in the foreseeable future.
Again thank you, and I wish you the best.
Ok new problem encountered. While most of the mail is going out, the mail addressed to the domain that is also the hostname of the Linux server is not forwarding.
Ok that seems to have been resolved by eliminating the $myhostname, localhost.$mydomain, localhost, localhost.localdomain line. Will this cause any problems?
The abandonment of my last post (regarding the apache modules screen) and the general attitude of the Linux community lent to this feeling although I am sure it does not apply here
Well, darn, there's actually a pretty good explanation for this problem... there were two posts on that particular subject. I actually did a lot of digging into the issue, figured out the problem, and apparently only responded to the one thread, and not to yours :-)
My apologies, but the problem there is that there is no such module screen on CentOS servers, due to the way CentOS is setup, as CentOS handles that in a more complex manner. That Apache modules screen only exists on Ubuntu and Debian systems. For CentOS users, you'd unfortunately need to edit the Apache config file (/etc/httpd/conf/httpd.conf), and manually add/modify/remove the LoadModules lines.
Ok that seems to have been resolved by eliminating the $myhostname, localhost.$mydomain, localhost, localhost.localdomain line. Will this cause any problems?
Great! That should only cause issues if you're looking to collect mail locally... which doesn't seem to be the case here. So you should be in good shape.
I appreciate your help with this and would like to apologize for my above comments as they relate to you or this forum
No worries... and I'm glad that we were able to resolve your issue (you did the hard part ;-), and hopefully the explanation of your Apache problem makes sense, even if it doesn't actually solve the problem. Unfortunately, that one isn't likely to be fixed anytime soon, as it's unfortunately a complex problem due to the Apache config setup on CentOS.
Have a good one!
-Eric
Thank you for the additional comments. The outcome makes sense and is no problem as I have been hand configuring apache systems for many years now. Thank you for the software and for the support, it is greatly appreciated :)