<?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>Application Archives - ITEC4B</title>
	<atom:link href="https://itec4b.com/category/application/feed/" rel="self" type="application/rss+xml" />
	<link>https://itec4b.com/category/application/</link>
	<description>Information Technology Expert Consulting</description>
	<lastBuildDate>Thu, 02 Mar 2023 18:56:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.3</generator>
	<item>
		<title>rsync: Remote Synchronization</title>
		<link>https://itec4b.com/rsync-remote-synchronization/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Thu, 02 Mar 2023 12:44:17 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Data Transfer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[data transfer]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=989</guid>

					<description><![CDATA[rsync is a complete and powerful open source utility that provides fast incremental files transfer.It efficiently transfers and synchronizes files/directories between storage drive(s) and across networked hosts. It was created in 1996 by Andrew Tridgell and Paul Mackerras.It is currently maintained by Wayne Davison. rsync is freely available under the GNU General Public License.rsync source &#8230; <p class="link-more"><a href="https://itec4b.com/rsync-remote-synchronization/" class="more-link">Read more<span class="screen-reader-text"> "rsync: Remote Synchronization"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p><span style="text-decoration: underline;"><strong><a href="https://rsync.samba.org">rsync</a> is a complete and powerful open source utility that provides fast incremental files transfer</strong></span>.<br>It efficiently transfers and synchronizes files/directories between storage drive(s) and across networked hosts.</p>



<p>It was created in 1996 by Andrew Tridgell and Paul Mackerras.<br>It is currently maintained by Wayne Davison.<br><br>rsync is freely available under the GNU General Public License.<br><a href="https://git.samba.org/?p=rsync.git;a=tree">rsync source code is here</a> <br><br>The rsync algorithm is a type of delta encoding, and is used for minimizing network usage.<br><span style="text-decoration: underline;"><strong>It efficiently computes/identify which parts (splitted blocks by <strong>fragmentation</strong>) of a source file match some part of an existing destination file (those parts don&#8217;t need to be sent across the communication link), thus minimizing the amount of data to transfer by only moving the portions of files that have changed</strong></span>.<br><br>For further speed improvements, the data sent to the receiver can be compressed using any of the supported algorithms.<br><br><strong>ssh is the default remote shell for rsync since <a href="https://download.samba.org/pub/rsync/NEWS#2.6.0">version 2.6.0 (January 1st 2004)</a></strong></p>



<pre class="wp-block-code"><code>Install rsync (Debian)
# apt install rsync

rsync version
$ rsync -V</code></pre>



<h2>Usage</h2>



<p><strong><span style="text-decoration: underline;">Local SRC &gt; Local DST</span></strong><br><code>rsync [OPTIONS] SRC [DST]</code></p>



<p><strong><span style="text-decoration: underline;">Push (Local SRC > Remote DST)</span></strong> <code>rsync [OPTIONS] SRC [USER@]HOST:DST</code><br><strong><span style="text-decoration: underline;">Pull (Local DST &lt; Remote SRC)</span></strong> <code>rsync [OPTIONS] [USER@]HOST:SRC [DST]</code><br><br>Usages with just one SRC arg and no DST arg will list the source files instead of copying:<br><code><strong>&lt;type>&lt;perms_rwx> &lt;size_bytes> &lt;mtime YYYY/MM/DD> &lt;mtime hh:mm:ss> &lt;relative_path></strong></code><br><br><strong><span style="text-decoration: underline;">IMPORTANT: rsync must be installed on both the source and destination machines</span></strong><br><br>If you still has this error:<br><code>rsync: command not found<br>rsync: connection unexpectedly closed (0 bytes received so far) [sender]<br>rsync error: error in rsync protocol data stream ...</code><br><br>It means Local rsync cannot find the remote rsync executable.<br>In this case you need to know the path of the remote host&#8217;s rsync binary and make it part of the command with <code><strong>--rsync-path=/path/to/remote/rsync</strong></code></p>



<pre class="wp-block-code"><code>$ which rsync
/usr/bin/rsync  (Debian)</code></pre>



<h2>Options</h2>



<p><span style="text-decoration: underline;"><strong>If <code>--delete </code>option is specified, rsync will identify the files NOT present on the sender and delete them on the receiver</strong></span>. This option can be dangerous if used incorrectly! It is recommended to do a simulation run before, using the <code><strong>--dry-run</strong></code> option (<code><strong>-n</strong></code>) to find out which files are going to be deleted.<br><br>Each file from the list generated by rsync will be checked to see if it can be skipped.<br><span style="text-decoration: underline;"><strong>In the most common mode of operation, files are not skipped if the modification time or size differs</strong></span>.</p>



<p>rsync performs a slower but comprehensive check if invoked with <code><strong>--checksum</strong></code> option.<br>This forces a full checksum comparison on every file present on both systems.<br><br><code><span style="text-decoration: underline;"><strong>--checksum, -c</strong></span></code><br><strong><span style="text-decoration: underline;">Skip files based on checksum, not mtime AND size</span></strong>.<br>This changes the way rsync checks if the files have been changed and are in need of a transfer.<br>Without this option, rsync uses a &#8220;quick check&#8221; that (by default) checks if each file&#8217; size and time of last modification match between the sender and receiver.<br>This option changes this to compare a 128-bit checksum for each file that has a matching size.<br>Generating the checksums means that both sides will expend a lot of disk I/O reading all the data in the files in the transfer, so this can slow things down significantly (and this is prior to any reading that will be done to transfer changed files)</p>



<p><code><strong><span style="text-decoration: underline;">--human-readable, -h</span></strong></code><br>Output numbers in a more human-readable format.<br>Unit letters: K (Kilo), M (Mega), G (Giga), T (Tera), or P (Peta).</p>



<p><strong><span style="text-decoration: underline;"><code>--dry-run, -n</code></span></strong><br>Simulation run (no changes made)</p>



<p><code><strong><span style="text-decoration: underline;">--verbose, -v</span></strong></code><br>Increases the amount of information you are given during the transfer.<br>By default, rsync works silently.<br>A single -v will give you information about what files are being transferred and a brief summary at the end.<br>Two -v options will give you information on what files are being skipped and slightly more information at the end.<br>More than two -v options should only be used if you are debugging rsync.</p>



<p><code><strong><span style="text-decoration: underline;">--quiet, -q</span></strong></code><br>Decreases the amount of information you are given during the transfer, notably suppressing information messages from the remote server. This option is useful when invoking rsync from cron.</p>



<p><strong><span style="text-decoration: underline;"><code>--info=FLAGS</code></span></strong><br>Choose the information output<br>An individual flag name may be followed by a level number, with 0 meaning to silence that output, 1 being the default output level, and higher numbers increasing the output of that flag (for those that support higher levels).<br><code>$ rsync --info=help</code><br><code>$ <strong>rsync -av --info=progress2 SRC/ DST/</strong></code></p>



<p><span style="text-decoration: underline;"><code><strong>--progress</strong></code></span><br>Print information showing the progress of the transfer.<br>This is the same as specifying <code>'<strong>--info=flist2,name,progress</strong>'</code> but any user-supplied settings for those info flags takes precedence (e.g. <code>--info=flist0 --progress</code>).</p>



<p>While rsync is transferring a regular file, it updates a progress line that looks like this:<br><code><strong>&lt;reconstructed_bytes&gt; &lt;%_current_file&gt; &lt;throughput/sec&gt; &lt;remaining_time&gt;</strong></code></p>



<p>When the file transfer is done, rsync replaces the progress line with a summary line that looks like this:<br><code><strong>&lt;filesize_bytes&gt; 100% &lt;throughput/sec&gt; &lt;elapsed_time&gt; (xfr#?, to-chk=???/N)</strong></code><br>where ? is the nth transfer, ??? is the remaining files for the receiver to check (to see if they are uptodate or not)<br><br>In an incremental recursion scan (<code><strong>--recursive</strong></code>), rsync doesn&#8217;t know the total number of files in the files list until it reaches the end of the scan. Since it starts transfering files during the scan, it displays a line with the text &#8220;ir-chk&#8221; (for incremental recursion check) instead of &#8220;to-chk&#8221; until it knows the full size of the list, at which point it switches to &#8220;to-chk&#8221;. &#8220;ir-chk&#8221; lets you know that the number of files in the files list is still going to increase.</p>



<p><strong><span style="text-decoration: underline;"><code>--archive, -a</code></span></strong><br><strong>It is equivalent to <code>-rlptgoD</code></strong><br>This is a quick way of saying you want recursion and want to preserve almost everything.<br><span style="text-decoration: underline;"><strong>Be aware that it does not include preserving ACLs (<code>-A</code>), xattrs (<code>-X</code>), atimes (<code>-U</code>), crtimes (<code>-N</code>), nor the finding and preserving of hardlinks (<code>-H</code>)</strong></span>.<br>The only exception to the above equivalence is when <code>--files-from</code> is specified, in which case <code>-r</code> is not implied.</p>



<p><strong><span style="text-decoration: underline;"><code>--recursive, -r</code></span></strong><br>This tells rsync to copy directories recursively. See also <code>--dirs</code> (<code>-d</code>).<br>Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and <span style="text-decoration: underline;"><strong>begins the transfer after the scanning of the first few directories have been completed</strong></span>.<br>It is only possible when both ends of the transfer are at least version 3.0.0.<br><br><span style="text-decoration: underline;">Some options require rsync to know the full files list, these options disable the incremental recursion mode.<br>These include: <code>--delete-before</code>, <code>--delete-after</code>, <code>--prune-empty-dirs</code>, and <code>--delay-updates</code></span>.</p>



<p>Because of this, <strong><span style="text-decoration: underline;">the default delete mode when you specify <code>--delete</code> is now <code>--delete-during</code> when both ends of the connection are at least 3.0.0</span></strong> (use <code>--del</code> or <code>--delete-during</code> to request this improved deletion mode explicitly).<br>See also the &#8211;delete-delay option that is a better choice than using &#8211;delete-after.</p>



<p>Incremental recursion can be disabled using the <code>--no-inc-recursive</code> option or its shorter <code>--no-i-r </code>alias.</p>



<p><strong><code><span style="text-decoration: underline;">--delete-during, --del</span></code></strong><br>Request that the file deletions on the receiving side be done incrementally as the transfer happens.<br>The per-directory delete scan is done right before each directory is checked for updates, so it behaves like a more efficient <code>--delete-before</code>. This option was first added in rsync version 2.6.4. See <code>--delete</code> (which is implied) for more details on file deletion.</p>



<p><strong><code><span style="text-decoration: underline;">--delete-before</span></code></strong><br>Request that the file deletions on the receiving side be done before the transfer starts.<br>It does imply a delay before the start of the transfer, and this delay might cause the transfer to timeout (if <code>--timeout</code> was specified). It also forces rsync to use the old, non-incremental recursion algorithm that requires rsync to scan all the files in the transfer into memory at once (see <code>--recursive</code>).</p>



<p><strong><span style="text-decoration: underline;"><code>--delete-after</code></span></strong><br>Request that the file deletions on the receiving side be done after the transfer has completed.<br><span style="text-decoration: underline;">Important: this option forces rsync to use the old, non-incremental recursion algorithm that requires rsync to scan all the files in the transfer into memory at once (see <code>--recursive</code>)</span>. Use <code>--delete-delay</code> instead.</p>



<p><code><strong><span style="text-decoration: underline;">--delete-delay</span></strong></code><br>Request that the file deletions on the receiving side be computed during the transfer (like &#8211;delete-during), but removed after the transfer completes. <span style="text-decoration: underline;">This is more efficient than using <code>--delete-after</code></span>.<br>If the number of removed files overflows an internal buffer, a temporary file will be created on the receiving side to hold the names. If the creation of the temporary file fails, rsync will try to fall back to using <code>--delete-after</code> (which it cannot do if <code>--recursive</code> is doing an incremental scan).</p>



<p><strong><span style="text-decoration: underline;"><code>--links, -l</code></span></strong><br>By default, symbolic links are not transferred at all.<br>A message <code>"skipping non-regular"</code> file is emitted for any symlinks that exist.<br>If <code>--links</code> is specified, then symlinks are recreated with the same target on the destination.<br>Note that <code>--archive</code> implies <code>--links</code>.</p>



<p><strong><span style="text-decoration: underline;"><code>--perms, -p</code></span></strong><br>Preserve permissions<br>This option causes the receiving rsync to <strong><span style="text-decoration: underline;">set the destination permissions to be the same as the source permissions</span></strong>.<br>(See also the <code>--chmod</code> option for a way to modify what rsync considers to be the source permissions)<br><br><span style="text-decoration: underline;">When this option is off, permissions are set as follows</span>:<br><br>&#8211; Existing files (including updated files) retain their existing permissions, though the <code>--executability</code> option might change just the execute permission for the file.<br><br>&#8211; New files get their <code>"</code>normal<code>"</code> permission bits set to the source file&#8217;s permissions masked with the receiving directory&#8217;s default permissions (either the receiving umask, or the permissions specified via the destination directory&#8217;s default ACL), AND their special permission bits disabled except in the case where a new directory inherits a setgid bit from its parent directory.</p>



<p>Thus, when<code> --perms</code> and <code>--executability</code> are both disabled, rsync&#8217;s behavior is the same as that of other file copy utilities, such as cp(1) and tar(1).</p>



<p>In summary:<br><span style="text-decoration: underline;"><strong>To give destination files (both existing and new) the source permissions, use <code>--perms</code></strong></span>.<br>To give new files the destination default permissions (while leaving existing files unchanged), make sure that the <code>--perms</code> option is off and use <code>--chmod=ugo=rwX</code> (which ensures that all non-masked bits get enabled).</p>



<p>The preservation of the destination&#8217;s setgid bit on newly-created directories when &#8211;perms is off was added in rsync 2.6.7.</p>



<p><strong><span style="text-decoration: underline;"><code>--times, -t</code></span></strong><br><strong><span style="text-decoration: underline;">Preserve modification times</span></strong><br>This tells rsync to transfer modification times along with the files and update them on the remote system.<br>Note that if this option is not used, the optimization that excludes files that have not been modified cannot be effective.<br>In other words, a missing <code>-t</code> or <code>-a</code> will cause the transfer to behave as if it used <code>--ignore-times</code>, causing all files to be updated (though rsync&#8217;s delta-transfer algorithm will make the update fairly efficient if the files haven&#8217;t actually changed, you&#8217;re much better off using <code>-t</code>).</p>



<p><strong><span style="text-decoration: underline;"><code>--ignore-times, -I</code></span></strong><br>Normally rsync will skip any files that are already the same size and have the same modification timestamp.<br>This option turns off this <code>"</code>quick check<code>"</code> behavior, causing all files to be updated.</p>



<p><strong><span style="text-decoration: underline;"><code>--atimes, -U</code></span></strong><br><strong><span style="text-decoration: underline;">Preserve access times</span></strong><br>This tells rsync to <strong><span style="text-decoration: underline;">set the access (use) times of the destination files to the same value as the source files</span></strong>.<br><strong><span style="text-decoration: underline;">nanoseconds are not preserved (set to .000000000</span>)<span style="text-decoration: underline;">, command <code>cp -a</code> does</span></strong>.</p>



<p><strong><span style="text-decoration: underline;">IMPORTANT</span>:<br>There is no option to preserve ctime <code>"</code>status time<code>"</code></strong><br><strong>(the timestamp used to record when the inode changed, it is specific to a filesystem)</strong><br>An inode changes if any of its attributes are updated:<br>&#8211; at creation time (new file)<br>&#8211; file name<br>&#8211; mode/permissions<br>&#8211; owner/group<br>&#8211; hard link count<br>etc.<br><br>The creation of a file is one of the conditions listed above (creation of inode/file).<br>ctime cannot be preserved when files are brought into a new filesystem.</p>



<p><strong><span style="text-decoration: underline;"><code>--open-noatime</code></span></strong><br><strong><span style="text-decoration: underline;">Avoid changing the atime on opened file</span></strong><br>This tells rsync to open files with the <code>O_NOATIME</code> flag (on systems that support it) to avoid changing the access time of the files that are being transferred. If your OS does not support the <code>O_NOATIME</code> flag then rsync will silently ignore this option. Note also that some filesystems are mounted to avoid updating the atime on read access even without the <code>O_NOATIME</code> flag being set.</p>



<p><strong><span style="text-decoration: underline;"><code>--crtimes, -N</code></span></strong><br><strong>MAY NOT BE SUPPORTED, DEPENDS ON THE FILESYSTEM</strong>.<br>This tells rsync to set the create times (newness) of the destination files to the same value as the source files.</p>



<p><strong><span style="text-decoration: underline;"><code>--group, -g</code></span></strong><br><strong>Preserve group</strong><br>This option causes rsync to <strong><span style="text-decoration: underline;">set the group of the destination file to be the same as the source file</span></strong>.<br><span style="text-decoration: underline;">If the receiving program is not running as the super-user (or if <code>--no-super</code> was specified), only groups that the invoking user on the receiving side is a member of will be preserved</span>. Without this option, the group is set to the default group of the invoking user on the receiving side.</p>



<p><strong><span style="text-decoration: underline;"><code>--owner, -o</code></span></strong><br>This option causes rsync to <strong><span style="text-decoration: underline;">set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user</span></strong> (see also the <code>--super</code> and <code>--fake-super</code> options).<br>Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side.</p>



<p><strong><span style="text-decoration: underline;"><code>--acls, -A</code></span></strong><br>This option causes rsync to <strong><span style="text-decoration: underline;">update the destination ACLs to be the same as the source ACLs</span></strong>.<br>The option also implies <code>--perms</code>.<br>The source and destination systems must have compatible ACL entries for this option to work properly.<br>See the <code>--fake-super</code> option for a way to backup and restore ACLs that are not compatible.</p>



<p><strong><span style="text-decoration: underline;"><code>--xattrs, -X</code></span></strong><br>This option causes rsync to update the destination extended attributes to be the same as the source ones.</p>



<p><strong><span style="text-decoration: underline;"><code>--hard-links, -H</code></span></strong><br>This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.<br><br>This option does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source.</p>



<h2>Usual Usage</h2>



<p><strong><span style="text-decoration: underline;">Local SRC_DIR > Local DST_DIR</span></strong><br>NOTE: By default, if Local DST_DIR does not exist it is created</p>



<pre class="wp-block-code"><code><span style="text-decoration: underline;">Copy SRC_DIR inside /path/to/local/DST_DIR/ : /path/to/local/DST_DIR/SRC_DIR</span>
$ rsync -av --info=progress2 /path/to/local/SRC_DIR /path/to/local/DST_DIR

<span style="text-decoration: underline;">Copy &lt;src_path>'s content inside &lt;dst_path>/</span>
$ rsync -av --info=progress2 &lt;src_path><strong>/</strong> &lt;dst_path>/
$ rsync -av --info=progress2 &lt;src_path><strong>/*</strong> &lt;dst_path>/</code></pre>



<p><strong><span style="text-decoration: underline;">Local SRC_FILE > Local DST</span></strong></p>



<pre class="wp-block-code"><code>$ rsync -av --info=progress2 /path/to/local/SRC_FILE /path/to/local/DST</code></pre>



<p><span style="text-decoration: underline;">IF DST is a directory</span>, it copies SRC_FILE inside DST (DIR)<br><br><span style="text-decoration: underline;">IF DST is a file</span>, its content is replaced with the content of SRC_FILE<br>(with -a option ONLY mtime is the same, atime, ctime are different, you may use -U + -N options)<br><br><span style="text-decoration: underline;">If DST does not exist</span> :<br>&#8211; if there is a trailing slash &#8216;/&#8217; it creates the directory DST (only for a direct subdirectory of an existing path &#8220;mkdir -p does not work&#8221; ) AND copies SRC_FILE inside DST<br><br>&#8211; otherwise it creates file DST (copy of SRC_FILE)</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>qpdf: PDF Transformation Software</title>
		<link>https://itec4b.com/qpdf-pdf-transformation-software/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Sat, 25 Feb 2023 17:16:05 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[File Manipulation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[qpdf]]></category>
		<category><![CDATA[file manipulation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pdf]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=1573</guid>

					<description><![CDATA[qpdf is both a free command-line program and a C++ library (open source PDF manipulation library) for structural, content-preserving transformations on PDF files.qpdf has been designed with very few external dependencies and is intentionally very lightweight. It was created in 2005 by Jay Berkenbilt. One of the main features is the capability to merge and &#8230; <p class="link-more"><a href="https://itec4b.com/qpdf-pdf-transformation-software/" class="more-link">Read more<span class="screen-reader-text"> "qpdf: PDF Transformation Software"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p><a href="http://qpdf.sourceforge.net">qpdf</a> is both a free command-line program and a C++ library (open source PDF manipulation library) for structural, content-preserving transformations on PDF files.<br>qpdf has been designed with very few external dependencies and is intentionally very lightweight.<br><br>It was created in 2005 by Jay Berkenbilt.<br><br><strong><span style="text-decoration: underline;">One of the main features is the capability to merge and split PDF files by selecting pages from one or more input files</span></strong>.<br><span style="text-decoration: underline;"><strong>It is also capable of performing a variety of transformations such as linearization (known as web optimization or fast web viewing), encryption, and decryption of PDF files</strong></span>.<br><br><a href="https://qpdf.readthedocs.io/en/stable/cli.html">qpdf Online Documentation</a><br><br><span style="text-decoration: underline;">qpdf Local Documentation</span>: /usr/share/doc/qpdf/qpdf-manual.html</p>



<h2>Portable Document Format</h2>



<p><a href="https://www.adobe.com/acrobat/about-adobe-pdf.html">Adobe created the PDF in 1992 by Dr. John Warnock</a>, offering an easy, reliable way to present and exchange documents regardless of the software, hardware, or operating systems being used.<br>Today, it is one the most trusted file formats around the world, it can be easily viewed on any operating system.<br><br><span style="text-decoration: underline;">PDF was standardized as ISO 32000 in 2008 as an open standard</span>.<br>The PDF format is now maintained by the International Organization for Standardization (ISO).<br><span style="text-decoration: underline;">ISO 32000-2:2020 edition was published in December 2020, it does not include any proprietary technologies</span>.</p>



<p>The PDF specification also provides for encryption (in which case a password is needed to view or edit the contents), digital signatures (to provide secure authentication), file attachments, and metadata.<br>PDF 2.0 defines 256-bit AES encryption as standard for PDF 2.0 files.<br><br>The standard security provided by PDF consists of two different passwords:<br><br>&#8211; user password, which encrypts the file and prevents opening<br><br>&#8211; owner password, which specifies operations that should be restricted even when the document is decrypted, which can include modifying, printing, or copying text and graphics out of the document, or adding or modifying text notes.</p>



<p>The user password encrypts the file, the owner password does not, instead relying on client software to respect content restrictions.<br>An owner password can easily be removed by software.<br>Thus, the used restrictions that an author places on a PDF document are not secure, and cannot be assured once the file is distributed.</p>



<p>Metadata includes information about the document and its content, such as the author’s name, document title, description, creation/modification dates, application used to create the file, keywords, copyright information, etc.</p>



<h2>Install qpdf (Debian)</h2>



<pre class="wp-block-code"><code># apt install qpdf</code></pre>



<h2>Usage</h2>



<p><code>--linearize</code><br>Create linearized (web-optimized) output file.<br>Linearized files are formatted in a way that allows compliant readers to begin displaying a PDF file before it is fully downloaded.<br>Ordinarily, the entire file must be present before it can be rendered because important cross-reference information typically appears at the end of the file.</p>



<pre class="wp-block-code"><code>$ qpdf --linearize infile.pdf  outfile.pdf</code></pre>



<h2>Merge PDF files with pages selection</h2>



<p>qpdf allows you to use the <code>--pages</code> option to select pages from one or more input files.</p>



<pre class="wp-block-code"><code>$ qpdf primary_input_file.pdf --pages . &#91;--password=password] &#91;page-range] &#91; ... ] -- outputfile.pdf

Within &#91; ... ] you may repeat the following:  inputfile_N.pdf &#91;--password=password] &#91;page-range]</code></pre>



<p>The special input file <code>'.'</code> can be used as an alias for the primary input file.<br>Multiple input files may be specified and you can select specific pages from it.<br>For each inputfile that pages should be extracted from, specify the filename, a password (if needed) to open the file, and a page range.<br>Note that <code>'--'</code> terminates parsing of page selection flags.<br><br><code>--password=password</code> specifies a password for accessing encrypted files<br>The password option is only needed for password-protected files<br><br>The page range may be omitted. In this case, all pages are included.<br><br>Document-level information (metadata, outline, etc.) is taken from the primary input file (in the above example, <code>primary_input_file.pdf</code>) and is preserved in <code>outputfile.pdf</code><br><strong><span style="text-decoration: underline;">You can use <code>--empty</code> in place of the primary input file to start from an empty file (without any metadata, outline, etc.) and just merge selected pages from input files</span></strong>.<br><br><strong><span style="text-decoration: underline;">In most cases you will most likely use this following syntax</span></strong></p>



<pre class="wp-block-code"><code>$ qpdf --empty --pages inputfile_1.pdf &#91;page-range] inputfile_2.pdf &#91;page-range] inputfile_3.pdf &#91;page-range] &#91; ... ] -- outputfile.pdf</code></pre>



<p>The page-range is a set of numbers separated by commas, ranges of numbers separated dashes, or combinations of those.<br>The character <code>'z'</code> represents the last page.<br>A number preceded by an <code>'r'</code> indicates to count from the end, so <code>r3-r1</code> would be the last three pages of the document.<br>Pages can be specified in any order (selection of any pages).<br>Ranges can be specified in any order (ascending or descending): a high number followed by a low number causes the pages to appear in reverse.<br>Numbers may be repeated in a page range.<br>A page range may be optionally appended with <code>:even</code> or <code>:odd</code> to indicate only the even or odd pages in the given range.<br>Note that even and odd refer to the positions within the specified, range, not whether the original number is even or odd.<br><br><span style="text-decoration: underline;">Example page ranges</span>:<br><br>1,3,5-9,15-12<br>Pages 1, 3, 5, 6, 7, 8, 9, 15, 14, 13, and 12 in that order</p>



<p>z-1<br>All pages in the document in reverse</p>



<p>r3-r1<br>The last three pages of the document</p>



<p>r1-r3<br>The last three pages of the document in reverse order</p>



<p>1-20:even<br>Even pages from 2 to 20</p>



<p>5,7-9,12:odd<br>Pages 5, 8 and 12, which are the pages in odd positions from among the original range (pages 5, 7, 8, 9, and 12)</p>



<pre class="wp-block-code"><code>Example, to extract pages 1 through 5 from infile.pdf while preserving all metadata associated with that file in outfile.pdf
$ qpdf infile.pdf --pages . 1-5 -- outfile.pdf

If you want pages 1 through 5 from infile.pdf without any metadata, use
$ qpdf --empty --pages infile.pdf 1-5 -- outfile.pdf

Merge all .pdf files
$ qpdf --empty  --pages *.pdf -- outfile.pdf</code></pre>



<h2>Split a PDF into separate PDF files</h2>



<p><code>--split-pages[=n]</code><br>Write each group of n pages to a separate output file.<br>If n is not specified, create single pages.<br><br>Output file names are generated as follows:<br>If the string %d appears in the output file name, it is replaced with a range of zero-padded page numbers starting from 1.<br>Otherwise, if the output file name ends in .pdf (case insensitive), a zero-padded page range, preceded by a dash, is inserted before the file extension.<br>Otherwise, the file name is appended with a zero-padded page range preceded by a dash.<br><br>Zero padding is added to all page numbers in file names so that all the numbers are the same length, which causes the output filenames to sort lexically in numerical order.<br><br>Page ranges are a single number in the case of single-page groups or two numbers separated by a dash otherwise.<br><br>Here are some examples. In these examples, infile.pdf has 20 pages</p>



<pre class="wp-block-code"><code>Output files are 01-outfile through 20-outfile with no extension
$ qpdf --split-pages infile.pdf %d-outfile

Output files are outfile-01.pdf through outfile-20.pdf
$ qpdf --split-pages infile.pdf outfile.pdf

Output files are outfile-01-04.pdf, outfile-05-08.pdf, outfile-09-12.pdf, outfile-13-16.pdf, outfile-17-20.pdf
$ qpdf --split-pages=4 infile.pdf outfile.pdf

Output files are outfile.notpdf-01 through outfile.notpdf-20
The extension .notpdf is not treated in any special way regarding the placement of the number
$ qpdf --split-pages infile.pdf outfile.notpdf</code></pre>



<p>Note that metadata, outline, etc, and other document-level features of the original PDF file are not preserved.<br>For each page of output, this option creates an empty PDF and copies a single page from the output into it.<br>If you require the document-level data, you will have to run qpdf with the <code>--pages</code> option once for each page.<br>Using <code>--split-pages</code> is much faster if you don’t require the document-level data.<br><br><span style="text-decoration: underline;">If you don’t want to split out every page, use page ranges to select the pages you only want to extract</span>.<br>The page range is used to specify the pages or ranges you want, <span style="text-decoration: underline;">but each extracted page is still stored in a single PDF</span>.</p>



<pre class="wp-block-code"><code>$ qpdf --split-pages infile.pdf outfile.pdf --pages infile.pdf 4-5,8,9-13 --</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>curl: Transfer Data From/To a Server</title>
		<link>https://itec4b.com/curl-transfer-data-from-to-a-server/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Tue, 24 Jan 2023 17:44:16 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[Data Transfer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[data transfer]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=336</guid>

					<description><![CDATA[curl is entirely free and open source software, it is a complete and powerful tool to transfer data from/to a server.Daniel Stenberg is the founder and lead developer of cURL and libcurl since 1996. curl is used daily by virtually every Internet-using human on the globe, it is used everywhere ! cURL is an Open &#8230; <p class="link-more"><a href="https://itec4b.com/curl-transfer-data-from-to-a-server/" class="more-link">Read more<span class="screen-reader-text"> "curl: Transfer Data From/To a Server"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p><a href="https://curl.se">curl</a> is entirely free and open source software, it is a <strong>complete and powerful tool to transfer data from/to a server</strong>.<br>Daniel Stenberg is the founder and lead developer of <strong>cURL</strong> and <strong>libcurl</strong> <a href="https://curl.haxx.se/docs/history.html">since 1996</a>.<br><br><span style="text-decoration: underline;"><strong>curl is used daily by virtually every Internet-using human on the globe, it is used everywhere !</strong></span></p>



<p>cURL is an Open Source project consisting of voluntary members from all over the world.<br>The cURL project is completely independent and free.<br><br>It is a <span style="text-decoration: underline;">client-side program</span> (the &#8216;c&#8217;), a URL (Uniform Resource Locator) client, and shows the data (by default).<br>So &#8216;c&#8217; for Client and URL: cURL</p>



<p><a href="https://everything.curl.dev">Everything curl</a> is a detailed and free book that explains basically everything there is to know about curl, libcurl and the associated project.</p>



<p>cURL is a project and its primary purpose and focus is to make two products:<br>&#8211; curl, the command-line tool<br>&#8211; libcurl the transfer library with a C API<br><br>Both the tool and the library do Internet transfers for resources specified as URLs using Internet protocols.<br><span style="text-decoration: underline;"><strong>Everything and anything that is related to Internet protocol transfers can be considered curl&#8217;s business</strong></span>.</p>



<p>The protocol describes exactly how to ask the server for data, or to tell the server that there is data coming.<br>Protocols are typically defined by the IETF (<a href="https://www.ietf.org">Internet Engineering Task Force</a> ),<br>which hosts RFC documents that describe exactly how each protocol works: how clients and servers are supposed to act and what to send and so on.</p>



<p>curl and libcurl are distributed under an Open Source license known as a MIT license derivative.<br>A key thing to remember is, that libcurl is the library and that this library is the biggest component of the curl command-line tool.</p>



<p><strong>Where&#8217;s the code ?</strong><br>The curl git tree can be browsed with a web browser at <a href="https://github.com/curl/curl">https://github.com/curl/curl</a><br>To check out the curl source code from git, you can clone it like this:</p>



<pre class="wp-block-code"><code>$ git clone https://github.com/curl/curl.git</code></pre>



<p>curl started out as a command-line tool and it has been invoked from shell prompts and from within scripts by an uncountable number of users over the years.<br><span style="text-decoration: underline;">curl has established itself as one of those trusty tools that is there for you to help you get your work done</span>.</p>



<p><a href="https://curl.se/docs/comparison-table.html">Here</a> you can find <strong>why curl is your first choice</strong>.</p>



<h2><a href="https://curl.se">curl</a> vs. <a href="https://www.gnu.org/software/wget">wget</a></h2>



<p><a href="https://daniel.haxx.se/docs/curl-vs-wget.html">https://daniel.haxx.se/docs/curl-vs-wget.html</a><br><br><span style="text-decoration: underline;">wget has (recursive) downloading powers that curl does not feature and it also handle download retries over unreliable connections possibly slightly more effective</span>.<br><strong>For just about everything else, curl is probably the more suitable tool</strong>.</p>



<p>curl operates on URLs. URI (Uniform Resource Identifier) is actually the correct name for them.<br>The syntax is defined in RFC 3986 (2005): <a href="https://datatracker.ietf.org/doc/html/rfc3986">https://datatracker.ietf.org/doc/html/rfc3986</a></p>



<h2>Install curl (Debian)</h2>



<pre class="wp-block-code"><code># apt install curl</code></pre>



<h2>curl options basics</h2>



<p><strong><span style="text-decoration: underline;"><code>-V, --version</code></span></strong><br>Displays information about curl and the libcurl version it uses.<br>The output from that command line is typically four lines, out of which some will be rather long and might wrap in your terminal window<br><br><span style="text-decoration: underline;">Line 1: curl</span><br>The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable.<br>The first line starts with &#8216;curl&#8217; and first shows the main version number of the tool.<br>Then follows the &#8220;platform&#8221; the tool was built for within parentheses and the libcurl version.<br>Those three fields are common for all curl builds.<br><br>If the curl version number has -DEV appended to it, it means the version is built straight from a in-development source code and it is not an officially released and &#8220;blessed&#8221; version.<br>The rest of this line contains names of third party components this build of curl uses, often with their individual version number next to it with a slash separator.<br><br><span style="text-decoration: underline;">Line 2: Release-Date</span><br>This line shows the date this curl version was released by the curl project,<br>and it can also show a secondary &#8220;Patch date&#8221; if it has been updated somehow after it was originally released.</p>



<p><span style="text-decoration: underline;">Line 3: Protocols</span><br>The third line (starts with &#8220;Protocols:&#8221;) is a list of all transfer protocols (URL schemes really) in alphabetical order that this curl build supports.<br>All names are shown in lowercase letters.<br><br><span style="text-decoration: underline;">Line 4: Features</span><br>The fourth line (starts with &#8220;Features:&#8221;) is the list of features this build of curl supports.<br>If the name is present in the list, that feature is enabled. If the name is not present, that feature is not enabled.</p>



<p><span style="text-decoration: underline;"><strong><code>-v, --verbose</code></strong></span><br>Makes curl verbose during the operation.<br>Useful for debugging and seeing what&#8217;s going on &#8220;under the hood&#8221;.<br>When verbose mode is enabled, curl gets more talkative and will explain and show a lot more of its doings.<br>It will add informational tests and prefix them with &#8216;*&#8217;.</p>



<p>A line starting with &#8216;&gt;&#8217; means &#8220;header data&#8221; sent by curl,<br>A line starting with &#8216;&lt;&#8216; means &#8220;header data&#8221; received by curl that is hidden in normal cases,<br>A line starting with &#8216;*&#8217; means additional info provided by curl.</p>



<p>If you only want HTTP headers in the output, <code>-i, --include</code> might be the option you&#8217;re looking for.<br>If you think this option still doesn&#8217;t give you enough details, consider using <code>--trace</code> or <code>--trace-ascii</code> instead.</p>



<p>See also <code>-i, --include</code>. This option overrides <code>--trace</code> and <code>--trace-ascii</code>.</p>



<p><span style="text-decoration: underline;"><strong><code>-s, --silent</code></strong></span><br>Silent or quiet mode.<br>Don&#8217;t show progress meter or error messages when errors occur. Makes Curl mute.<br>It will still output the downloaded data you ask for, potentially even to the terminal/stdout unless you redirect it.<br>Use <code>-S, --show-error</code> in addition to this option to only disable progress meter but still show error messages.</p>



<p><span style="text-decoration: underline;"><strong><code>-S, --show-error</code></strong></span><br>When used with <code>-s, --silent</code>, it makes curl show an error message if it fails.</p>



<p><code><span style="text-decoration: underline;"><strong>-I, --head</strong></span></code><br>(HTTP, FTP, FILE) Fetch the headers only.<br>HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document.<br>When used on an FTP or FILE file, curl displays the file size and last modification time only.</p>



<p><span style="text-decoration: underline;"><strong><code>--ssl</code></strong></span><br>Try to use SSL/TLS for the connection.<br>Reverts to a non-secure connection if the server doesn&#8217;t support SSL/TLS.<br><br><code><strong><span style="text-decoration: underline;">--ssl-reqd</span></strong></code><br>Require SSL/TLS for the connection. Terminates the connection if the server doesn&#8217;t support SSL/TLS.<br><br><code><span style="text-decoration: underline;"><strong>-L, --location</strong></span></code> (<strong>HTTP 3NN Redirection</strong>)<br>(HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3NN response code), <strong><span style="text-decoration: underline;">this option will make curl redo the request automatically on the new place</span></strong>.</p>



<p>If used together with -i, &#8211;include or -I, &#8211;head, headers from all requested pages will be shown.<br><br><span style="text-decoration: underline;"><strong><code>--stderr</code></strong></span><br>Redirect all writes to stderr to the specified file instead.<br>If the file name is a plain &#8216;-&#8216;, it is instead written to stdout.<br>If this option is used several times, the last one will be used.</p>



<p><strong><span style="text-decoration: underline;">OUPUT</span></strong><br><span style="text-decoration: underline;">If not told otherwise, curl writes the received data to stdout</span>.<br>It can be instructed to instead save that data into a local file, using the <code>-o, --output </code>OR<code> -O, --remote-name</code> options.<br>If curl is given multiple URLs to transfer on the command line, it similarly needs multiple options for where to save them.<br>curl does not parse or otherwise &#8220;understand&#8221; the content it gets or writes as output.<br>It does no encoding or decoding, unless explicitly asked so with dedicated command line options.<br><br><code><strong><span style="text-decoration: underline;">-o, --output &lt;path></span></strong></code><br>Write output to &lt;path> instead of stdout.<br><br><code><strong><span style="text-decoration: underline;">-O, --remote-name</span></strong></code><br>Write output to a local file named like the remote file you get.<br>(Only the file part of the remote file is used, the path is cut off)<br><br><span style="text-decoration: underline;">The file will be saved in the current working directory</span>.<br>If you want the file saved in a different directory, make sure you change the current working directory before invoking curl with this option.</p>



<p>The remote file name to use for saving is extracted from the given URL, nothing else, and if it already exists it will be overwritten.<br>There is no URL decoding done on the file name. If it has %20 or other URL encoded parts of the name, they will end up as-is as file name.</p>



<p>You may use this option as many times as the number of URLs you have.<br><br><code><strong><span style="text-decoration: underline;">-C, --continue-at</span></strong></code><br>Continue/Resume a previous file transfer at the given offset.<br>The given offset is the exact number of bytes that will be skipped, counting from the beginning of the source file before it is transferred to the destination.<br><br><strong><span style="text-decoration: underline;">Use <code>'-C -'</code> to tell curl to automatically find out where/how to resume the transfer</span></strong>.<br>It then uses the given output/input files to figure that out.<br>If this option is used several times, the last one will be used.</p>



<pre class="wp-block-code"><code><strong><span style="text-decoration: underline;">Download a file</span></strong>
$ curl URL -o /path/to/dst_filename

<strong><span style="text-decoration: underline;">Download a file to the current directory</span></strong>
$ curl -O URL

<strong><span style="text-decoration: underline;">Resume an interrupted download</span></strong>
$ curl -O -C - URL</code></pre>



<p><strong><span style="text-decoration: underline;">PROGRESS METER</span></strong><br>curl normally displays a progress meter during operations, indicating the amount of transferred data, transfer speeds and estimated time left, etc.<br>The progress meter displays number of bytes and the speeds are in bytes per second.<br>The suffixes (K, M, G, T, P) are 1024 based. For example 1K is 1024 bytes. 1M is 1048576 bytes (1024^2).</p>



<p>curl displays this data to the terminal by default, so if you invoke curl to do an operation and it is about to write data to the terminal, it disables the progress meter as otherwise it would mess up the output mixing progress meter and response data.</p>



<p>If you want a progress meter for HTTP POST or PUT requests, you need to redirect the response output to a file, using shell redirect (&gt;), <code>-o, --output</code> or similar.</p>



<p>It is not the same case for FTP upload as that operation does not spit out any response data to the terminal.</p>



<p>If you prefer a progress &#8220;bar&#8221; instead of the regular meter, <code>-#, --progress-bar</code> is your friend.<br>You can also disable the progress meter completely with the <code>-s, --silent</code> option.</p>



<p><span style="text-decoration: underline;"><strong><code>-#, --progress-bar</code></strong></span><br>Make curl display transfer progress as a simple progress bar instead of the standard, more informational, meter.<br>This progress bar draws a single line of &#8216;#&#8217; characters across the screen and shows a percentage if the transfer size is known.<br>For transfers without a known size, there will be space ship (-=o=-) that moves back and forth but only while data is being transferred, with a set of flying hash sign symbols on top.</p>



<p><span style="text-decoration: underline;"><strong><code>--no-progress-meter</code></strong></span><br>Option to switch off the progress meter output without muting or otherwise affecting warning and informational messages like <code>-s, --silent</code> does.<br>Note that this is the negated option name documented.<br>You can thus use <code>--progress-meter</code> to enable the progress meter again.<br>Added in version 7.67.0.</p>



<h2>Connection Test: Get Server Information</h2>



<pre class="wp-block-code"><code>$ curl -I -v --silent --ssl  &#91;protocol://]ip_or_hostname | grep '^&#91;&gt;&lt;*]'</code></pre>



<p>If you specify URL without protocol:// prefix, curl will attempt to guess what protocol you might want.<br>It will then default to HTTP but try other protocols based on often-used host name prefixes.<br>For example, for host names starting with &#8220;ftp.&#8221; curl will assume you want to speak FTP.</p>



<p>curl will do its best to use what you pass to it as a URL.<br><br><a href="https://everything.curl.dev/usingcurl/tls/enable">https://everything.curl.dev/usingcurl/tls/enable</a><br><br>Using <code>--ssl</code> means that curl will attempt to upgrade the connection to TLS but if that fails, it will still continue with the transfer using the plain-text version of the protocol.<br>To make the <code>--ssl</code> option require TLS to continue, there is instead the <code>--ssl-reqd</code> option which will make the transfer fail if curl cannot successfully negotiate TLS.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Thunderbird: IMAP Backup Procedure</title>
		<link>https://itec4b.com/thunderbird-backup-procedure/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Sat, 21 Jan 2023 16:23:54 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[thunderbird]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=183</guid>

					<description><![CDATA[Mozilla History Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. Jamie Zawinski from Netscape registered mozilla.orgHe was a founder of Mozilla.org, personally registering its domain name on the day of Netscape&#8217;s open source announcement and helping design and run the organization through its first year. He developed &#8230; <p class="link-more"><a href="https://itec4b.com/thunderbird-backup-procedure/" class="more-link">Read more<span class="screen-reader-text"> "Thunderbird: IMAP Backup Procedure"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>Mozilla History</h2>



<p><a href="https://www.mozilla.org/en-US/about">Mozilla</a> (stylized as moz://a) is a free software community <a href="https://www.mozilla.org/en-US/about/history">founded in 1998</a> by members of Netscape.<br><br>Jamie Zawinski from Netscape registered mozilla.org<br>He was a founder of Mozilla.org, personally registering its domain name on the day of Netscape&#8217;s open source announcement and helping design and run the organization through its first year.<br><br>He developed the Unix release of Netscape Navigator 1.0 and later, Netscape Mail, the first mail reader (or Usenet reader) to natively support HTML.<br>The project took its name &#8220;Mozilla&#8221;, after the original code name of the Netscape Navigator browser.</p>



<p>Mozilla&#8217;s most known products include the <a href="https://www.mozilla.org/en-US/firefox/enterprise">Firefox web browser</a> and <a href="https://www.thunderbird.net/en-US/organizations">Thunderbird e-mail client</a>.</p>



<h2>How does Thunderbird emails storage work ?</h2>



<p>There are several ways to store emails on disk. Two of the most common are mbox files and Maildir directories.<br><br>Unless you explicitly use optional support for <a href="https://support.mozilla.org/en-US/kb/maildir-thunderbird">Maildir</a> which allows a single unique file per email (using the EML data format), <span style="text-decoration: underline;">Thunderbird stores emails content in two distinct files</span>.<br><br>The first one is an <strong>mbox</strong> file (a text file without extension), which is a standard format to store email content.<br>All messages from a mailbox folder are concatenated and stored as plain text in a mbox file.<br>It was first implemented in Fifth Edition Unix.<br><br>mbox database files sometimes have an .mbox extension, but this is not required nor expected.<br>Each message starts with the four characters &#8220;From&#8221; followed by a space (the so-called &#8220;From_ line&#8221;).<br><br>RFC 4155 (2005) The application/mbox Media Type : <a href="https://datatracker.ietf.org/doc/html/rfc4155.html">https://datatracker.ietf.org/doc/html/rfc4155.html</a><br><br>The second is an <strong>.msf file</strong>, which stands for <strong>Mail Summary File</strong>.<br>This is an index file, which contains only headers and summary of emails.<br><br>See <a href="https://www.jwz.org/doc/mailsum.html">Mail Summary Files writeup</a> explaining Mozilla mbox and .msf file design choices.</p>



<pre class="wp-block-code"><code>Jamie Zawinski

"In this modern world, the only sensible thing for someone implementing a mail reader to do is use BSD mbox files to store mail messages, because that is the de-facto standard used by almost every popular mail reader, on Unix, Windows, and Mac.
…
The mbox file format is basically one big text file containing every message of the folder sequentially, with separator lines between them. This has obvious efficiency problems: you don't want to spend a lot of time doing linear searches through the file, and you don't want to ever pull the whole file into memory at once, and deletions are expensive.

So, you have to summarize it, and be lazy about updates.
My approach, when designing this for Netscape Mail in the 2.0 and 3.0 timeframe, was to identify the pieces of information that needed to be gotten at quickly and repeatedly, and store those in a cache.

Most other information was only needed on a per-message basis (not when operating on many messages at once) so that latter sort was simply parsed from the message on demand, as the message was being displayed.
…
So, we have these summary files, one summary file for each folder, which provide the necessary info to generate that message list quickly.

Each summary file is a true cache, in that if it is deleted (accidentally or on purpose) it will be regenerated when it is needed again (which might take a little while, but which only needs to be done once.)
…"</code></pre>



<p>Mail Summary Files (.msf) use the <strong>Mork</strong> format.<br>Mork is a database file format invented by David McCusker for the Mozilla code since the original Netscape database information was proprietary and could not be released open source.<br>It is not very human-readable, it has been phased out in favor of SQLite, a more widely-supported file format.<br>As you may notice it is still used by Thunderbird application.<br><br>The first line in the .msf file is the header: </p>



<pre class="wp-block-code"><code>// &lt;!-- &lt;mdb:mork:z v="1.4"/&gt; --&gt;</code></pre>



<p>It is structured as a comment so it can be safely ignored by the parser.<br><br><span style="text-decoration: underline;"><strong>NOTES</strong></span><br>EML (Electronic Mail Format) files typically store each message as a single file (unlike MBOX which concatenates all the messages from a folder into one file), and attachments may either be included as MIME content in the message or written off as a separate file, referenced from a marker in the EML file.</p>



<p>RFC 5322 (2008) Internet Message Format : <a href="https://datatracker.ietf.org/doc/html/rfc5322">https://datatracker.ietf.org/doc/html/rfc5322</a></p>



<pre class="wp-block-code"><code>Christopher J.Prom (2011)

"The IMF serves as the basis for two of the most common storage and exchange formats: MBOX and EML.

In reality, neither of these methods constitutes a storage format per se, since each server or client implements them somewhat differently.

MBOX (sometimes known as Berkeley format) is a set of four slightly different storage formats, developed originally for Unix systems.

Generally, a single file with the extension .mbox or .mbx contains the contents of an entire folder, with MIME content stored directly in the file.

Files can and do grow to astronomical sizes, and even slight file corruption may affect the ability of certain clients to access individual messages or even the entire folder.

MBOX files also include the attachments in their MIME format, meaning that action will likely need to be taken to migrate them, if they are to remain accessible in the future.

EML files typically store each message as a single file, and attachments may either be included as MIME content in the message or written off as a separate file, referenced from a marker in the EML file.

In spite of these issues, MBOX and EML have achieved a certain status as de facto standards.
Most modern email clients and servers can import and export one or both of the formats"</code></pre>



<h2>Where does Thunderbird store data ?</h2>



<p><span style="text-decoration: underline;">Thunderbird saves all the data such as emails, passwords, user preferences and settings in a set of files called a <strong>profile</strong></span>.<br><br>The profile is stored in a separate location from the Thunderbird program files.<br>The location of the profile folder varies according to the Operating System.<br><br>With Debian it is located in /home/&lt;username&gt;/.thunderbird/<br><br>It is possible to have several profiles, each profile is stored in a dedicated folder.</p>



<p>A profile folder is identified using the following convention: &lt;random_string&gt;.&lt;profile_name&gt;<br>where &lt;random_string&gt; is eight alphanumeric characters randomly generated by Thunderbird and &lt;profile_name&gt; is the name you assigned to the profile.</p>



<p>Thunderbird uses the /home/&lt;username&gt;/.thunderbird/<strong>profiles.ini</strong> file to store <span style="text-decoration: underline;">profiles information</span></p>



<pre class="wp-block-code"><code>The default profile is set via

&#91;Install&lt;ID&gt;]
Default=&lt;profile_folder&gt;</code></pre>



<pre class="wp-block-code"><code>&#91;General]
StartWithLastProfile=&lt;boolean_value&gt;

0=Thunderbird will ask you to select a profile (and make the one selected the default profile)
1=Thunderbird won't ask you to select a profile, it will use the default profile

This option corresponds to Profile Manager 'Use the selected profile without asking at startup'</code></pre>



<p>Get Thunderbird&#8217;s Default Profile (Debian)</p>



<pre class="wp-block-code"><code>$ sed -n '/^\&#91;Install/,/^Default=/p' $HOME/.thunderbird/profiles.ini | sed -n 's;^Default=;;p'</code></pre>



<p><span style="text-decoration: underline;"><strong>NOTES</strong></span><br>When you open Thunderbird for the first time, it creates a default profile. This profile is used automatically.<br>While it is possible to have multiple profiles, most users just use the default one which may contain several email accounts.</p>



<p>The Profile Manager is used to create/rename/delete profiles and to select the profile to use for a Thunderbird session.<br>It is not displayed by default, you have to start Thunderbird with the option -ProfileManager</p>



<pre class="wp-block-code"><code>$ thunderbird -ProfileManager</code></pre>



<p></p>



<h2>All non-default settings: prefs.js file</h2>



<p>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/prefs.js<br><br>Thunderbird stores any settings you change or create using the GUI via &#8216;Account Settings&#8217; and/or &#8216;Settings&#8217; in the <strong>prefs.js</strong> file<br><br>The recommended way to add or modify a setting which is not available via the User Interface is to use &#8216;<a href="https://support.mozilla.org/en-US/kb/config-editor">Config Editor</a>&#8216;, equivalent to Firefox&#8217;s about:config.<br><br>OR<br><br>You can add/modify a setting by editing prefs.js directly using a text editor.<br>However, <span style="text-decoration: underline;">prefs.js does not contain all of the settings, it only contains any settings that have been modified</span> (not set with their default value).<br>In fact, if you add a setting with a default value Thunderbird will remove it from the file the next time you run it.<br>Be careful when you edit prefs.js while Thunderbird is running since it may overwrite some of the settings when it exits, losing your edits.</p>



<h2>user.js file</h2>



<p>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/user.js<br><br>It does not exist by default, you have to create it. This is a user-set overriding preferences (prefs.js)<br>It is mainly used by administrators to set the same settings in several profiles.<br>Unless you know what you are doing, it is recommended that you don&#8217;t use it since any settings you add to it will overwrite prefs.js when Thunderbird starts, preventing permanent changes using the Config Editor.<br>Whenever Thunderbird starts it will overwrite any settings in prefs.js with the corresponding settings from user.js</p>



<p></p>



<h2>ImapMail: IMAP Folders containing mbox .msf .sbd files</h2>



<p>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/ImapMail/<br><br>When you set up an IMAP account Thunderbird creates a folder named after the IMAP server name.<br>So if your IMAP server is imap.mozilla.org Thunderbird will create a directory<br>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/ImapMail/imap.mozilla.org/</p>



<p>You will find inside: the mbox and .msf files according to the standard folders (Inbox, Draft, Sent, Junk, Trash, etc.) and the specific ones you have created on the IMAP server.</p>



<p>The .sbd subdirectories are used to store the folders in a hierarchy<br>Subfolders are obtained with the .sbd extension<br>If you created subfolders within your Inbox folder on the IMAP server, you will find an extra file Inbox.sbd which will also contain mbox and .msf files (and eventually other .sbd files for each subfolder)<br><br>Be aware though that you may get a different folder name from what is shown in the application and the actual matching mbox .msf files<br>This renaming option is set within .msf files</p>



<p></p>



<h2>Local Folders</h2>



<p>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/Mail/Local Folders<br><br>The name says it all : it is local folders (on your computer) meaning there is no direct interaction with any mail server.<br>Local Folders provides a convenient place to store messages locally when desired, <span style="text-decoration: underline;"><strong>ideal for backups</strong></span>.<br>The only space limit is the amount of space available on your disk.<br><br>By default you have a &#8216;Trash&#8217; and &#8216;Outbox&#8217; empty folder<br><br>Trash folder:<br>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/Mail/Local Folders/Trash<br>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/Mail/Local Folders/Trash.msf<br><br>Outbox folder:<br>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/Mail/Local Folders/Unsent Messages<br>/home/&lt;username&gt;/.thunderbird/&lt;random_string&gt;.&lt;profile_name&gt;/Mail/Local Folders/Unsent Messages.msf<br><br>Outbox is a special folder used to queue messages when you use &#8216;Send Later&#8217; rather than &#8216;Send&#8217;<br>When you compose a message and save it to be sent later (File &gt; Send Later), it is saved in the &#8216;Unsent Messages&#8217; mbox file in &#8216;Local Folders&#8217;.<br><br>That folder is also used to send a message in the background if you set mailnews.sendInBackground true<br><br><span style="text-decoration: underline;"><strong>NOTES</strong></span><br>emails can be stored on the client, on the server side, or in both places.<br>Standard formats for mailboxes include Maildir and mbox.</p>



<p></p>



<h2>msgFilterRules.dat (Message filters)</h2>



<p>Message filters allow you to set up Thunderbird to organize your messages automatically.<br>Each account has its own set of filters.<br><br><span style="text-decoration: underline;">Message filters are useful if you routinely want to perform certain actions on messages</span>:<br>moving messages to folders, deleting them, forwarding them to other email addresses, etc.</p>



<p>Filters can be applied automatically to incoming mail, or you can run them manually when desired.<br><br>The message filters for each account are stored in a msgFilterRules.dat file</p>



<p></p>



<h2>IMAP Backup Solution</h2>



<p>If you want to back up/archive your emails from an IMAP account you may use Local Folders<br><br>Keep in mind that this simple solution exists and is appropriate in several use cases:<br>&#8211; You are running out of space on your email account and need to free up server space<br>&#8211; You want to create a snapshot of your emails (copy/backup)<br><br>In order to proceed, create a new folder yyyymmdd-backup-emailaccount into &#8216;Local Folders&#8217;<br>via the GUI: right-click on Local Folders > New Folder… > Create as a subfolder of Local Folders<br><br>It will create 2 files (mbox and .msf) :<br>/home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/yyyymmdd-backup-emailaccount<br>/home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/yyyymmdd-backup-emailaccount.msf<br><br><strong><span style="text-decoration: underline;">IMPORTANT</span></strong><br>Make sure Thunderbird has fully synchronized all your IMAP folders and subfolders (downloaded all emails)<br><br>Set <a href="https://itec4b.com/thunderbird-auto-update-all-imap-folders-subfolders">mail.server.default.check_all_folders_for_new</a></p>



<p>File &gt; Offline &gt; Download/Sync Now<br><br>Download and/or sync the following : Select &#8216;Mail messages&#8217; <span style="text-decoration: underline;">only</span> and click on &#8216;Select&#8217;<br>Tick any folder you want to sync and click on &#8216;OK&#8217; twice</p>



<p>Depending on the email account and the network capacity, it may take a few minutes&#8230;</p>



<p>Your IMAP folders should be synchronized now</p>



<p>Via the GUI select the IMAP folders you want to backup (Ctrl+Left Click)<br>Drag and Drop to the folder yyyymmdd-backup-emailaccount in &#8216;Local Folders&#8217;<br><br>Here too, it may take a few minutes to complete&#8230;<br><br>You have now a local copy of your emails (snapshot):<br>/home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/yyyymmdd-backup-emailaccount<br>/home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/yyyymmdd-backup-emailaccount.msf<br>/home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/yyyymmdd-backup-emailaccount.sbd<br><br>The good thing is that you get exactly the same IMAP folder&lt;>file names match.<br><br>It is recommended that you save/move the mbox .msf and .sbd files to a directory &#8216;yyyymmdd-backup-emailaccount&#8217; on a <span style="text-decoration: underline;">separate backup device</span><br><br><span style="text-decoration: underline;"><strong>Do NOT create this directory into /home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/</strong></span><br><br>Close and reopen Thunderbird application<br><br>If you want to restore your backup:<br>&#8211; Copy the three files back into /home/&lt;username>/.thunderbird/&lt;profile_folder>/Mail/Local Folders/<br>&#8211; Close and reopen Thunderbird application</p>



<p>Thank You Mozilla<br></p>



<p><br><br></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Thunderbird: Change default sort order and threaded view settings</title>
		<link>https://itec4b.com/thunderbird-change-default-sort-order-and-threaded-view-settings/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Tue, 17 Jan 2023 19:51:20 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[thunderbird]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=150</guid>

					<description><![CDATA[https://support.mozilla.org/en-US/kb/config-editor Menu Edit &#62; Settings &#62; General &#62; Config Editor… Sort By Date&#160;&#160;&#160;Advanced Preferences&#160;&#160;&#160;mailnews.default_sort_type&#160;&#160;&#160;18 Sort Order&#160;&#160;&#160;1 (ascending)&#160;&#160;&#160;2 (descending)&#160;&#160;&#160;Advanced Preferences&#160;&#160;&#160;mailnews.default_sort_order&#160;&#160;&#160;2 Enable Threaded View&#160;&#160;&#160;0 (unthreaded)&#160;&#160;&#160;1 (threaded)&#160;&#160;&#160;Advanced Preferences&#160;&#160;&#160;mailnews.default_view_flags &#160;&#160;&#160;1]]></description>
										<content:encoded><![CDATA[
<p><a href="https://support.mozilla.org/en-US/kb/config-editor">https://support.mozilla.org/en-US/kb/config-editor</a></p>



<p>Menu Edit &gt; Settings &gt; General &gt; Config Editor…</p>



<p><strong>Sort By Date</strong><br>&nbsp;&nbsp;&nbsp;Advanced Preferences&nbsp;&nbsp;&nbsp;<strong>mailnews.default_sort_type&nbsp;&nbsp;&nbsp;18</strong></p>



<p><strong>Sort Order</strong>&nbsp;&nbsp;&nbsp;1 (ascending)&nbsp;&nbsp;&nbsp;2 (descending)<br>&nbsp;&nbsp;&nbsp;Advanced Preferences&nbsp;&nbsp;&nbsp;<strong>mailnews.default_sort_order&nbsp;&nbsp;&nbsp;2</strong></p>



<p><strong>Enable Threaded View</strong>&nbsp;&nbsp;&nbsp;0 (unthreaded)&nbsp;&nbsp;&nbsp;1 (threaded)<br>&nbsp;&nbsp;&nbsp;Advanced Preferences&nbsp;&nbsp;&nbsp;<strong>mailnews.default_view_flags</strong>   <strong>&nbsp;&nbsp;&nbsp;1</strong></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Thunderbird: Auto update all IMAP folders/subfolders</title>
		<link>https://itec4b.com/thunderbird-auto-update-all-imap-folders-subfolders/</link>
		
		<dc:creator><![CDATA[author]]></dc:creator>
		<pubDate>Tue, 17 Jan 2023 18:56:01 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[thunderbird]]></category>
		<guid isPermaLink="false">https://itec4b.com/?p=147</guid>

					<description><![CDATA[https://support.mozilla.org/en-US/kb/config-editor Menu Edit &#62; Settings &#62; General &#62; Config Editor… Advanced Preferences&#160;&#160;&#160;mail.server.default.check_all_folders_for_new &#160;&#160;&#160;true]]></description>
										<content:encoded><![CDATA[
<p><a href="https://support.mozilla.org/en-US/kb/config-editor">https://support.mozilla.org/en-US/kb/config-editor</a></p>



<p>Menu Edit &gt; Settings &gt; General &gt; Config Editor…</p>



<p>Advanced Preferences&nbsp;&nbsp;&nbsp;<strong>mail.server.default.check_all_folders_for_new</strong>   <strong>&nbsp;&nbsp;&nbsp;true</strong></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
