<?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>Takahisa's Weblog</title>
	<atom:link href="http://takahisa.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://takahisa.info</link>
	<description>weblog of lifetips?</description>
	<lastBuildDate>Thu, 18 Mar 2010 02:34:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sftp chroot with openssh ERROR : fatal: bad ownership or modes for chroot directory</title>
		<link>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/</link>
		<comments>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 02:34:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=257</guid>
		<description><![CDATA[If you’re playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like:
fatal: bad ownership or modes for chroot directory
You may also have searched on Google for what to do about it and come away with very [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like:</p>
<p>fatal: bad ownership or modes for chroot directory<br />
You may also have searched on Google for what to do about it and come away with very little useful information.</p>
<p>Well no more! I did the same thing and got bored of reading mailing list posts, so read the source code instead. The relevant section is in session.c:</p>
<p>    if (stat(component, &#038;st) != 0)<br />
      fatal(&#8220;%s: stat(\&#8221;%s\&#8221;): %s&#8221;, __func__,<br />
          component, strerror(errno));<br />
    if (st.st_uid != 0 || (st.st_mode &#038; 022) != 0)<br />
      fatal(&#8220;bad ownership or modes for chroot &#8221;<br />
          &#8220;directory %s\&#8221;%s\&#8221;",<br />
          cp == NULL ? &#8220;&#8221; : &#8220;component &#8220;, component);<br />
This is quite simple really, it’s stat()ing the directory specified for “ChrootDirectory” and all its parents up to / and checking that they are:</p>
<p>owned by root<br />
not group or other writable<br />
(it also checks they are actually directories, but I’m going to assume you’re not stupid enough to try and chroot into a file )<br />
Note my emphesis that these checks apply to the chroot directory itself and its parents and /, so if you are chrooting users into /srv/chroot/ then you need to ensure that /, /srv and /srv/chroot are owned by root and not writable by the group (even if it’s root, bizarrely) or other users.</p>
<p>Adopted from : http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/18/sftp-chroot-with-openssh-error-fatal-bad-ownership-or-modes-for-chroot-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup dkim on postfix with amavisd-new</title>
		<link>http://takahisa.info/2010/03/11/setup-dkim-on-postfix-with-amavisd-new/</link>
		<comments>http://takahisa.info/2010/03/11/setup-dkim-on-postfix-with-amavisd-new/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:26:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amavisd]]></category>
		<category><![CDATA[dkim]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=248</guid>
		<description><![CDATA[step by step instruction coming soon&#8230;
Setting up DKIM mail signing and verification from http://www.ijs.si/software/amavisd/
Setting up DKIM mail signing and verification
A DKIM standard (RFC 4871) states the following, which applies
to its predecessor DomainKeys (historical: RFC 4870) as well:


DomainKeys Identified Mail (DKIM) defines a mechanism by which email
messages can be cryptographically signed, permitting a signing domain
to claim [...]]]></description>
			<content:encoded><![CDATA[<p>step by step instruction coming soon&#8230;</p>
<p>Setting up DKIM mail signing and verification from http://www.ijs.si/software/amavisd/</p>
<h2><a name="dkim">Setting up DKIM mail signing and verification</a></h2>
<p>A DKIM standard (RFC 4871) states the following, which applies<br />
to its predecessor DomainKeys (historical: RFC 4870) as well:</p>
<blockquote>
<p><i><br />
DomainKeys Identified Mail (DKIM)</i> defines a mechanism by which email<br />
messages can be cryptographically signed, permitting a signing domain<br />
to claim responsibility for the introduction of a message into the<br />
mail stream.  Message recipients can verify the signature by querying<br />
the signer&#8217;s domain directly to retrieve the appropriate public key,<br />
and thereby confirm that the message was attested to by a party in<br />
possession of the private key for the signing domain.</p>
</blockquote>
<blockquote>
<p>The <i>DomainKeys</i> specification was a primary source from which the<br />
<i>DomainKeys Identified Mail [DKIM]</i> specification has been derived.<br />
The purpose in submitting the RFC 4870 document is as an historical reference<br />
for deployed implementations written prior to the DKIM specification.</p>
</blockquote>
<p>The main advantage of DKIM signing <b>to sending domains</b><br />
is that it allows recipients to reliably validate mail origin for<br />
purposes of <b>whitelisting</b> on spam checks and whitelisting<br />
reception of otherwise banned mail contents. By signing outbound<br />
mail you give your correspondents a chance to distinguish between<br />
your genuine mail, and fraud or spam mail which may happen to carry<br />
your domain name as a sender address. Signing outbound mail is a<br />
<b>kind gesture towards recipients</b>, making it much easier for them<br />
to <b>treat your mail as important or desirable</b> if they choose so.</p>
<p>The main advantage of DKIM signature verification <b>to recipients</b><br />
is that it allows them to reliably distinguish genuine mail originating<br />
from a claimed sending domain from other (possibly faked) mail. It<br />
makes <b>signature-based whitelisting</b> a <b>reliable</b> mechanism.<br />
It also makes it possible to recognize and automatically discard<br />
<b>fake mail</b> claiming to be from domains which are known to always<br />
sign their outbound mail and to always send mail directly. Coupled<br />
with <b>reputation</b> schemes (mostly manual/static at present,<br />
or dynamic in the future) makes it possible to assign score points<br />
(positive or negative) based on merit and past experience<br />
with each signing domain. A valid signature also offers<br />
<b>non-repudiation</b>: a domain which signed a message can not<br />
disclaim message origin, which offers recipient a strong argument<br />
when <b>reporting abuse</b> to the signing domain.</p>
<h3><a name="dkim-impatient">For the impatient &#8211; signing from scratch</a></h3>
<p>Here is a quick Spartanic setup of DKIM signing and DKIM/DK<br />
verification by amavisd for the impatient, without much explanation,<br />
assuming all originating mail comes from internal networks (not<br />
from authenticated roaming clients), only one domain needs<br />
signing, using default signature tags, no milters are in use<br />
and no mailing list manager needs signing. No changes in Postfix<br />
configuration is necessary for this simple setup. For more<br />
information and more complex setups please see sections<br />
further on.</p>
<p>Generate a signing key:</p>
<pre>  $ amavisd genrsa /var/db/dkim/example-foo.key.pem
</pre>
<p>add to amavisd.conf:</p>
<pre>  $enable_dkim_verification = 1;
  $enable_dkim_signing = 1;
  dkim_key('example.com', 'foo', '/var/db/dkim/example-foo.key.pem');
  @dkim_signature_options_bysender_maps = (
    { '.' =&gt; { ttl =&gt; 21*24*3600, c =&gt; 'relaxed/simple' } } );
  @mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12
                   192.168.0.0/16);  # list your internal networks
</pre>
<p>run:</p>
<pre>  $ amavisd showkeys
</pre>
<p>add the public key (as displayed) to your DNS zone, increment SOA<br />
sequence number and reload DNS; then test signing and a published key:</p>
<pre>  $ amavisd testkeys
</pre>
<p>if all went well:</p>
<pre>  $ amavisd reload
</pre>
<h3><a name="dkim-impatient-from-milter">For the impatient &#8211; replacing<br />
signing by dkim-milter with signing by amavisd</a></h3>
<p>For sites already signing their mail by dkim-milter, most work<br />
of preparing signing keys and publishing public keys in DNS has<br />
already been done. All it needs to be done is to declare these<br />
signing keys in amavisd.conf and turn on $enable_dkim_signing.</p>
<p>To facilitate transition of DKIM signing from dkim-milter to amavisd-new,<br />
a new command-line tool is available with amavisd-new-2.6.2 (the extra<br />
utility code is not loaded during normal operation), taking a file name<br />
as its argument, e.g.:</p>
<pre>  $ amavisd convert_keysfile /var/db/dkim/keysfile.txt
</pre>
<p>and writing to stdout a set of lines that may be directly included into<br />
amavisd.conf configurations file, matching semantics of a dkim-filter<br />
keys file. It can be useful during transition, or for those who prefer<br />
to specify signing keys and sender-to-key mappings as a file in a syntax<br />
compatible with options -K -k of dkim-filter, and can live with limitations<br />
of such syntax. See dkim-filter(8) man page for details on the<br />
syntax.</p>
<p>The produced output consists of signing key declarations (calls to<br />
a procedure dkim_key), where each call normally corresponds to exactly<br />
one DNS resource record publishing a corresponding DKIM public key.<br />
When necessary output also produces an assignment to a list of lookup<br />
tables @dkim_signature_options_bysender_maps, which supplies non-default<br />
mappings of sender domains to signing keys, e.g. when third-party<br />
signatures are desired.</p>
<h3><a name="dkim-mail-flow">Implementation and mail flow</a></h3>
<p>Signing of originating mail (or mail being redistributed by our domain),<br />
and verifying signatures of incoming mail are two tasks that can be<br />
performed by the same program, or they can be performed by separate entities.<br />
Traditionally with sendmail, both tasks are performed by one milter,<br />
which may be easier to maintain, but has certain disadvantages.</p>
<p>Verifying signatures should be performed early, before any local mail<br />
transformations get a chance of invalidating a signature, e.g. by performing<br />
MIME conversions to quote-printable, by fixing syntactically invalid mail<br />
header section, by reformatting or reordering some header fields (some MTAs<br />
do it frivolously), by modifying/inserting/removing certain header<br />
fields, or by a local mailing list modifying mail text, e.g. by appending<br />
footers.</p>
<p>Signing outgoing mail should be performed late, after mail sanitation,<br />
after conversion to 7-bit characters (to avoid later uncontrollable<br />
changes by a relaying or receiving MTA), and after editing header<br />
section by a content filter. Similar applies to local mailing lists,<br />
which may be rewriting messages, requiring them to be re-signed by<br />
the domain hosting a mailing list, just before being sent out.</p>
<p>Starting with amavisd-new version 2.6.0, DKIM signing can be<br />
performed directly by amavisd (using a Perl module Mail::DKIM,<br />
which is the same module as used by DKIMproxy and by SpamAssassin).<br />
Signing directly by amavisd reduces setup complexity using a milter<br />
or DKIMproxy, and avoids additional data transfers. Regarding mail<br />
flow through the system there are similarities between signing in<br />
amavisd and signing by dkim-milter, which is why the diagram below<br />
shows both possibilities.</p>
<p>For verification there are three choices: either amavisd itself<br />
can do it by calling Mail::DKIM directly, or a SpamAssassin plugin<br />
can do it by calling the same Perl module, or a milter in<br />
verification-only mode can be invoked by an incoming Postfix<br />
smtpd service.</p>
<p>Advantage of invoking signature <i>verification by amavisd</i><br />
is that <i>all mail is checked</i> for signatures, regardless of<br />
whether SpamAssassin is called or not. Typically messages beyond<br />
a certain size are not passed to SpamAssassin, and neither are<br />
infected message or identified bounces. Amavisd also offers loading<br />
of policy banks based on valid DKIM/DK signatures (e.g. allowing<br />
some domains to send-in otherwise banned files, or whitelisting on<br />
spam), offers to add score points based on signing domain reputation,<br />
and adds Authentication-Results header field (like a dkim-milter<br />
does).</p>
<p>Invoking signature <i>verification by SpamAssassin</i> has an<br />
advantage that DKIM-based or DomainKeys-based whitelisting or scoring<br />
can be used, but has a disadvantage that possibly not all mail is<br />
checked (e.g. large mail and infected mail may be exempt from spam<br />
checks). Performing the same signature validation task twice (by<br />
amavisd and by SA) may seem wasteful, but in practice it is not<br />
too bad: thanks to DNS server caching a network lookup for a<br />
public signing key is only done once, and as SpamAssassin does not<br />
receive large mail for processing, its signature verification is<br />
very quick: few milliseconds for non-signed mail, and of the order<br />
of a tenth of a second for signed mail.</p>
<p>Invoking signature <i>verification by calling a milter</i> from<br />
incoming smtpd service has an advantage that it has the best chance<br />
of seeing mail in its pristine form (before canonical and virtual<br />
mapping or masquerading by MTA, regardless of their settings).<br />
Because it is poorly integrated with the rest of the chain (e.g. with<br />
SpamAssassin rules and amavisd policy banks), and because it adds<br />
one extra data transfer, it is mainly still useful as a way to<br />
double-check the correctness of DKIM validation by having two<br />
independent implementations in use, each inserting its independently<br />
derived Authentication-Results header field into passed mail.</p>
<p>To sign as late as possible with a dkim-milter, the signing<br />
milter can be invoked by a Postfix smtpd service which is receiving<br />
content-checked mail from a content filter such as amavisd-new.<br />
As this second-stage smtpd service does not reliably know how a<br />
given message came into a mail system and whether it is supposed<br />
to be signed or not, a clean solution is to provide two (or more)<br />
parallel paths through MTA and through a content filter, one used<br />
for mail that is eligible for being signed (originating mail),<br />
the other for all the rest. This same dual path approach through<br />
amavisd is beneficial for signing by amavisd too, for the same<br />
reason of providing a reliable source of information on mail<br />
origin to a signature choosing code:</p>
<pre>              +------+
              |verify|          (verify)
              +--+---+              | (by amavisd and/or SA)
                ^^^ milter          |
incoming:       |||             +---v-------+
  MX ----&gt;  25 smtpd ---&gt; 10024 &gt;           &gt;---&gt; 10025 smtpd --&gt;
                 ||             |           |
  SASL --&gt;  25 smtpd \          |  amavisd  | (notifications)
submission        |   +-&gt;       |           &gt;---&gt;_
  mynets-&gt;  25 smtpd ---&gt; 10026 &gt;ORIGINATING&gt;---&gt; 10027 smtpd --&gt;
submission            +-&gt;       +-------^---+            |
       --&gt; 587 smtpd /  :               |                v milter
                       (convert         |             +------+
                       to 7-bit)      (sign)          | sign |
                                                      +------+
</pre>
<p>There are other benefits to providing two parallel paths: a content<br />
filter may be configured to apply different rules and settings to mail<br />
that is known to be originating from our users. Some suggestions: apply<br />
less strict banning rules, enable spam administrator notifications for<br />
internally originating spam and viruses, letting SpamAssassin rules be<br />
conditionalized based on amavisd-new policy banks loaded, etc.</p>
<h3><a name="dkim-postfix-dual-path">Configuring multiple mail paths<br />
in Postfix</a></h3>
<p>Here is one way of configuring Postfix for providing two paths<br />
through a content filter. Locally submitted or authenticated mail<br />
will go to a content filter to its port 10026 and will be signed on<br />
its way out (either by amavisd or by a signing milter). All other<br />
mail (incoming) will be diverted to port 10024 for normal content<br />
filtering, and will not be eligible for signing.</p>
<p><i>main.cf:</i></p>
<pre>  # on re-queueing of a message smtpd_*_restrictions do not apply,
  # so we'd better provide a safe default for a content_filter,
  # even at an expense of later flipping the choice twice
  # (which adds a bit to log clutter, but never mind)
  #
  content_filter = amavisfeed:[127.0.0.1]:10024

  # each triggered FILTER deposits its argument into a
  # content_filter setting, the last deposited value applies
  #
  smtpd_sender_restrictions =
    check_sender_access regexp:/etc/postfix/tag_as_originating.re
    permit_mynetworks
    permit_sasl_authenticated
    permit_tls_clientcerts
    check_sender_access regexp:/etc/postfix/tag_as_foreign.re

  # Make sure to assign FILTER tags in restrictions which
  # are only invoked once per message, e.g. client or sender
  # restrictions, but NOT on smtpd_recipient_restrictions,
  # as a message may have multiple recipients, so multiple
  # passes through FILTER tag assignments can yield a
  # surprising (and incorrect) result.
</pre>
<p><i>/etc/postfix/tag_as_originating.re:</i></p>
<pre>  /^/  FILTER amavisfeed:[127.0.0.1]:10026
</pre>
<p><i>/etc/postfix/tag_as_foreign.re:</i></p>
<pre>  /^/  FILTER amavisfeed:[127.0.0.1]:10024
</pre>
<p>In master.cf set up two listening smtpd services for receiving<br />
filtered mail from amavisd (as per README.postfix), one on tcp<br />
port 10025 (for inbound mail) and the other on port 10027 (for<br />
originating mail). If a signing milter is in use it will be<br />
attached to a smtpd service on 10027 only. If no milters are<br />
in use and signing is done by amavisd, both smtpd services can<br />
have exactly the same settings, and in fact only one suffices,<br />
in which case redirecting $forward_method and $notify_method to<br />
&#8217;smtp:[127.0.0.1]:10027&#8242; in later example can be disregarded.</p>
<h3><a name="dkim-amavisd-path">Configuring multiple mail paths<br />
in amavisd</a></h3>
<p>In amavisd.conf two parallel paths need to be provided,<br />
one receiving on port 10024 and forwarding to 10025,<br />
the other receiving on port 10026 and forwarding to 10027.</p>
<pre>  $inet_socket_port = [10024,10026];  # listen on two ports
</pre>
<p>The 10024&gt;10025 path will be controlled by a default policy bank,<br />
the other (10026&gt;10027), dedicated to mail intended to be signed,<br />
will use a policy bank (arbitrarily) named ORIGINATING:</p>
<pre>  $forward_method = 'smtp:[127.0.0.1]:10025';  # MTA with non-signing service
  $notify_method  = 'smtp:[127.0.0.1]:10027';  # MTA with signing service

  # switch policy bank to 'ORIGINATING' for mail received on port 10026:
  $interface_policy{'10026'} = 'ORIGINATING';

  $policy_bank{'ORIGINATING'} = {  # mail originating from our users
    originating =&gt; 1,  # indicates client is ours, allows signing
    #
    # force MTA to convert mail to 7-bit before DKIM signing
    # to avoid later conversions which could destroy signature:
    smtpd_discard_ehlo_keywords =&gt; ['8BITMIME'],
    #
    # forward to a smtpd service providing DKIM signing service
    # (if using a signing milter instead of signing by amavisd):
    forward_method =&gt; 'smtp:[127.0.0.1]:10027',
    #
    # other special treatment of locally originating mail,
    # just some suggestions here:
    spam_admin_maps  =&gt; ["spamalert\@$mydomain"],  # warn of spam from us
    virus_admin_maps =&gt; ["virusalert\@$mydomain"],
    banned_filename_maps =&gt; ['ALT-RULES'],         # more relaxed rules
    spam_quarantine_cutoff_level_maps =&gt; undef,    # quarantine all spam
    spam_dsn_cutoff_level_maps =&gt; undef,
    spam_dsn_cutoff_level_bysender_maps =&gt; # bounce to local senders only
      [ { lc(".$mydomain") =&gt; undef,  '.' =&gt; 15 } ],
  };
</pre>
<p>The <tt>smtpd_discard_ehlo_keywords=&gt;['8BITMIME']</tt> serves<br />
to persuade Postfix to convert mail to 7-bit quoted-printable before<br />
submitting it to content filtering and signing. Avoiding 8-bit characters<br />
in mail body makes signatures less susceptible to breaking by some<br />
relaying or receiving MTA over which we have no control.<br />
The same effect (making Postfix convert outgoing mail to 7-bits<br />
before DKIM signing) could be achieved by a Postfix setting<br />
<tt>smtp_discard_ehlo_keywords=8bitmime</tt> on a smtp service<br />
feeding mail-to-be-signed to amavisd, but this would require setting<br />
up two such services, one with the option and one without.</p>
<p>Note that 8-bit to 7-bit conversion may break a S/MIME or PGP signature,<br />
so if mail signing is in use, it may not be desirable to let Postfix<br />
do the conversion, and it may be acceptable to take a risk that a remote<br />
MTA will clobber signatures if it decides the mail text is to be converted<br />
to 7-bits QP. The only reliable solution in this case is to configure<br />
MUA clients to stick to 7-bit characters/encodings before generating<br />
S/MIME or PGP signatures.</p>
<p>The following text from the Postfix documentation file MILTER_README<br />
<em>should be disregarded</em> &#8212; amavisd <em>is</em> 8-bit clean,<br />
and we do want Postfix to convert to 7-bits on the signing path<br />
but not on the other path:<br />
<span style="text-decoration:line-through;font-style:italic">Content<br />
filters may break domain key etc. signatures. If you use an SMTP-based<br />
content filter, then you should add a line to master.cf with<br />
&#8220;-o disable_mime_output_conversion=yes&#8221;, as described in the<br />
advanced content filter example.</span></p>
<p>While testing how the configured system plays with some mailing lists<br />
(such as <i>postfix-users</i> or SpamAssassin <i>users</i> list), one has<br />
to keep in mind that amavisd-new caches spam checking results of recently<br />
seen message bodies: a mail going out to a mailing list is not yet signed<br />
as it reaches a content filter, but the SpamAssassin verdict is remembered<br />
at that point (claiming the message is not signed). When this message<br />
with unchanged body comes back from a mailing list, this time signed<br />
in the header section by our domain, the signature should prove correct,<br />
yet the cached result from a minute ago still claims the message is not<br />
signed. If this is of concern, one can turn off caching of spam checking<br />
results for ham by setting:  <tt>$spam_check_negative_ttl = 0;</tt></p>
<p>While on the topic of providing multiple paths through amavisd,<br />
when one has to deal with a mailing list manager (e.g. Mailman) in the<br />
same setup, and re-signing of its fan-out mail is desired, it may be<br />
useful to add a third path through amavisd, this one stripped down to<br />
bare bones, providing only DKIM signing and nothing else (no virus or<br />
spam checks, no decoding), as these checks were already done once on<br />
mail before it reached a mailing list manager. Here is one possibility,<br />
accepting mail on port 10028 and sending it to 10025:</p>
<pre>  $inet_socket_port = [10024,10026,10028];

  $interface_policy{'10028'} = 'NOCHECKS';

  $policy_bank{'NOCHECKS'} = {  # no checks, just DKIM signing
    originating =&gt; 1,  # allows signing
    forward_method =&gt; 'smtp:[127.0.0.1]:10025',
    smtpd_greeting_banner =&gt;
      '${helo-name} ${protocol} ${product} NOCHECKS service ready',
    mynetworks_maps =&gt; [],  # avoids loading MYNETS policy unnecessarily
    os_fingerprint_method =&gt; undef,
    penpals_bonus_score =&gt; undef,
    bounce_killer_score =&gt; 0,
    bypass_decode_parts =&gt; 1,
    bypass_header_checks_maps =&gt; [1],
    bypass_virus_checks_maps  =&gt; [1],
    bypass_spam_checks_maps   =&gt; [1],
    bypass_banned_checks_maps =&gt; [1],
    spam_lovers_maps          =&gt; [1],
    banned_files_lovers_maps  =&gt; [1],
    archive_quarantine_to_maps =&gt; [],
    remove_existing_x_scanned_headers =&gt; undef,
    remove_existing_spam_headers =&gt; undef,
    signed_header_fields =&gt; { 'Sender' =&gt; 1 },
  };
</pre>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/setup-dkim-on-postfix-with-amavisd-new/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mod_php and suphp at same time</title>
		<link>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/</link>
		<comments>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:21:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=245</guid>
		<description><![CDATA[/etc/suphp.conf
[global]
  logfile=/var/log/httpd/suphp_log
  loglevel=warn
  webserver_user=apache
  docroot=/home
  env_path=/bin:/usr/bin
  umask=0077
  min_uid=500
  min_gid=500
; Security options
  allow_file_group_writeable=false
  allow_file_others_writeable=false
  allow_directory_group_writeable=false
  allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
  check_vhost_docroot=false
;Send minor error messages to browser
  errors_to_browser=true
[handlers]
  ;Handler for php-scripts
  ;x-httpd-php=php:/usr/bin/php
  x-httpd-php=&#34;php:/usr/bin/php-cgi&#34;
;Handler for CGI-scripts
  x-suphp-cgi=execute:!self

/etc/httpd/conf.d/su.php
# This is [...]]]></description>
			<content:encoded><![CDATA[<p>/etc/suphp.conf</p>
<h6>[global]<br />
  logfile=/var/log/httpd/suphp_log<br />
  loglevel=warn<br />
  webserver_user=apache<br />
  docroot=/home<br />
  env_path=/bin:/usr/bin<br />
  umask=0077<br />
  min_uid=500<br />
  min_gid=500<br />
; Security options<br />
  allow_file_group_writeable=false<br />
  allow_file_others_writeable=false<br />
  allow_directory_group_writeable=false<br />
  allow_directory_others_writeable=false<br />
;Check wheter script is within DOCUMENT_ROOT<br />
  check_vhost_docroot=false<br />
;Send minor error messages to browser<br />
  errors_to_browser=true<br />
[handlers]<br />
  ;Handler for php-scripts<br />
  ;x-httpd-php=php:/usr/bin/php<br />
  x-httpd-php=&quot;php:/usr/bin/php-cgi&quot;<br />
;Handler for CGI-scripts<br />
  x-suphp-cgi=execute:!self</h6>
</p>
<p>/etc/httpd/conf.d/su.php</p>
<h6># This is the Apache server configuration file providing suPHP support.<br />
  # It contains the configuration directives to instruct the server how to<br />
  # serve php pages while switching to the user context before rendering.<br />
LoadModule suphp_module modules/mod_suphp.so<br />
# This option tells mod_suphp if a PHP-script requested on this server (or<br />
  # VirtualHost) should be run with the PHP-interpreter or returned to the<br />
  # browser &quot;as it is&quot;.<br />
  #suPHP_Engine on<br />
# Disable php when suphp is used, to avoid having both.<br />
  #&lt;IfModule mod_php5.c&gt;<br />
  #php_admin_flag engine off<br />
  #&lt;/IfModule&gt;<br />
  #&lt;IfModule mod_php4.c&gt;<br />
  #php_admin_flag engine off<br />
  #&lt;/IfModule&gt;<br />
# To use suPHP to parse PHP-Files<br />
  #AddHandler x-httpd-php .php<br />
  #AddHandler x-httpd-php .php .php4 .php3 .phtml<br />
# This option tells mod_suphp which path to pass on to the PHP-interpreter<br />
  # (by setting the PHPRC environment variable).<br />
  # Do *NOT* refer to a file but to the directory the file resides in.<br />
  #<br />
  # E.g.: If you want to use &quot;/path/to/server/config/php.ini&quot;, use &quot;suPHP_Config<br />
  # /path/to/server/config&quot;.<br />
  #<br />
  # If you don&#8217;t use this option, PHP will use its compiled in default path.<br />
  # suPHP_ConfigPath /etc<br />
# If you compiled suphp with setid-mode &quot;force&quot; or &quot;paranoid&quot;, you can<br />
  # specify the user- and groupname to run PHP-scripts with.<br />
  # Example: suPHP_UserGroup foouser bargroup<br />
  # suPHP_UserGroup apache apache<br />
# This option tells mod_suphp to handle requests with the type &lt;mime-type&gt;.<br />
  # Please note this only works, if an action for the handler is specified<br />
  # in the suPHP configuration file.<br />
  #suPHP_AddHandler x-httpd-php<br />
# This option tells mod_suphp to NOT handle requests with the type &lt;mime-type&gt;.<br />
  # suPHP_RemoveHandler &lt;mime-type&gt;</h6>
</p>
<p>Usege example</p>
<h6>&lt;VirtualHost 192.168.1.10:80&gt;<br />
  SuexecUserGroup &quot;#500&quot; &quot;#500&quot;<br />
  ServerName example.com<br />
  ServerAlias www.example.com<br />
  DocumentRoot /home/example.com/public_html<br />
suPHP_Engine on<br />
  AddHandler x-httpd-php .php<br />
  AddHandler x-httpd-php .php .php4 .php3 .phtml<br />
  suPHP_AddHandler x-httpd-php<br />
  suPHP_UserGroup example.com example.com<br />
  &lt;Directory /home/example.com/public_html&gt;<br />
  allow from all<br />
  &lt;/Directory&gt;<br />
  DirectoryIndex index.htm index.html index.php<br />
  &lt;/VirtualHost&gt;<br /></h6></p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/mod_php-and-suphp-at-same-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>suPHP parents directory is not own by defined user or root</title>
		<link>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/</link>
		<comments>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:11:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[suphp]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=242</guid>
		<description><![CDATA[root at server1:/root/suPHP/suphp-0.6.3/src# diff -u ./Application.cpp
./Application.cpp-dist
&#8212; ./Application.cpp   2008-04-24 15:21:20.000000000 -0700
+++ ./Application.cpp-dist      2008-03-30 04:43:38.000000000 -0700
@@ -492,14 +492,12 @@
         directory = directory.getParentDirectory();
         UserInfo directoryOwner = directory.getUser();
-#ifndef OPT_USERGROUP_OWNER
        [...]]]></description>
			<content:encoded><![CDATA[<p>root at server1:/root/suPHP/suphp-0.6.3/src# diff -u ./Application.cpp<br />
./Application.cpp-dist<br />
&#8212; ./Application.cpp   2008-04-24 15:21:20.000000000 -0700<br />
+++ ./Application.cpp-dist      2008-03-30 04:43:38.000000000 -0700<br />
@@ -492,14 +492,12 @@<br />
         directory = directory.getParentDirectory();</p>
<p>         UserInfo directoryOwner = directory.getUser();<br />
-#ifndef OPT_USERGROUP_OWNER<br />
         if (directoryOwner != owner &#038;&#038; !directoryOwner.isSuperUser()) {<br />
             std::string error = &#8220;Directory &#8221; + directory.getPath()<br />
                 + &#8221; is not owned by &#8221; + owner.getUsername();<br />
             logger.logWarning(error);<br />
             throw SoftException(error, __FILE__, __LINE__);<br />
         }<br />
-#endif</p>
<p>         if (!directory.isSymlink()<br />
             &#038;&#038; !config.getAllowDirectoryGroupWriteable()</p>
<p>Originally found at https://lists.marsching.com/pipermail/suphp/2008-April/001831.html</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/suphp-parents-directory-is-not-own-by-defined-user-or-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install SSL certificate on postfix and dovecot</title>
		<link>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/</link>
		<comments>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 05:07:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=238</guid>
		<description><![CDATA[Make key file
#openssl genrsa -des3 -out example.com.key 1024
Generating RSA private key, 1024 bit long modulus
&#8230;&#8230;&#8230;&#8230;..++++++
..++++++
e is 65537 (0&#215;10001)
Enter pass phrase for example.com.key:
Verifying &#8211; Enter pass phrase for example.com.key:
# openssl req -new -key example.com.key -out example.com.csr
Enter pass phrase for example.com.key:
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name [...]]]></description>
			<content:encoded><![CDATA[<p>Make key file</p>
<h6>#openssl genrsa -des3 -out example.com.key 1024</p>
<p>Generating RSA private key, 1024 bit long modulus</p>
<p>&#8230;&#8230;&#8230;&#8230;..++++++</p>
<p>..++++++</p>
<p>e is 65537 (0&#215;10001)</p>
<p>Enter pass phrase for example.com.key:</p>
<p>Verifying &#8211; Enter pass phrase for example.com.key:</p>
<p># openssl req -new -key example.com.key -out example.com.csr</p>
<p>Enter pass phrase for example.com.key:</p>
<p>Country Name (2 letter code) [AU]:</p>
<p>State or Province Name (full name) [Some-State]:</p>
<p>Locality Name (eg, city) []:</p>
<p>Organization Name (eg, company) [Internet Widgits Pty Ltd]:</p>
<p>Organizational Unit Name (eg, section) []:</p>
<p>Common Name (eg, YOUR name) []:</p>
<p>Email Address []:</p>
<p>A challenge password []:</p>
<p>An optional company name []:</h6>
<p>Get CRT (GeoTrust, verisign etc)</p>
<p>Remove pass phrase</p>
<h6>#openssl rsa -in example.com.key -out example.com.pem</h6>
<p>edit /etc/postfix/main.cf</p>
<h6>
smtpd_use_tls = yes<br />
smtpd_tls_session_cache_timeout = 3600s<br />
smtpd_tls_key_file = /etc/pki/tls/certs/example.com.pem<br />
smtpd_tls_cert_file = /etc/pki/tls/certs/example.com.crt</h6>
<p>edit /etc/dovecot.conf</p>
<h6>ssl_disable = no</p>
<p>ssl_cert_file = /etc/pki/tls/certs/stargatesys.com.crt</p>
<p>ssl_key_file = /etc/pki/tls/certs/stargatesys.com.pem</h6>
<p>restart postfix and dovecot</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2010/03/11/install-ssl-certificate-on-postfix-and-dovecot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinstall yum package</title>
		<link>http://takahisa.info/2009/06/10/reinstall-yum-package/</link>
		<comments>http://takahisa.info/2009/06/10/reinstall-yum-package/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 04:27:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=232</guid>
		<description><![CDATA[as you might know, yum does not provide re-install functionality,
for re-installing yum installed application following methods may useful
yum install yum-utils
yumdownloader package
rpm -Uvh &#8211;force downloadedpackages
]]></description>
			<content:encoded><![CDATA[<p>as you might know, yum does not provide re-install functionality,</p>
<p>for re-installing yum installed application following methods may useful</p>
<h6>yum install yum-utils<br />
yumdownloader package<br />
rpm -Uvh &#8211;force downloadedpackages</h6>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/06/10/reinstall-yum-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Mobile htaccess for japan region</title>
		<link>http://takahisa.info/2009/06/10/google-mobile-htaccess-for-japan-region/</link>
		<comments>http://takahisa.info/2009/06/10/google-mobile-htaccess-for-japan-region/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 04:22:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=230</guid>
		<description><![CDATA[RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^DoCoMo.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^KDDI.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Vodafone.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^SoftBank.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^J-PHONE.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.+DDIPOCKET.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.+WILLCOM.*
RewriteRule ^$ http://www.google.com/gwt/n?u=http://www.example.com [R,L]
]]></description>
			<content:encoded><![CDATA[<p>RewriteEngine on</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^DoCoMo.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^KDDI.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^Vodafone.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^SoftBank.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^J-PHONE.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^Mozilla.+DDIPOCKET.* [OR]</p>
<p>RewriteCond %{HTTP_USER_AGENT} ^Mozilla.+WILLCOM.*</p>
<p>RewriteRule ^$ http://www.google.com/gwt/n?u=http://www.example.com [R,L]</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/06/10/google-mobile-htaccess-for-japan-region/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>automated network folder mount script for mac</title>
		<link>http://takahisa.info/2009/03/14/automated-network-folder-mount-script-for-mac/</link>
		<comments>http://takahisa.info/2009/03/14/automated-network-folder-mount-script-for-mac/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 01:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=224</guid>
		<description><![CDATA[set myip to do shell script &#8220;ifconfig &#124; grep &#8216;broadcast&#8217; &#124; awk &#8216;{print $6}&#8217;&#8221;
if myip = &#8220;10.168.1.255&#8243; then
mount volume &#8220;smb://workgroup;username:password@10.168.1.254/path/&#8221;
else
display dialog &#8220;Not able to connect server&#8221; buttons {&#8220;ok&#8221;} default button &#8220;ok&#8221;
end if

]]></description>
			<content:encoded><![CDATA[<p>set myip to do shell script &#8220;ifconfig | grep &#8216;broadcast&#8217; | awk &#8216;{print $6}&#8217;&#8221;<br />
if myip = &#8220;10.168.1.255&#8243; then<br />
mount volume &#8220;smb://workgroup;username:password@10.168.1.254/path/&#8221;<br />
else<br />
display dialog &#8220;Not able to connect server&#8221; buttons {&#8220;ok&#8221;} default button &#8220;ok&#8221;<br />
end if</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/03/14/automated-network-folder-mount-script-for-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>adding a startup script ubuntu</title>
		<link>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/</link>
		<comments>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 01:28:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=221</guid>
		<description><![CDATA[update-rc.d foo defaults
you also need script be executable
chmod +x foo
]]></description>
			<content:encoded><![CDATA[<p>update-rc.d foo defaults</p>
<p>you also need script be executable<br />
chmod +x foo</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/03/14/adding-a-startup-script-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>install webmin on ubuntu</title>
		<link>http://takahisa.info/2009/03/14/install-webmin-on-ubuntu/</link>
		<comments>http://takahisa.info/2009/03/14/install-webmin-on-ubuntu/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 01:26:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://takahisa.info/?p=219</guid>
		<description><![CDATA[$ sudo dpkg -i webmin_1.420_all.deb
$ sudo apt-get -f install
]]></description>
			<content:encoded><![CDATA[<p>$ sudo dpkg -i webmin_1.420_all.deb<br />
$ sudo apt-get -f install</p>
]]></content:encoded>
			<wfw:commentRss>http://takahisa.info/2009/03/14/install-webmin-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
