Sendmail & Postfix problem!

43 posts / 0 new
Last post
#1 Mon, 11/17/2008 - 09:37

Sendmail & Postfix problem!

Hello dear people,

Please believe, I am Googling the internet about one week and I did not find any possible solutions for my issue with SendMail & Postfix. I am pretty new on Unix, Linux, Webmin & Virtualmin. Operating system of my VPS is CentOS 5. Webmin and Virtualmin (Free Version) is installed. As I require a mail server, I decided to add SendMail. I could configure SendMail enough but there was a problem, I can mention it as below that I can send e-mail messages to anywhere through 'User Mailboxes' but not Outlook Express. Authentication works correctly. The problem is that SendMail tries to relay target email domain and not my server. It is what I have found out. Anyway, I could not find any possible way to resolve it. I decided to switch to Postfix. But post on Postfix thing's gone wore. I was unable to receive emails and no emails were sent. For incoming I get "rejected error" and for outgoing I get "relay access denied". When I try SSH and telnet localhost 25, I get "relay access denied" error.

I am really confused. Please let me know what should I do.

Please help me.


Mon, 11/17/2008 - 09:57

Whenever you try to send or receive a message, what error(s) show up in the error log (/var/log/maillog)?

Mon, 11/17/2008 - 11:28 (Reply to #2)

Dear Andreychek,

Thank you for your reply.

Unfortunately I am out and cannot get access to server to paste the maillog. But I can explain the issue some more.

About SendMail:

1) Authentication OK.
2) Receiving e-mail from anywhere OK.
3) Sending e-mails via User Mailboxes or PHP mail function OK. (sends e-mail to anywhere)
4) Sending e-mail via Local PC and Outlook express FAIL. (sends e-mails only to hosts accept Relay)

I think when I try to send an email via Local PC and Outlook Express for example from to, the SendMail tries to set instead of relay=localhost. For some servers like Gmail it is possible but for many other not. It is just my idea, I am a NEWBIE.

About Postfix:

1) Authentication OK. (happened after arranging permissions)
2) Receiving e-mail from anywhere FAIL. No way to receive. (even localdomain user cannot send e-mail to other localdomain user)
3) Sending e-mails FAIL. No way to send.

Currently I am working on Postfix and SendMail is stopped. I will post the mail logs as soon as possible.


Tue, 11/18/2008 - 03:58 (Reply to #3)

Please help!

I have switched to SendMail, because there was a large log file I decided to clear the maillog (/var/log/maillog). Webmin (View Logfile) acts interesting. When there is no maillog file or maillog file is empty View Logfile displays previous records but when I enter a line inside ,aillog file it shows new records. My problem is that SendMail does not update the log file. I have tried to restart syslog service but no thing changed. Please help me!!!!


Tue, 11/18/2008 - 05:28 (Reply to #4)
ronald's picture

i think you are better off using postfix, it is the default in virtualmin.
you'll have to switch mailserver through the commandline, but i do not remember the command.
It is here in the forum somewhere though.

Also if you do not find a satisfying solution in this forum I advice to submit a support ticket in the bug tracker.

Tue, 11/18/2008 - 05:47 (Reply to #5)

Yeah, as Ronald said, while Virtualmin does support Sendmail -- Postfix may be a bit easier to get running, and more people around these parts are familiar Postfix and can help with any odd issues that arise :-)

I'm not sure why Sendmail wouldn't be logging things -- I guess I'd verify that there isn't a different log in /var/log somewhere that contains it's logs (though I'm not sure why that might have changed).

Also, perhaps /var/log/messages contains information on what the problem is. Try restarting Sendmail, and see if anything odd shows up in that messages log.

Tue, 11/18/2008 - 06:48 (Reply to #6)

Thank you for replies

I have switched to Postfix again, I have changed the mail server from SendMail to Postfix via command line. I used below command:

[code:1]alternatives --config mta[/code:1]

Currently the sending problem FIXED. I can send e-mail through web and outlook express. Authentication works as well to not allow Open Relay. But still maillog does not update regularly and also all incoming messages rejected.

Please help me.

This is error:

<div class='quote'>Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 5.7.1 &lt;[]&gt;: Client host rejected: Access denied (state 14).</div>

Please advise me.


Tue, 11/18/2008 - 07:05 (Reply to #7)

Yeah, email programs should definitely be making log entries in the log files :-)

When you restart Postfix (/etc/init.d/postfix restart), do you see any errors listed in /var/log/messages?

Tue, 11/18/2008 - 07:43 (Reply to #8)

Actually I do not see anything related to Postfix. But this log file updates regularly. I can see my failure login attempts while checking authentication (saslauthd server). Also what is your idea about No Receiving emails? Also there is some notable in User Email, a strange e-mail, it is as below (Subject : DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA):
<b>Message Comment :</b>

<div class='quote'>This text is part of the internal format of your mail folder, and is not a real message. It is created automatically by the mail system software. If deleted, important folder data will be lost, and it will be re-created with the data reset to initial values.</div>

How do you think about a Reboot? May it be helpful?


Tue, 11/18/2008 - 07:53 (Reply to #9)

Well, one issue may rely on the other, unfortunately.

I'd really need to see the email logs in order to determine why you aren't able to receive messages.

I wouldn't be concerned about the email containing the &quot;DON'T DELETE THIS MESSAGE&quot; email -- while I haven't seen those since the day I used pine as an email client, that are harmless and not likely a symptom of the issue here.

So, to be clear, nothing is logging to /var/log/maillog? And, nothing of interest is in /var/log/messages relating to Postfix.

Do you happen to see any other logs in the /var/log directory with Postfix related information in them?

Do you have enough disk space? You can verify that with &quot;df -h&quot;.

Those are just some thoughts, let me know if that doesn't help.

Tue, 11/18/2008 - 08:02 (Reply to #10)

There is enough disk space,

<div class='quote'>/dev/simfs 6.0G 1014M 5.1G 17% /</div>

Actually there is no log related to postfix, I also checked inside of other log files and no thing found. I think I got to reboot the server, maybe it helps some. How do you think?


Tue, 11/18/2008 - 08:12 (Reply to #11)

Ok, so you should have plenty of space.

You could always try rebooting if you want, though I'm never a big fan of that as a solution. It skips the step of learning what is wrong, and invites the problem to occur again :-)

I'm interested in logging into your system to take a look at the problem myself, if you don't mind.

What version of Virtualmin are you using, and is it Pro or GPL?

Tue, 11/18/2008 - 08:16 (Reply to #12)

I am using Virtualmin GPL.

Tue, 11/18/2008 - 08:19 (Reply to #13)

Alright, if you're interesting in having me take a look, you can email login details for root SSH access to

I'm just not sure what would cause the symptoms you're seeing, so I'd need to poke around myself to get a better idea.

Tue, 11/18/2008 - 08:23 (Reply to #14)

It is okay, but do you need Supervisor root access?

Tue, 11/18/2008 - 08:26 (Reply to #15)

Yes, to be able to troubleshoot the problem, I'd need either root access, or access to a user level account that has full sudo privileges.

Tue, 11/18/2008 - 08:34 (Reply to #16)

I have sent required information, the e-mail subject is &quot;here is the data&quot;.

Please check it.

Tue, 11/18/2008 - 08:36 (Reply to #17)

Sorry, mistyped, the subject is &quot;here is the info.&quot;.

Tue, 11/18/2008 - 08:42 (Reply to #18)

Dear andreychek,

please confirm back to me that you have received the e-mail. Thank you

Tue, 11/18/2008 - 09:37 (Reply to #19)

Altera and I went over some things via email.

The problem with syslog is that the conf file was setup to send mail.none to maillog, rather than mail.*. I corrected that.

Unfortunately, there appear to be a few problems with the Postfix setup.

Switching back and forth between Sendmail and Postfix may have caused some problems -- first, Virtualmin will use whatever mail program you tell it to, but it doesn't transfer email users back and forth. So none of your email users are setup in Postfix.

Amongst other things :-)

If this isn't yet a live system, my recommendation is to uninstall Virtualmin (by running the script with the -u option), then go through the Virtualmin installation again, allow it to configure Postfix, and then not change that :-)

At that point, when you setup your Virtual Servers and email users, it should in theory work fine.

Tue, 11/18/2008 - 09:44 (Reply to #20)

Thank you Eric,

Actually it is not a live system right now, but do I have to back up of Postfix Configuration? I have already installed Virtualmin through webmin, where can I find


Tue, 11/18/2008 - 09:55 (Reply to #21)


That explain a lot, actually.

The best way to install Virtualmin is using Joe's really nifty script -- which handles setting up a lot of stuff on the server that won't otherwise be setup correctly.

You'll also see the theme designed specifically for Virtualmin, and a lot of things may make more sense once, as you'll begin to see all the Virtualmin options not available to you using the Webmin theme.

You can get the script here:

When you run that, it'll set up all those goodies for you.

You don't *have* to back up your Postfix configuration, only if you have something now that you want to be able to get at later :-)

Tue, 11/18/2008 - 09:50 (Reply to #22)
Joe's picture

So, the uninstall option only pulls out Virtualmin specific won't clean up a botched Postfix configuration or start it from scratch. To do that, you'd want to remove the Postfix package entirely (apt will probably want to install sendmail, if you'd removed it at any point in this process), using whatever option tells the package manager to kill the config files as well (if needed, as it is on Debian/Ubuntu), and then let the install script reinstall it and configure it for you.

The -u|--uninstall option is somewhat simplistic, and can't do much to clean up anything that got botched outside of the stuff that the install mode usually handles--so, if you turned off the virtual maps file, it'll get fixed, but if you did something to logging, or the various recipient/sender maps, or whatever, they would remain the same after an uninstall/reinstall cycle.

It is an imprecise art, dealing with so many packages and so much configuration. The next major release of the install script (written in Perl) will be quite a bit smarter, and will be able to deal with numerous contingencies that the shell script can't even think about. There will also be a bit more use of meta-packages (package groups in yum, and I'm not sure what yet in apt-get, but I guess it has something similar) rather than hard dependencies.


Check out the forum guidelines!

Tue, 11/18/2008 - 09:57 (Reply to #23)

I have decided to uninstall virtualmin and all virtualserver and reinstall them again? where is related to this matter?
please guide me.

Tue, 11/18/2008 - 10:02 (Reply to #24)

OK, I am trying to uninstall it first and reinstall it again!

Tue, 11/18/2008 - 10:08 (Reply to #25)

Sorry, where should I run it. When I execute: &quot;./ -u&quot; I get the following messages:

<div class='quote'>error: package virtualmin-base is not installed
error: package wbm-virtual-server is not installed
error: package wbm-virtualmin-htpasswd is not installed
error: package wbm-virtualmin-dav is not installed
error: package wbm-virtualmin-mailman is not installed
error: package wbm-virtualmin-awstats is not installed
error: package wbm-virtualmin-svn is not installed
error: package wbt-virtual-server-theme is not installed
error: package ust-virtual-server-theme is not installed
error: package awstats is not installed
Done. There's probably quite a bit of related packages and such left behind
but all of the Virtualmin-specific packages have been removed.</div>

Whatcan I do?

Tue, 11/18/2008 - 10:23 (Reply to #26)

It has mentioned here( that installer should not execute at system currently running Webmin! As you know mine has Webmin running. How to deal with this issue?

Tue, 11/18/2008 - 10:28 (Reply to #27)
Joe's picture

The point of any warnings about running the install script is that the install script dramatically alters configuration. If you have a production system, things might break, if you run on it.

Also, if you installed Webmin using odd packages from some source other than ours (either or, then there will very, very, very, likely be conflicts in the way things are configured or setup, and the install will fail in possibly subtle (but time-consuming to fix) ways.

So, is this a production system? Is Webmin installed from an odd source, or from a tarball rather than the correct package type for your system? If no on both counts, running should be fine. is most happy on a freshly installed Grade A supported operating system. If the system is not freshly installed (meaning you've installed and configured a bunch of other stuff before running, including, but not limited to Webmin) you'll just confuse the poor thing and probably break whatever configuration you've done (which may also lead to the new configuration not working either). But, there are varying degrees of &quot;not freshly installed&quot;. I have no idea how &quot;not freshly installed&quot; your system is. ;-)


Check out the forum guidelines!

Tue, 11/18/2008 - 10:35 (Reply to #28)

Thank you for your reply.

I have bought the VPS with installed Webmin, I am not aware of odd packages. I think I have to spend some more time on it.

Anyway, I will contact the VPS provider and wait for their answer about od packages. I think it is enough for today.

Thank you for your helps.

Wed, 11/19/2008 - 00:02 (Reply to #29)

Thank you guys!

Reinstalling the Webnmin and Virtualmin did not resolve the problem. However after some research I found how to resolve it. By looking at file and this line :

<div class='quote'>-o smtpd_client_restrictions=permit_sasl_authenticate d,reject</div>

This line makes restriction for incoming messages from External STMP server. I have commented this line and Postfix is working fine. I must note that I found the solution somewhere on the web.

There is another problem, after reinstalling Webmin &amp; VirtualMin the real memory usage is 128/128 and there is no free memory in real memory. Is it a risk to have several sites in this case?


Wed, 11/19/2008 - 08:09 (Reply to #30)
Joe's picture

<div class='quote'>There is another problem, after reinstalling Webmin &amp; VirtualMin the real memory usage is 128/128 and there is no free memory in real memory. Is it a risk to have several sites in this case?</div>

You need to read the Virtualmin on Low Memory Systems guide here:,virtualmin_on_low_memory_syst...


Check out the forum guidelines!

Wed, 11/19/2008 - 04:01 (Reply to #31)

Once again the problem came back, Postfix acts as like as SendMail now. It does not send e-mail to some out servers. It brings time out error.

<div class='quote'>Nov 19 05:46:37 server postfix/smtp[18018]: 1BD1F10F59CB: to=&lt;;,[XX.20.XX.193]:25, delay=1358, delays=1187/0.01/0.4/170, dsn=4.0.0, status=deferred (host[XX.20.XX.193] said: 421 SMTP incoming data timeout - closing connection. (in reply to end of DATA command))</div>

<b>please help me!</b>


Wed, 11/19/2008 - 04:52 (Reply to #32)

In regards to memory usage - yeah, 128Mb is considered a low memory system. It can be coaxed to work (depending on how much a load you're expecting it to handle), though you certainly might want to consider getting some more RAM for it.

You might want to look at this guide for Virtualmin on low memory systems:,virtualmin_on_low_memory_syst...

I can't answer whether it'll work for your specific case, it depends more on their resource demands, how much traffic, how much email you process -- but you could always try it :-)

In regards to the problem you're seeing in sending email -- do you get the &quot;421 incoming data timeout&quot; for any outgoing email you send, or is it just to that one site?

Wed, 11/19/2008 - 05:28 (Reply to #33)

Regarding e-mail sending : yes, I get error approximately for all outgoing emails except with yahoo or gmail. (I have sent e-mails to these e-mail addresses yesterday, but now it shows error 421)

Yahoo says:
<div class='quote'>
Nov 19 07:19:48 server postfix/smtp[28000]: 2E6F810F59CB: host[] refused to talk to me: 421 Message from (XX.8.XX.30) temporarily deferred - 4.16.50. Please refer to</div>

but accepts e-mail message by delay. Other sites do not.

please guide me.

Wed, 11/19/2008 - 05:35 (Reply to #34)

Well, the Yahoo message is okay, they're probably greylisting you, which just means the message will go through later.

I poked around a little bit searching for ideas on what might cause that 421/timeout error, and came up with some interesting possibilities.

I first ran into it here:

Which led me to this Postfix FAQ:

(search for: Mail fails consistently with timeout or lost connection)

Which would explain why you're seeing the issue in both Sendmail and Postfix. So, try finding the sysctl syntax to &quot;disable path MTU discovery&quot;, and that might just do the trick

Wed, 11/19/2008 - 05:57 (Reply to #35)

Thank you, but please excuse me that I am really confused.

My problem is the same as &quot;Matt Armstrong&quot; in But how do I drop my routers MTU to 1492 promptly (as &quot;Matt Armstrong&quot; noted he has resolved the problem by this way)? I do not know what is it?

Please guide me.

Wed, 11/19/2008 - 06:10 (Reply to #36)

There are two Configuration Items contain &quot;mtu&quot; when I type sysctl -A :

1)net.ipv4.ip_no_pmtu_disc = 0
2)net.ipv4.tcp_mtu_probing = 0

How do I change them?

Wed, 11/19/2008 - 06:11 (Reply to #37)

Routers have a setting in them called an &quot;MTU&quot;. He's just saying he made sure they were set no higher than 1492.

If you colocate your box, that may be a setting with your ISP/provider.

However, in the Postfix FAQ, it says that a &quot;bandaid&quot; for the problem is to use the &quot;sysctl&quot; command to &quot;disable path MTU discovery&quot; on your server.

I don't know the syntax off the top of my head, but I'm sure a Google search will lead you to how to do that.

Wed, 11/19/2008 - 06:19 (Reply to #38)

Thank you, I decide to send first item, but when I try to execute the below command :

<div class='quote'>echo &quot;1&quot; &gt;/proc/sys/net/ipv4/ip_no_pmtu_disc</div>

it says :

<div class='quote'>-bash: /proc/sys/net/ipv4/ip_no_pmtu_disc: Operation not permitted</div>

Do you know why do I see this, I am logged in as root!


Wed, 11/19/2008 - 06:57 (Reply to #39)

Anyway, thank you guys!

It is a BIG CLUE, I keep my GOOGLING to find a way!


Wed, 11/19/2008 - 07:01 (Reply to #40)

Try running:

sysctl -w net.ipv4.ip_no_pmtu_disc = 1

Wed, 11/19/2008 - 08:35 (Reply to #41)

Thank you andreycheck &amp; joe for your comments,

I have tried many ways to change the value of net.ipv4.ip_no_pmtu_disc but all return an error about permissions. Now I have contacted with provider and waiting for their answer. No hope.


Fri, 11/21/2008 - 10:01 (Reply to #42)

Hi Guys,

After more researching on the web, the problem has been fixed. I update this thread to make a further reference and for those who may have a similar problem.

<b>Q: Why is it impossible to update the value of ip_no_pmtu_disc in sysctl (in my case)?</b>
<i>A: Because I am on VPS (virtual Private Server) and it is not allowed by default. (My researches showed to me that OpenVZ does not allow it)</i>

<b>Q: What was the problem really and how did I overcome the problem? </b>
<i>A: I am not expert but I would like to share my experience as a newbie. Actually the problem was where SendMail or Postfix were unable to send e-mail messages completely and in brief they did not finish the messages and sending tasks. While the remote servers were waiting for task completion but no thing were being done by our server. At last the remote servers were closing the connection (after no activity from our server). After researching on it I have found that it is related to MTU size. So I have changed the MTU size to 1000 and now Postfix works as a charm.</i>

I hope the problem does not come back. If it comes back, I will come back here. :-)

Please edit my post if it contains false info.

Thanks guys

Topic locked