https://mailutils.org/usqay/index.php?title=Mailutils_dbm&feed=atom&action=historyMailutils dbm - Revision history2024-03-28T11:21:43ZRevision history for this page on the wikiMediaWiki 1.35.13https://mailutils.org/usqay/index.php?title=Mailutils_dbm&diff=480&oldid=prevGray: /* Dump Formats */2018-04-18T10:31:06Z<p><span dir="auto"><span class="autocomment">Dump Formats</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:31, 18 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l109" >Line 109:</td>
<td colspan="2" class="diff-lineno">Line 109:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''version 0.0''' format is suitable for databases whose records contain only ASCII data. In this format, each record occupies a separate line, which consists of the key and value separated by one or more whitespace characters. Empty lines are ignored. For example:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The '''version 0.0''' format is suitable for databases whose records contain only ASCII data. In this format, each record occupies a separate line, which consists of the key and value separated by one or more whitespace characters. Empty lines are ignored. For example:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $ mailutils list /etc/mail/users.db</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $ mailutils <ins class="diffchange diffchange-inline">dbm </ins>list /etc/mail/users.db</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> root guessme</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> root guessme</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> smith pAssword</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> smith pAssword</div></td></tr>
</table>Grayhttps://mailutils.org/usqay/index.php?title=Mailutils_dbm&diff=479&oldid=prevGray: /* Dump Formats */2018-04-18T10:30:40Z<p><span dir="auto"><span class="autocomment">Dump Formats</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:30, 18 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l136" >Line 136:</td>
<td colspan="2" class="diff-lineno">Line 136:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Following this header are actual data. Each record is output in two parts: key and value. Each part begins with a '''#:len=''n''''' construct on a line by itself, where '''''n''''' is the length of the data in decimal. This line is followed by one or more lines of the actual data, encoded in [[Base64 (filter)|base64]]. The data are formatted so that each line does not exceed 76 bytes in length (not counting the terminating newline). An example of this format follows:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Following this header are actual data. Each record is output in two parts: key and value. Each part begins with a '''#:len=''n''''' construct on a line by itself, where '''''n''''' is the length of the data in decimal. This line is followed by one or more lines of the actual data, encoded in [[Base64 (filter)|base64]]. The data are formatted so that each line does not exceed 76 bytes in length (not counting the terminating newline). An example of this format follows:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><nowiki></del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins># Database dump file created by GNU Mailutils 2.99.93 on Tue Nov 1 13:28:03 2011</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div># Database dump file created by GNU Mailutils 2.99.93 on Tue Nov 1 13:28:03 2011</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:version=1.0</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:version=1.0</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:file=users.db</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:file=users.db</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:uid=0,user=root,gid=25,group=mail,mode=640</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:uid=0,user=root,gid=25,group=mail,mode=640</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=6</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=6</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>c21pdGgA</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>c21pdGgA</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=9</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=9</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>cEFzc3dvcmQA</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>cEFzc3dvcmQA</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=5</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=5</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>cm9vdAA=</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>cm9vdAA=</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=8</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=8</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>Z3Vlc3NtZQA=</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Z3Vlc3NtZQA=</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=4</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=4</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>cWVkAA==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>cWVkAA==</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:len=7</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:len=7</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>Zm9vQmFyAA==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Zm9vQmFyAA==</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"></nowiki></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div id="Format C"></div></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><div id="Format C"></div></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l160" >Line 160:</td>
<td colspan="2" class="diff-lineno">Line 159:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>An example dump in this format follows:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>An example dump in this format follows:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"><nowiki></del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins># Database dump file created by GNU Mailutils 2.99.95 on Sun Nov 27 02:12:13 2011</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div># Database dump file created by GNU Mailutils 2.99.95 on Sun Nov 27 02:12:13 2011</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:version=C</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:version=C</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:file=users.db</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:file=users.db</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>#:uid=1000,user=gray,gid=100,group=users,mode=600</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#:uid=1000,user=gray,gid=100,group=users,mode=600</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>smith\000</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>smith\000</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> </ins>pAssword\000</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>pAssword<del class="diffchange diffchange-inline">\000</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">root\000</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">guessme</del>\000</div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">qed</del>\000</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> root</ins>\000</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">fooBar</del>\000</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> guessme</ins>\000</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"></nowiki></del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> qed\000</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> fooBar\000</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Exit Codes ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Exit Codes ==</div></td></tr>
</table>Grayhttps://mailutils.org/usqay/index.php?title=Mailutils_dbm&diff=406&oldid=prevGray: Created page with "The <tt>mailutils dbm</tt> tool manages DBM files using libmu_dbm. The invocation syntax is: mailutils dbm ''command'' [''options''] ''file'' [''keys''] or mailutils db..."2015-07-11T11:03:56Z<p>Created page with "The <tt>mailutils dbm</tt> tool manages DBM files using <a href="/wiki/Libmu_dbm" title="Libmu dbm">libmu_dbm</a>. The invocation syntax is: mailutils dbm ''command'' [''options''] ''file'' [''keys''] or mailutils db..."</p>
<p><b>New page</b></p><div>The <tt>mailutils dbm</tt> tool manages DBM files using [[libmu_dbm]]. The invocation syntax is:<br />
<br />
mailutils dbm ''command'' [''options''] ''file'' [''keys'']<br />
or<br />
mailutils dbm [''options''] ''command'' ''file'' [''keys'']<br />
<br />
where ''command'' selects the operation mode, ''options'' modify the tool behavior and ''file'' specifies the DBM file to operate upon. Some ''command''s allow for optional ''keys'' to be specified.<br />
<br />
The ''file'' argument can be either a DBM file name or a [[Database URL]]. <br />
<br />
== Create a Database ==<br />
The <tt>create</tt> command and its synonym <tt>load</tt> instruct the tool to create a new database:<br />
<br />
mailutils dbm create file.db<br />
<br />
If the argument file already exists, it will be truncated prior to adding new records to it.<br />
<br />
The data to populate the database with are read from the standard input. The <tt>dbm</tt> tool supports several formats for these data, which are [[#Dump Formats|discussed later]]. In the simplest case (a so called ''format 0.0'') each input line must consist of two fields separated by any amount of whitespace. The first field is treated as a key and the second one as the corresponding value.<br />
<br />
The usual way to read data from a file is, of course, by redirecting the file to the standard input as in:<br />
<br />
mailutils dbm create file.db < input.txt<br />
<br />
There is also a special option for that purpose: <tt>--file</tt> (<tt>-f</tt>). Thus, the following command is equivalent to the one above:<br />
<br />
mailutils dbm create --file input.txt file.db <br />
<br />
The <tt>--file</tt> option has the advantage that it allows, in conjunction with another options, for copying input file metadata (owner UID, GID and file mode) to the created database. For example, the following command ensures that the created database file will have the same metadata as the input file:<br />
<br />
mailutils dbm create --file input.txt --copy-permissions file.db<br />
<br />
The <tt>--copy-permissions</tt> (<tt>-P</tt>) option is the one that does the job.<br />
<br />
There are also other ways to control mode and ownership of the created database, which are [[#options|described below]].<br />
<br />
More advanced dump formats (e.g. [[#Format 1.0|1.0]]) carry additional information about the file, including its original name, ownership and mode. If input is in one of these formats, the file name argument becomes optional. If it is not supplied, the name stored in the input stream will be used. For example, supposing that the file <tt>users.dump</tt> is in format 1.0, the following command suffices to restore the original filename, ownership, mode and, of course, data:<br />
<br />
mailutils dbm create --file users.dump<br />
<br />
== Add Records to a Database ==<br />
The <tt>add</tt> command adds records to a database. Records are read from the standard input and must be formatted as for <tt>create</tt> command.<br />
<br />
mailutils dbm add file.db<br />
<br />
If the argument file does not exist, it will be created. <br />
<br />
Adding a record with a key which is already present in the database produces an error. To replace existing records, use the <tt>replace</tt> command instead. <br />
<br />
The same options that affect the behavior of <tt>create</tt> apply to <tt>add</tt> and <tt>replace</tt> as well, e.g.:<br />
<br />
mailutils dbm replace --file input.txt --copy-permissions file.db<br />
<br />
== Delete Records ==<br />
To delete records, use the <tt>delete</tt> command. It reads a list of keys to delete to be specified as arguments in the command line:<br />
<br />
mailutils dbm delete file.db foo bar<br />
<br />
The command above will delete from <tt>file.db</tt> records with keys <tt>foo</tt> and <tt>bar</tt>. <br />
<br />
It is not an error to attempt to delete a key that does not exist in the database, although such use will produce a warning message.<br />
<br />
By default, keys are matched literally. It is also possible to use various pattern matching techniques, depending on the option specified.<br />
<br />
<div id="patterns"></div><br />
The <tt>--glob</tt> (<tt>-G</tt>) option instructs the tool to use UNIX globbing pattern matching. For example, the command below will delete all keys starting with <tt>foo</tt> and ending with a decimal digit:<br />
<br />
mailutils dbm delete file.db 'foo*[0-9]'<br />
<br />
(note the quoting necessary to prevent shell from interpreting the metacharacters itself).<br />
<br />
Another option, <tt>--regex</tt> (<tt>-R</tt>) instructs <tt>mailutils</tt> to treat keys as extended regular expressions:<br />
<br />
mailutils dbm delete --regex file.db 'foo.*[0-9]{1,3}'<br />
<br />
Both options are affected by the <tt>--ignore-case</tt> (<tt>-i</tt>) option, which turns on case-insensitive matching.<br />
<br />
Using pattern matching to delete records can be a risky operation as selecting a wrong pattern will lead to removing wrong records. It is recommended to first use the [[#List the Database|list mode]] described below to verify that the patterns match the right keys.<br />
<br />
== List the Database ==<br />
The <tt>list</tt> command lists the content of the database:<br />
<br />
mailutils dbm list file.db<br />
<br />
By default, entire content is listed on the standard output in [[#Format 0.0|format 0.0]].<br />
<br />
If supplied more than one command line argument, this mode treats the rest of arguments after the database file name as the keys to look for and lists only records with these keys:<br />
<br />
$ mailutils dbm list file.db foo bar<br />
foo 1<br />
bar 56<br />
<br />
The <tt>--glob</tt> and <tt>--regex</tt> options instruct the tool to use UNIX globbing or extended regular expression matching, correspondingly. These are described in detail [[#patterns|above]].<br />
<br />
== Dump the Database ==<br />
The <tt>dump</tt> subcommand dumps the database to the standard output in a format suitable for backup or sending over the network (a [[#Format 1.0|version 1.0]] format).<br />
<br />
mailutils dbm dump file.db > file.dump<br />
<br />
The produced file is suitable for input to the <tt>create</tt> (<tt>load</tt>) command. Among other uses, this provides for an easy way to convert databases between various formats supported by Mailutils. For example this is how to convert the database file ''file.db'' to the GDBM database ''new.db'':<br />
<br />
mailutils dbm dump file.db | mailutils dbm create gdbm://new.db<br />
<br />
Both <tt>list</tt> and <tt>dump</tt> subcommands share the same set of options. In fact, they are pretty similar, except that use different defaults. The <tt>list</tt> subcommand is oriented to produce a human-readable output, whereas the <tt>dump</tt> subcommand is oriented towards backup purposes.<br />
<br />
== Dump Formats ==<br />
As of version 2.99.99, <tt>mailutils dbm</tt> supports three formats for dumping DBM databases. All three are line-oriented. Comments are introduced with a sharp (''#'') sign in the column 0 of a line, followed by at least one white space character (space or tab). Sharp sign followed by a colon (''#:'') introduces a ''pragmatic comment'', which carries some additional information to the loader.<br />
<br />
<div id="Format 0.0"></div><br />
The '''version 0.0''' format is suitable for databases whose records contain only ASCII data. In this format, each record occupies a separate line, which consists of the key and value separated by one or more whitespace characters. Empty lines are ignored. For example:<br />
<br />
$ mailutils list /etc/mail/users.db<br />
root guessme<br />
smith pAssword<br />
qed fooBar<br />
<br />
Output in version 0.0 format is human readable and can be used as input to the [[popauth]] utility. However, version 0.0 has serious drawbacks. First of all, it is not suitable for databases that contain binary data. Secondly, it cannot properly handle keys beginning with a sharp sign or containing whitespace characters. The version 1.0 format is free from these drawbacks.<br />
<br />
<div id="Format 1.0"></div><br />
The '''version 1.0''' format begins with a ''header'' containing important information about the file, such as its file name, ownership and file mode. This information is stored in pragmatic comments and allows <tt>mailutils dbm load</tt> to easily recreate an exact copy of the file. The following comments are defined:<br />
<br />
;<nowiki>#:version=1.0</nowiki><br />
:Indicates that the data that follow are in version 1.0 format.<br />
;<nowiki>#:filename=</nowiki>''s''<br />
:Original database file name, without directory parts.<br />
;<nowiki>#:uid=</nowiki>''n''<br />
:Owner UID.<br />
;<nowiki>#:user=</nowiki>''s''<br />
:Owner name.<br />
;<nowiki>#:gid=</nowiki>''n''<br />
:Owner GID<br />
;<nowiki>#:group=</nowiki>''s''<br />
:Owner group name.<br />
;<nowiki>#:mode=</nowiki>''o''<br />
:File mode in octal<br />
<br />
Following this header are actual data. Each record is output in two parts: key and value. Each part begins with a '''#:len=''n''''' construct on a line by itself, where '''''n''''' is the length of the data in decimal. This line is followed by one or more lines of the actual data, encoded in [[Base64 (filter)|base64]]. The data are formatted so that each line does not exceed 76 bytes in length (not counting the terminating newline). An example of this format follows:<br />
<br />
<nowiki><br />
# Database dump file created by GNU Mailutils 2.99.93 on Tue Nov 1 13:28:03 2011<br />
#:version=1.0<br />
#:file=users.db<br />
#:uid=0,user=root,gid=25,group=mail,mode=640<br />
#:len=6<br />
c21pdGgA<br />
#:len=9<br />
cEFzc3dvcmQA<br />
#:len=5<br />
cm9vdAA=<br />
#:len=8<br />
Z3Vlc3NtZQA=<br />
#:len=4<br />
cWVkAA==<br />
#:len=7<br />
Zm9vQmFyAA==<br />
</nowiki><br />
<br />
<div id="Format C"></div><br />
The third format called <tt>C</tt> is designed to allow programmers to create input data for <tt>mailutils load</tt> using conventional means. This format represents both key and content as C strings (hence its name), with usual C (literal and octal) escapes to represent non-printable characters. Records are separated with a single newline character. <br />
<br />
An example dump in this format follows:<br />
<br />
<nowiki><br />
# Database dump file created by GNU Mailutils 2.99.95 on Sun Nov 27 02:12:13 2011<br />
#:version=C<br />
#:file=users.db<br />
#:uid=1000,user=gray,gid=100,group=users,mode=600<br />
smith\000<br />
pAssword\000<br />
<br />
root\000<br />
guessme\000<br />
<br />
qed\000<br />
fooBar\000<br />
<br />
</nowiki><br />
<br />
== Exit Codes ==<br />
The table below summarizes exit codes used by <tt>mailutils dbm</tt>:<br />
<br />
{| style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"<br />
! style="border-style: solid; border-width: 1px"|Code<br />
! style="border-style: solid; border-width: 1px"|Symbolic name<br />
! style="border-style: solid; border-width: 1px"|Meaning<br />
|-<br />
| style="border-style: solid; border-width: 1px"|0<br />
| style="border-style: solid; border-width: 1px"|EX_OK<br />
| style="border-style: solid; border-width: 1px"|Successful termination<br />
|-<br />
| style="border-style: solid; border-width: 1px"|64<br />
| style="border-style: solid; border-width: 1px"|EX_USAGE<br />
| style="border-style: solid; border-width: 1px"|Command line usage error<br />
|-<br />
| style="border-style: solid; border-width: 1px"|65<br />
| style="border-style: solid; border-width: 1px"|EX_DATAERR<br />
| style="border-style: solid; border-width: 1px"|Error in user-supplied data: the input file is badly formatted, or some of the data supplied in the command line are invalid (e.g. user name, uid or the like), etc.<br />
|-<br />
| style="border-style: solid; border-width: 1px"|66<br />
| style="border-style: solid; border-width: 1px"|EX_NOINPUT<br />
| style="border-style: solid; border-width: 1px"|Cannot open input file<br />
|-<br />
| style="border-style: solid; border-width: 1px"|67<br />
| style="border-style: solid; border-width: 1px"|EX_NOUSER<br />
| style="border-style: solid; border-width: 1px"|No such user or UID when trying to set output file ownership<br />
|-<br />
| style="border-style: solid; border-width: 1px"|69<br />
| style="border-style: solid; border-width: 1px"|EX_UNAVAILABLE<br />
| style="border-style: solid; border-width: 1px"|Operation cannot be performed due to some kind of problem (e.g. access to the file denied, etc.)<br />
|-<br />
| style="border-style: solid; border-width: 1px"|70<br />
| style="border-style: solid; border-width: 1px"|EX_SOFTWARE<br />
| style="border-style: solid; border-width: 1px"|Internal software error<br />
|-<br />
| style="border-style: solid; border-width: 1px"|74<br />
| style="border-style: solid; border-width: 1px"|EX_IOERR<br />
| style="border-style: solid; border-width: 1px"|Input/output error<br />
|}<br />
<br />
== See also ==<br />
* [[mailutils (utility)]]<br />
<br />
[[Category:utilities]]</div>Gray