<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RedHatVN Network &#187; mail server</title>
	<atom:link href="http://redhatvn.net/tag/mail-server/feed" rel="self" type="application/rss+xml" />
	<link>http://redhatvn.net</link>
	<description>Shared Linux problems</description>
	<lastBuildDate>Mon, 31 Oct 2011 07:10:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How To Use Gmail Account To Relay Email From a Shell Prompt</title>
		<link>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2</link>
		<comments>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:26:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1298</guid>
		<description><![CDATA[Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2"></g:plusone></div><p>Usually, you do not need to setup an  email server under Linux desktop operating system. Most GUI email  clients (such as Thunderbird) supports Gmail POP3 and IMAP  configurations. But, how do you send mail via the standard or  /usr/bin/mail user agents or a shell script? Programs such as sendmail /  postfix / exim can be configured as a gmail smarthost but they are  largely overkill for this use.</p>
<p>You can use gmail as a smart host to send all messages from your Linux /  UNIX desktop systems.  You need to use a simple program called ssmtp.  It accepts a mail stream on standard input with recipients specified on  the command line and synchronously forwards the message to the mail   transfer agent of a mailhub for the mailhub MTA to process. Failed  messages are placed in dead.letter in the sender&#8217;s home directory.<br />
<span id="more-1298"></span></p>
<h2>Install ssmtp</h2>
<p>Type the following command under CentOS / RHEL / Red Hat / Fedora Linux:<br />
<code># yum install ssmtp</code><br />
Type the following command under Debian / Ubuntu Linux:<br />
<code># apt-get update &amp;&amp; apt-get install ssmtp</code></p>
<h3>Configure gmail as a smarthost</h3>
<p>Open /etc/ssmtp/ssmtp.conf, enter:<br />
<code># vi /etc/ssmtp/ssmtp.conf</code><br />
Update file with the following settings:</p>
<blockquote><p>
AuthUser=vivek@gmail.com<br />
AuthPass=Your-Gmail-Password<br />
FromLineOverride=YES<br />
mailhub=smtp.gmail.com:587<br />
UseSTARTTLS=YES
</p></blockquote>
<p>Also, make sure you disable Sendmail:<br />
<code># service sendmail stop<br />
# chkconfig sendmail off<br />
# mkdir /root/.bakup<br />
# mv /usr/sbin/sendmail /root/.bakup<br />
#  ln -s /usr/sbin/ssmtp /usr/sbin/sendmail</code><br />
Now, you can use mail / mailx command to send email messages. You can  also write a shell script to backup your files and email to somewhere  else (see below). You can test settings using following syntax:<br />
<code>$ echo "This is a test" | mail -s "Test" vivek@nixcraft.co.in</code></p>
<h3>A note about sSMTP</h3>
<p>sSMTP works well for desktop systems, but it is not a replacement for  Sendmail / Postfix / Exim  / Qmail for email server environment. This  software is perfect for a single user system.</p>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Mail Through Gmail with Perl</title>
		<link>http://redhatvn.net/sending-mail-through-gmail-with-perl</link>
		<comments>http://redhatvn.net/sending-mail-through-gmail-with-perl#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:35:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1301</guid>
		<description><![CDATA[We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl. The Code use Net::SMTP::TLS; my $mailer = new Net::SMTP::TLS( &#8216;smtp.gmail.com&#8217;, Hello => &#8216;smtp.gmail.com&#8217;, Port => 587, User [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/sending-mail-through-gmail-with-perl"></g:plusone></div><p>We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl.<br />
The Code</p>
<blockquote><p>
use Net::SMTP::TLS;<br />
my $mailer = new Net::SMTP::TLS(<br />
&#8216;smtp.gmail.com&#8217;,<br />
Hello   =>      &#8216;smtp.gmail.com&#8217;,<br />
Port    =>      587,<br />
User    =>      &#8216;username&#8217;,<br />
Password=>      &#8216;password&#8217;);<br />
$mailer->mail(&#8216;from@domain.com&#8217;);<br />
$mailer->to(&#8216;to@domain.com&#8217;);<br />
$mailer->data;<br />
$mailer->datasend(&#8220;Sent from perl!&#8221;);<br />
$mailer->dataend;<br />
$mailer->quit;
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/sending-mail-through-gmail-with-perl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable imap/pop3 for a particular user</title>
		<link>http://redhatvn.net/disable-imappop3-for-a-particular-user</link>
		<comments>http://redhatvn.net/disable-imappop3-for-a-particular-user#comments</comments>
		<pubDate>Thu, 29 Apr 2010 09:10:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1196</guid>
		<description><![CDATA[Edit /etc/dovecot.conf, find: mechanisms = plain Add after: passdb passwd-file { args = /etc/dovecot-deny.%Ls deny = yes } Now use the following script to disable IMAP (or POP3 (replace IMAP with POP3 in the script)) access (usage: ./script allow/deny usename): #!/bin/sh # # Script used to deny IMAP access for a particular user show_help() { [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/disable-imappop3-for-a-particular-user"></g:plusone></div><p>Edit /etc/dovecot.conf, find:</p>
<p><code>mechanisms = plain</code></p>
<p>Add after:<br />
<span id="more-1196"></span></p>
<blockquote><p>passdb passwd-file {<br />
    args = /etc/dovecot-deny.%Ls<br />
    deny = yes<br />
  }</p></blockquote>
<p>Now use the following script to disable IMAP (or POP3 (replace  IMAP with POP3 in the script)) access (usage: ./<strong>script allow/deny</strong> <strong>usename</strong>):</p>
<blockquote><p>#!/bin/sh<br />
#<br />
# Script used to deny IMAP access for a particular user</p>
<p>show_help()<br />
{<br />
        echo &#8220;IMAP allow/deny script.&#8221;;<br />
        echo &#8220;&#8221;;<br />
        echo &#8220;Usage: $0 allow/deny username&#8221;;<br />
        echo &#8220;&#8221;;<br />
}</p>
<p>if [ $# -eq 2 ]; then<br />
        echo &#8220;Using $2.&#8221;<br />
else<br />
        show_help;<br />
        exit 1;<br />
fi</p>
<p>IMAPDENY=/etc/dovecot-deny.imap</p>
<p>OS=`uname`;</p>
<p>if [ $1 = "allow" ]; then<br />
        OPTION=allow<br />
else<br />
        OPTION=deny<br />
fi</p>
<p>USER=$2</p>
<p>if [ ${OPTION} = "allow" ]; then<br />
        if [ "`grep -c \"${USER}\" ${IMAPDENY}`" = "0" ]; then<br />
                echo &#8220;User ${USER} is already allowed.&#8221;;<br />
                exit 1;<br />
        fi<br />
fi</p>
<p>if [ ${OPTION} = "deny" ]; then<br />
        if [ "`grep -c \"${USER}\" ${IMAPDENY}`" = "1" ]; then<br />
                echo &#8220;User ${USER} is already denied.&#8221;;<br />
                exit 1;<br />
        fi<br />
fi</p>
<p>if [ ! -d /home/${USER} ]; then<br />
        echo &#8220;User ${USER} does not exist.&#8221;<br />
        exit 1;<br />
fi</p>
<p>if [ ${OPTION} = "allow" ]; then<br />
        perl -pi -e &#8220;s/${USER}\n//g&#8221; ${IMAPDENY}<br />
fi</p>
<p>if [ ${OPTION} = "deny" ]; then<br />
        echo &#8220;$USER&#8221; &gt;&gt; ${IMAPDENY}<br />
fi<br />
exit 0;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/disable-imappop3-for-a-particular-user/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fast and Secure Contact Form &#8211; doesn&#8217;t works</title>
		<link>http://redhatvn.net/fast-and-secure-contact-form-doesnt-works</link>
		<comments>http://redhatvn.net/fast-and-secure-contact-form-doesnt-works#comments</comments>
		<pubDate>Thu, 29 Apr 2010 08:44:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1189</guid>
		<description><![CDATA[I&#8217;ve just installed this plugin, I have wp-smtp-mail plugin installed as well. The test thing on the plugin works, however I receive an error when trying to utilize the actual contact form. The error it self is: The e-mail could not be sent. Possible reason: your host may have disabled the mail() function. http://wordpress.org/extend/plugins/si-contact-form/ solution: [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/fast-and-secure-contact-form-doesnt-works"></g:plusone></div><p>I&#8217;ve just installed this plugin, I have wp-smtp-mail plugin installed as well. The test thing on the plugin works, however I receive an error when trying to utilize the actual contact form.</p>
<p>The error it self is:</p>
<blockquote><p>The e-mail could not be sent.<br />
Possible reason: your host may have disabled the mail() function.</p></blockquote>
<p>http://wordpress.org/extend/plugins/si-contact-form/</p>
<p>solution:<br />
<span id="more-1189"></span></p>
<blockquote><p>Some web hosts restrict sending mail unless the &#8220;From&#8221; address is a<br />
valid address on the same domain.<br />
Try step 3 of the &#8220;email not working&#8221; in the FAQ</p>
<p>http://wordpress.org/extend/plugins/si-contact-form/faq/</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/fast-and-secure-contact-form-doesnt-works/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Monitor cpu abusers with script</title>
		<link>http://redhatvn.net/how-to-monitor-cpu-abusers-with-script</link>
		<comments>http://redhatvn.net/how-to-monitor-cpu-abusers-with-script#comments</comments>
		<pubDate>Fri, 15 Jan 2010 06:08:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1084</guid>
		<description><![CDATA[The script found on the following site http://bashcurescancer.com The a script is called monitorCpuUsage.sh. It is meant to be called from crontab and to inform you of processes or users who maybe using excessive amounts of cpu. Here is the help screen: # ./monitorCpuUsage.sh -h Usage: monitorCpuUsage.sh -u starting uid, must be an integer greater than or [...]]]></description>
			<content:encoded><![CDATA[<div class="google_plus_one"><g:plusone size="medium" count="true" url="http://redhatvn.net/how-to-monitor-cpu-abusers-with-script"></g:plusone></div><p>The script found on the following site http://bashcurescancer.com</p>
<p>The a script is called <a href="http://bashcurescancer.com/media/scripts/monitorCpuUsage.sh.txt">monitorCpuUsage.sh</a>. It is meant to be called from crontab and to inform you of processes or users who maybe using excessive amounts of cpu.<br />
<span id="more-1084"></span><br />
Here is the help screen:</p>
<blockquote><p>
<code># ./monitorCpuUsage.sh -h</code><br />
Usage: monitorCpuUsage.sh<br />
-u starting uid, must be an integer greater than or equal to 0 (only used with &#8220;-w users&#8221;)<br />
-m max cpu, must be an integer greater than or equal to 0 and less than 100<br />
-w what to watch, must be &#8220;users&#8221; or &#8220;procs&#8221;<br />
-e must contain an email address<br />
-d specifies debug mode in which -e, -m, and -u do not need to be specified.</p></blockquote>
<p>Here the script in use. I used the -d option which means the script sets the “maximum cpu allowed to -1″ and prints to the screen rather than emailing.</p>
<blockquote><p><code># ./monitorCpuUsage.sh -w users -d -u 100</code><br />
Mon Oct 15 03:15:54 EDT 2007<br />
User brock is using 0% cpu.<br />
User nfsnobody is using 0% cpu.<br />
User USER is using 0% cpu.</p>
<p>Watching processes…again with -d specified.</p>
<p><code># ./monitorCpuUsage.sh -w procs -d</code><br />
Mon Oct 15 03:17:20 EDT 2007<br />
Process aio/0 is using 0% cpu.<br />
Process atd is using 0% cpu.<br />
Process bash is using 0% cpu.<br />
Process crond is using 0% cpu.<br />
Process dhclient is using 0% cpu.<br />
Process events/0 is using 0% cpu.<br />
Process httpd is using 0% cpu.<br />
Process init is using 0% cpu.<br />
Process java is using 0% cpu.<br />
Process jfsCommit is using 0% cpu.<br />
Process jfsIO is using 0% cpu.<br />
Process jfsSync is using 0% cpu.<br />
Process kblockd/0 is using 0% cpu.<br />
Process kcryptd/0 is using 0% cpu.<br />
Process khelper is using 0% cpu.<br />
Process kjournald is using 0% cpu.<br />
Process klogd is using 0% cpu.<br />
Process ksnapd is using 0% cpu.<br />
Process ksoftirqd/0 is using 0% cpu.<br />
Process kswapd0 is using 0% cpu.<br />
Process kthreadd is using 0% cpu.<br />
Process lockd is using 0% cpu.<br />
Process mingetty is using 0% cpu.<br />
Process monitorCpuUsage is using 0% cpu.<br />
Process mysqld is using 0% cpu.<br />
Process mysqld_safe is using 0% cpu.<br />
Process nfsd is using 0% cpu.<br />
Process pdflush is using 0% cpu.<br />
Process portmap is using 0% cpu.<br />
Process ps is using 0% cpu.<br />
Process rpc.mountd is using 0% cpu.<br />
Process rpc.rquotad is using 0% cpu.<br />
Process rpc.statd is using 0% cpu.<br />
Process rpciod/0 is using 0% cpu.<br />
Process sendmail is using 0% cpu.<br />
Process sshd is using 0% cpu.<br />
Process su is using 0% cpu.<br />
Process syslogd is using 0% cpu.<br />
Process xfs is using 0% cpu.<br />
Process xfsdatad/0 is using 0% cpu.<br />
Process xfslogd/0 is using 0% cpu.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/how-to-monitor-cpu-abusers-with-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
