1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101
|
<html lang="en">
<head>
<title>mpop 1.0.5</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="mpop 1.0.5">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual was last updated November 6, 2006 for version
1.0.5 of mpop.
Copyright (C) 2005, 2006 Martin Lambers
This program, including this manual, is free software; you can
redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option)
any later version.
This program, including this manual, is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<h1 class="settitle">mpop 1.0.5</h1>
<div class="contents">
<h2>Table of Contents</h2>
<ul>
<li><a name="toc_Top" href="#Top">mpop</a>
<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
<li><a name="toc_Configuration-file" href="#Configuration-file">2 Configuration file</a>
<ul>
<li><a href="#Configuration-file">2.1 General commands</a>
<li><a href="#Configuration-file">2.2 Authentication commands</a>
<li><a href="#Configuration-file">2.3 TLS commands</a>
<li><a href="#Configuration-file">2.4 Commands specific to mail retrieval mode</a>
</li></ul>
<li><a name="toc_Invocation" href="#Invocation">3 Invocation</a>
<ul>
<li><a href="#Invocation">3.1 Synopsis</a>
<li><a href="#Invocation">3.2 Exit code</a>
<li><a href="#Invocation">3.3 Environment / Files</a>
<li><a href="#Invocation">3.4 Options</a>
<ul>
<li><a href="#Invocation">3.4.1 General options</a>
<li><a href="#Invocation">3.4.2 Changing the mode of operation</a>
<li><a href="#Invocation">3.4.3 Configuration options</a>
<li><a href="#Invocation">3.4.4 Options specific to mail retrieval mode</a>
</li></ul>
</li></ul>
<li><a name="toc_POP3-features" href="#POP3-features">4 POP3 features</a>
<ul>
<li><a href="#Transport-Layer-Security">4.1 Transport Layer Security</a>
<li><a href="#Authentication">4.2 Authentication</a>
<li><a href="#Pipelining">4.3 Pipelining</a>
<li><a href="#Defective-POP3-servers">4.4 Defective POP3 servers</a>
</li></ul>
<li><a name="toc_Mail-retrieval-mode" href="#Mail-retrieval-mode">5 Mail retrieval mode</a>
<li><a name="toc_Server-information-mode" href="#Server-information-mode">6 Server information mode</a>
<li><a name="toc_Filtering" href="#Filtering">7 Filtering</a>
<li><a name="toc_Examples" href="#Examples">8 Examples</a>
<ul>
<li><a href="#A-configuration-file">8.1 A configuration file</a>
<li><a href="#Filtering-with-SpamAssassin">8.2 Filtering with SpamAssassin</a>
</li></ul>
<li><a name="toc_Development" href="#Development">9 Development</a>
</li></ul>
</div>
<div class="node">
<p><hr>
<a name="Top"></a>
Next: <a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
</div>
<h2 class="unnumbered">mpop</h2>
<p>This manual was last updated November 6, 2006 for version
1.0.5 of mpop.
<p>Copyright (C) 2005, 2006 Martin Lambers
<blockquote>
This program, including this manual,
is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
<p>This program, including this manual,
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<p>You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</blockquote>
<ul class="menu">
<li><a accesskey="1" href="#Introduction">Introduction</a>: Basic concepts.
<li><a accesskey="2" href="#Configuration-file">Configuration file</a>: Configuration file commands.
<li><a accesskey="3" href="#Invocation">Invocation</a>: Command line options.
<li><a accesskey="4" href="#POP3-features">POP3 features</a>: Explanation of various POP3 features.
<li><a accesskey="5" href="#Mail-retrieval-mode">Mail retrieval mode</a>: How to retrieve mail.
<li><a accesskey="6" href="#Filtering">Filtering</a>: How to filter mails.
<li><a accesskey="7" href="#Server-information-mode">Server information mode</a>: How to obtain information about
an POP3 server.
<li><a accesskey="8" href="#Examples">Examples</a>: Usage examples.
<li><a accesskey="9" href="#Development">Development</a>: About the development process.
</ul>
<div class="node">
<p><hr>
<a name="Introduction"></a>
Next: <a rel="next" accesskey="n" href="#Configuration-file">Configuration file</a>,
Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">1 Introduction</h2>
<p>mpop is a POP3 client.
<p>In its default mode of operation, it retrieves mails from one or more POP3
mailboxes, optionally does some filtering, and delivers them through a mail
delivery agent (MDA) or to maildir folders or mbox files. Mails that were
successfully delivered before will not be retrieved a second time, even if
errors occur or mpop is terminated in the middle of a session.
<p>The best way to start is probably to have a look at the Examples section.
See <a href="#Examples">Examples</a>.
<p>In addition to the mail retrieval mode, mpop can be used in server information
mode. In this mode, mpop prints as much information as it can get about a given
POP3 server (greeting, supported features, login delay, maximum mail size,
<small class="dots">...</small>).
<p>Normally, a configuration file contains information about which POP3 server to
use and how to use it, but almost all settings can also be configured on the
command line.
<p>POP3 server information is organized in accounts. Each account describes one
POP3 server: host name, authentication settings, TLS settings, and so on.
Each configuration file can define multiple accounts.
<p>Supported features include:
<ul>
<li>Header based mail filtering: filter junk mail before downloading it
<li>Delivery to mbox files, maildir folders or a mail delivery agent (MDA)
<li>Very fast POP3 implementation, using command pipelining
<li>Authentication methods USER/PASS, APOP, PLAIN, LOGIN and CRAM-MD5 (and
GSSAPI, DIGEST-MD5, and NTLM when GNU SASL is used)
<li>TLS encrypted connections (including server certificate verification and
the possibility to send a client certificate)
<li>Support for Internationalized Domain Names (IDN)
<li>IPv6 support
<li>support for multiple accounts
</ul>
<div class="node">
<p><hr>
<a name="Configuration-file"></a>
Next: <a rel="next" accesskey="n" href="#Invocation">Invocation</a>,
Previous: <a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">2 Configuration file</h2>
<p>If it exists and is readable, a user configuration file will be loaded
(<code>~/.mpoprc</code> by default). This file must have no more permissions
than user read/write. Configuration file settings can be changed by command
line options.
<p>A configuration file is a simple text file. Empty lines and comment lines
(whose first non-blank character is '#') are ignored. Every other line must
contain a command and may contain an argument to that command.
The argument may be enclosed in double quotes (").
<p>If the first character of a filename is the tilde (~), this tilde will be
replaced by <code>$HOME</code>.
<p>If a command accepts the argument `<samp><span class="samp">on</span></samp>', it also accepts an empty argument
and treats that as if it was `<samp><span class="samp">on</span></samp>'.
<p>Commands form groups. Each group starts with the `<samp><span class="samp">account</span></samp>' command and
defines the settings for one POP3 server.
<p>See <a href="#Examples">Examples</a>.
<h3 class="section">2.1 General commands</h3>
<dl>
<a name="defaults"></a>
<dt>`<samp><span class="samp">defaults</span></samp>'<dd><a name="index-defaults-1"></a>Set defaults. The following configuration commands will set default values for
all following account definitions.
<a name="account"></a>
<br><dt>`<samp><span class="samp">account </span><var>name</var><span class="samp"> [ : </span><var>account</var><span class="samp">[,...] ]</span></samp>'<dd><a name="index-account-2"></a>Start a new account definition with the given name. The current default values
are filled in (see <a href="#defaults">defaults</a>).<br>
If a colon and a list of previously defined accounts is given after the account
name, the new account, with the filled in default values, will inherit all
settings from the accounts in the list.
<a name="host"></a>
<br><dt>`<samp><span class="samp">host </span><var>hostname</var></samp>'<dd><a name="index-host-3"></a>The POP3 server to retrieve mails from.
The argument may be a host name or a network address.
Every account definition must contain this command.
<a name="port"></a>
<br><dt>`<samp><span class="samp">port </span><var>number</var></samp>'<dd><a name="index-port-4"></a>The port that the POP3 server listens on. The default is 110, unless TLS without
STARTTLS is used, in which case it is 995.
<a name="timeout"></a>
<br><dt>`<samp><span class="samp">timeout (off|</span><var>seconds</var><span class="samp">)</span></samp>'<dd><a name="index-timeout-5"></a>Set or unset a network timeout, in seconds. The argument `<samp><span class="samp">off</span></samp>' means that
no timeout will be set, which means that the operating system default will be
used.
<a name="pipelining"></a>
<br><dt>`<samp><span class="samp">pipelining (on|off)</span></samp>'<dd><a name="index-pipelining-6"></a>Enable or disable POP3 pipelining for obsolete servers. Modern servers can tell
mpop if they support pipelining, so this command is usually ignored.
See <a href="#Pipelining">Pipelining</a>.
</dl>
<h3 class="section">2.2 Authentication commands</h3>
<p>See <a href="#Authentication">Authentication</a>.
<dl>
<a name="auth"></a>
<dt>`<samp><span class="samp">auth [(on|</span><var>method</var><span class="samp">)]</span></samp>'<dd><a name="index-auth-7"></a>This command chooses the POP3 authentication method. With the argument
`<samp><span class="samp">on</span></samp>', mpop will choose the best one available for you (see below). This is
the default. Accepted methods are `<samp><span class="samp">user</span></samp>', `<samp><span class="samp">apop</span></samp>', `<samp><span class="samp">plain</span></samp>',
`<samp><span class="samp">cram-md5</span></samp>', `<samp><span class="samp">digest-md5</span></samp>', `<samp><span class="samp">gssapi</span></samp>', `<samp><span class="samp">external</span></samp>',
`<samp><span class="samp">login</span></samp>', and `<samp><span class="samp">ntlm</span></samp>'. See <a href="#Authentication">Authentication</a>.<br>
<a name="user"></a>
<br><dt>`<samp><span class="samp">user [</span><var>username</var><span class="samp">]</span></samp>'<dd><a name="index-user-8"></a>Set your user name for POP3 authentication. An empty argument unsets the user
name.
<a name="password"></a>
<br><dt>`<samp><span class="samp">password [</span><var>secret</var><span class="samp">]</span></samp>'<dd><a name="index-password-9"></a>Set your password for POP3 authentication. An empty argument unsets the
password.
If no password is set but one is needed during authentication, mpop will try to
find it in <code>~/.netrc</code>, and if that fails, will prompt you for it.
See <a href="#Authentication">Authentication</a>.
<a name="ntlmdomain"></a>
<br><dt>`<samp><span class="samp">ntlmdomain [</span><var>ntlmdomain</var><span class="samp">]</span></samp>'<dd><a name="index-ntlmdomain-10"></a>Set a domain for the `<samp><span class="samp">ntlm</span></samp>' authentication method. The default is to use
no domain (equivalent to an empty argument), but some servers seem to require
one, even if it is an arbitrary string.
</dl>
<h3 class="section">2.3 TLS commands</h3>
<p>See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<dl>
<a name="tls"></a>
<dt>`<samp><span class="samp">tls [(on|off)]</span></samp>'<dd><a name="index-tls-11"></a>This command enables or disables TLS/SSL encrypted connections to the POP3
server. Not every server supports TLS, and many that do require the
`<samp><span class="samp">tls_starttls off</span></samp>' command. It is recommended to also use the
`<samp><span class="samp">tls_trust_file</span></samp>' command. See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005fstarttls"></a>
<br><dt>`<samp><span class="samp">tls_starttls [(on|off)]</span></samp>'<dd><a name="index-tls_005fstarttls-12"></a>This command enables or disables the use of the STARTTLS POP3 command to start
TLS encryption. It is enabled by default.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005ftrust_005ffile"></a>
<br><dt>`<samp><span class="samp">tls_trust_file [</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-tls_005ftrust_005ffile-13"></a>This command activates strict server certificate verification.
The given file must contain one or more certificates of trusted Certification
Authorities (CAs) in PEM format. An empty argument disables this feature.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005fkey_005ffile"></a>
<br><dt>`<samp><span class="samp">tls_key_file [</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-tls_005fkey_005ffile-14"></a>This command (together with the `<samp><span class="samp">tls_cert_file</span></samp>') command enables mpop to
send a client certificate to the POP3 server if requested.
The file must contain the private key of a certificate in PEM format.
An empty argument disables this feature.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005fcert_005ffile"></a>
<br><dt>`<samp><span class="samp">tls_cert_file [</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-tls_005fcert_005ffile-15"></a>This command (together with the `<samp><span class="samp">tls_key_file</span></samp>' command) enables mpop to
send a client certificate to the POP3 server if requested.
The file must contain a certificate in PEM format.
An empty argument disables this feature.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005fcertcheck"></a>
<br><dt>`<samp><span class="samp">tls_certcheck [(on|off)]</span></samp>'<dd><a name="index-tls_005fcertcheck-16"></a>This command enables or disables sanity checks for the server certificate.
These checks are enabled by default, but can cause difficulties in rare cases.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<a name="tls_005fforce_005fsslv3"></a>
<br><dt>`<samp><span class="samp">tls_force_sslv3 [(on|off)]</span></samp>'<dd><a name="index-tls_005fforce_005fsslv3-17"></a>Force TLS/SSL version SSLv3. This might be needed to use SSL with some old and
broken servers. Do not use this unless you have to.
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
</dl>
<h3 class="section">2.4 Commands specific to mail retrieval mode</h3>
<p>See <a href="#Mail-retrieval-mode">Mail retrieval mode</a>.
<dl>
<a name="delivery"></a>
<dt>`<samp><span class="samp">delivery </span><var>method</var> <var>method_arguments<small class="dots">...</small></var></samp>'<dd><a name="index-delivery-18"></a>How to deliver messages received from this account.
<ul>
<li>delivery mda <var>command</var><br>
Deliver the mails through a mail delivery agent (MDA).<br>
All occurences of <code>%F</code> in the command will be replaced with the envelope
from address of the current message (or MAILER-DAEMON if none is found). Note
that this address is guaranteed to contain only letters <code>a-z</code> and
<code>A-Z</code>, digits <code>0-9</code>, and any of <code>.@_-+/</code>, even though that is
only a subset of what is theoretically allowed in a mail address. Other
characters, including those interpreted by the shell, are replaced with
<code>_</code>. Nevertheless, you should put <code>%F</code> into single quotes:
<code>'%F'</code>.<br>
Use <code>delivery mda "/usr/bin/procmail -f '%F' -d $USER"</code> for the procmail
MDA.<br>
Use <code>delivery mda "/usr/sbin/sendmail -oi -oem -f '%F' -- $USER"</code> to let
your MTA handle the mail.<br>
Use <code>delivery mda /usr/local/bin/msmtp --host=localhost --from='%F' --
$USER@`hostname`.`dnsdomainname`"</code> to pass the mail to your MTA via SMTP.
(This is what fetchmail does by default.)
<li>delivery maildir <var>directory</var><br>
Deliver the mails to the given maildir directory. The directory must exist and
it must be a valid maildir directory; mpop will not create directories.
<li>delivery mbox <var>mbox-file</var><br>
Deliver the mails to the given file in mbox format. The file will be locked
with <code>fcntl(2)</code>. mpop uses the MBOXRD mbox format variant; see the
documentation of the mbox format.
</ul>
If the delivery method needs to parse the mail headers for an envelope from
address (the mda method if the command contains <code>%F</code>, and the mbox method),
then it needs to create a temporary file to store the mail headers (but not the
body) in. See <code>$TMPDIR</code> in <a href="#Environment-_002f-Files">Environment / Files</a>.
<a name="uidls_005ffile"></a>
<br><dt>`<samp><span class="samp">uidls_file </span><var>filename</var></samp>'<dd><a name="index-uidls_005ffile-19"></a>The file to store UIDLs in. These are needed to identify new messages.
<code>%U</code> in the filename will be replaced by the username of the current
account. <code>%H</code> in the filename will be replaced by the hostname of the
current account. If the filename contains directories that do not exist, mpop
will create them. mpop locks this file for exclusive access when accessing the
associated POP3 account.<br>
The default value is <code>~/.mpop_uidls/%U_at_%H</code>. You can also use a single
UIDLS file for multiple accounts, but then you cannot poll more than one of
these accounts at the same time.
<a name="only_005fnew"></a>
<br><dt>`<samp><span class="samp">only_new [(on|off)]</span></samp>'<dd><a name="index-only_005fnew-20"></a>By default, mpop processes only new messages (new messages are those that were
not already successfully retrieved in an earlier session). If this option is
turned off, mpop will process all messages.
<a name="keep"></a>
<br><dt>`<samp><span class="samp">keep [(on|off)]</span></samp>'<dd><a name="index-keep-21"></a>Keep all mails on the POP3 server, never delete them. The default behavior is
to delete mails that have been successfully delivered or filtered by kill
filters.
<a name="killsize"></a>
<br><dt>`<samp><span class="samp">killsize (off|</span><var>size</var><span class="samp">)</span></samp>'<dd><a name="index-killsize-22"></a>Mails larger than the given size will be deleted, not downloaded (unless the
keep command is used, in which case they will just be skipped). The size
argument must be zero or greater. If it is followed by a 'k' or an 'm', the
size is measured in kilobytes/megabytes instead of bytes. Note that some POP3
servers report slightly incorrect sizes for mails. See <a href="#Filtering">Filtering</a>.
<a name="skipsize"></a>
<br><dt>`<samp><span class="samp">skipsize (off|</span><var>size</var><span class="samp">)</span></samp>'<dd><a name="index-skipsize-23"></a>Mails larger than the given size will be skipped (not downloaded). The size
argument must be zero or greater. If it is followed by a 'k' or an 'm', the
size is measured in kilobytes/megabytes instead of bytes. Note that some POP3
servers report slightly incorrect sizes for mails. See <a href="#Filtering">Filtering</a>.
<a name="filter"></a>
<br><dt>`<samp><span class="samp">filter [</span><var>COMMAND</var><span class="samp">]</span></samp>'<dd><a name="index-filter-24"></a>Set a filter which will decide whether to retrieve, skip, or delete each mail
by investigating the mail's headers. The POP3 server must support the POP3 TOP
command for this to work; see <a href="#Server-information-mode">Server information mode</a>. An empty argument
disables filtering.<br>
All occurences of <code>%F</code> in the command will be replaced with the envelope
from address of the current message (or MAILER-DAEMON if none is found).
Note that this address is guaranteed to contain only letters <code>a-z</code> and
<code>A-Z</code>, digits <code>0-9</code>, and any of <code>.@_-+/</code>, even though that is
only a subset of what is theoretically allowed in a mail address. Other
characters, including those interpreted by the shell, are replaced with
<code>_</code>. Nevertheless, you should put <code>%F</code> into single quotes:
<code>'%F'</code>.<br>
All occurences of <code>%S</code> in the command will be replaced with the size of
the current mail as reported by the POP3 server.<br>
The mail headers (plus the blank line separating the headers from the body)
will be piped to the command. Based on the return code, mpop decides
what to do with the mail:
<ul>
<li>0: proceed normally; no special action
<li>1: delete the mail; do not retrieve it
<li>2: skip the mail; do not retrieve it
</ul>
Return codes greater than or equal to 3 mean that an error occurred. The
<code>sysexits.h</code> error codes may be used to give information about the kind of
the error, but this is not necessary. See <a href="#Filtering">Filtering</a>.
</dl>
<div class="node">
<p><hr>
<a name="Invocation"></a>
Next: <a rel="next" accesskey="n" href="#POP3-features">POP3 features</a>,
Previous: <a rel="previous" accesskey="p" href="#Configuration-file">Configuration file</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">3 Invocation</h2>
<h3 class="section">3.1 Synopsis</h3>
<ul>
<li>Mail retrieval mode (default):<br>
<code>mpop [</code><var>option</var><code>...] [--] [</code><var>account</var><code>...]</code><br>
<li>Server information mode:<br>
<code>mpop [</code><var>option</var><code>...] --serverinfo [</code><var>account</var><code>...]</code><br>
</ul>
<h3 class="section">3.2 Exit code</h3>
<p>The standard exit codes from <code>sysexits.h</code> are used.
<p><a name="Environment-_002f-Files"></a>
<h3 class="section">3.3 Environment / Files</h3>
<dl>
<dt>`<samp><code>~/.mpoprc</code></samp>'<dd>The default user configuration file.
<br><dt>`<samp><code>~/.mpop_uidls</code></samp>'<dd>Default directory to store UIDLs files in.
<br><dt>`<samp><code>~/.netrc</code></samp>'<dd>The <code>.netrc</code> file contains login information. If a password is not found
in the configuration file, msmtp will search it in <code>.netrc</code> before
prompting the user for it. The syntax of <code>.netrc</code> is described in the
<code>netrc(5)</code> or <code>ftp(1)</code> manual page.
<br><dt>`<samp><code>$USER</code><span class="samp">, </span><code>$LOGNAME</code></samp>'<dd>These variables override the user's login name. <code>$LOGNAME</code> is only used if
<code>$USER</code> is unset. The user's login name is used for <code>Received</code>
headers.
<br><dt>`<samp><code>$TMPDIR</code></samp>'<dd>Directory to create temporary files in. If this is unset, a system specific
default directory is used.<br>
</dl>
<h3 class="section">3.4 Options</h3>
<p>Options override configuration file settings. The following options are
accepted:
<h4 class="subsection">3.4.1 General options</h4>
<dl>
<dt>`<samp><span class="samp">--version</span></samp>'<dd><a name="index-g_t_002d_002dversion-25"></a>Print version information. This includes information about the library used for
TLS/SSL support (if any), the library used for authentication, and the
authentication mechanisms supported by this library.
<br><dt>`<samp><span class="samp">--help</span></samp>'<dd><a name="index-g_t_002d_002dhelp-26"></a>Print help.
<br><dt>`<samp><span class="samp">-P</span></samp>'<dt>`<samp><span class="samp">--pretend</span></samp>'<dd><a name="index-g_t_002dP-27"></a><a name="index-g_t_002d_002dpretend-28"></a>Print the configuration settings that would be used, but do not take further
action. An asterisk ('*') will be printed instead of the password.
<br><dt>`<samp><span class="samp">-d</span></samp>'<dt>`<samp><span class="samp">--debug</span></samp>'<dd><a name="index-g_t_002dd-29"></a><a name="index-g_t_002d_002ddebug-30"></a>Print lots of debugging information, including the whole conversation with the
POP3 server. Be careful with this option: the (potentially dangerous) output
will not be sanitized, and your password may get printed in an easily decodable
format!<br>
This option implies `<samp><span class="samp">--quiet</span></samp>', because the debugging output would otherwise
interfere with the normal output.
</dl>
<h4 class="subsection">3.4.2 Changing the mode of operation</h4>
<dl>
<a name="g_t_002d_002dserverinfo"></a>
<dt>`<samp><span class="samp">-S</span></samp>'<dt>`<samp><span class="samp">--serverinfo</span></samp>'<dd><a name="index-g_t_002dS-31"></a><a name="index-g_t_002d_002dserverinfo-32"></a>Print information about the POP3 server and exit. This includes information
about supported features (authentication methods, TOP command, <small class="dots">...</small>), about
parameters (time for which mails will not be deleted, minimum time between
logins, <small class="dots">...</small>), and about the TLS certificate (if TLS is active).
See <a href="#Server-information-mode">Server information mode</a>.
</dl>
<h4 class="subsection">3.4.3 Configuration options</h4>
<p>Most options in this category correspond to a configuration file command.
Please refer to <a href="#Configuration-file">Configuration file</a> for detailed information.
<dl>
<dt>`<samp><span class="samp">-C </span><var>filename</var></samp>'<dt>`<samp><span class="samp">--file=</span><var>filename</var></samp>'<dd><a name="index-g_t_002dC-33"></a><a name="index-g_t_002d_002dfile-34"></a>Use the given file instead of <code>~/.mpoprc</code> as the configuration file.
<dt>`<samp><span class="samp">--host=</span><var>hostname</var></samp>'<dd><a name="index-g_t_002d_002dhost-35"></a>Use this POP3 server with settings from the command line; do not use any
configuration file data. This option disables loading of the configuration
file. You cannot use both this option and account names on the command line.
<dt>`<samp><span class="samp">--port=</span><var>number</var></samp>'<dd><a name="index-g_t_002d_002dport-36"></a>Set the port number to connect to. See <a href="#port">port</a>.
<dt>`<samp><span class="samp">--timeout=(off|</span><var>seconds</var><span class="samp">)</span></samp>'<dd><a name="index-g_t_002d_002dtimeout-37"></a>Set or unset a network timeout, in seconds. See <a href="#timeout">timeout</a>.
<a name="g_t_002d_002dpipelining"></a>
<dt>`<samp><span class="samp">--pipelining=(on|off)</span></samp>'<dd><a name="index-g_t_002d_002dpipelining-38"></a>Enable or disable POP3 pipelining for obsolete servers. See <a href="#pipelining">pipelining</a>.
<a name="g_t_002d_002dauth"></a>
<dt>`<samp><span class="samp">--auth[=(on|</span><var>method</var><span class="samp">)]</span></samp>'<dd><a name="index-g_t_002d_002dauth-39"></a>Set the authentication method to automatic (with "on") or manually choose an
authentication method. See <a href="#auth">auth</a>.
<a name="g_t_002d_002duser"></a>
<dt>`<samp><span class="samp">--user=[</span><var>username</var><span class="samp">]</span></samp>'<dd><a name="index-g_t_002d_002duser-40"></a>Set or unset the user name for authentication. See <a href="#user">user</a>.
<dt>`<samp><span class="samp">--tls[=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002dtls-41"></a>Enable or disable TLS. See <a href="#tls">tls</a>.
<a name="g_t_002d_002dtls_002dstarttls"></a>
<dt>`<samp><span class="samp">--tls-starttls[=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dstarttls-42"></a>Enable or disable STARTTLS for TLS encryption. See <a href="#tls_005fstarttls">tls_starttls</a>.
<a name="g_t_002d_002dtls_002dtrust_002dfile"></a>
<dt>`<samp><span class="samp">--tls-trust-file=[</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dtrust_002dfile-43"></a>Set or unset a trust file for TLS encryption. See <a href="#tls_005ftrust_005ffile">tls_trust_file</a>.
<a name="g_t_002d_002dtls_002dkey_002dfile"></a>
<dt>`<samp><span class="samp">--tls-key-file=[</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dkey_002dfile-44"></a>Set or unset a key file for TLS encryption. See <a href="#tls_005fkey_005ffile">tls_key_file</a>.
<a name="g_t_002d_002dtls_002dcert_002dfile"></a>
<dt>`<samp><span class="samp">--tls-cert-file=[</span><var>file</var><span class="samp">]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dcert_002dfile-45"></a>Set or unset a cert file for TLS encryption. See <a href="#tls_005fcert_005ffile">tls_cert_file</a>.
<a name="g_t_002d_002dtls_002dcertcheck"></a>
<dt>`<samp><span class="samp">--tls-certcheck[=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dcertcheck-46"></a>Enable or disable server certificate checks for TLS encryption.
See <a href="#tls_005fcertcheck">tls_certcheck</a>.
<a name="g_t_002d_002dtls_002dforce_002dsslv3"></a>
<dt>`<samp><span class="samp">--tls-force-sslv3=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002dtls_002dforce_002dsslv3-47"></a>Force TLS/SSL version SSLv3. See <a href="#tls_005fforce_005fsslv3">tls_force_sslv3</a>.
</dl>
<h4 class="subsection">3.4.4 Options specific to mail retrieval mode</h4>
<dl>
<a name="g_t_002d_002dquiet"></a>
<dt>`<samp><span class="samp">-q</span></samp>'<dt>`<samp><span class="samp">--quiet</span></samp>'<dd><a name="index-g_t_002dq-48"></a><a name="index-g_t_002d_002dquiet-49"></a>Do not print progress information.
<a name="g_t_002d_002dall_002daccounts"></a>
<br><dt>`<samp><span class="samp">-a</span></samp>'<dt>`<samp><span class="samp">--all-accounts</span></samp>'<dd><a name="index-g_t_002da-50"></a><a name="index-g_t_002d_002dall_002daccounts-51"></a>Query all accounts in the configuration file.
<a name="g_t_002d_002dauth_002donly"></a>
<br><dt>`<samp><span class="samp">-A</span></samp>'<dt>`<samp><span class="samp">--auth-only</span></samp>'<dd><a name="index-g_t_002dA-52"></a><a name="index-g_t_002d_002dauth_002donly-53"></a>Authenticate only; do not retrieve mail. Useful for SMTP-after-POP.
<a name="g_t_002d_002dstatus_002donly"></a>
<br><dt>`<samp><span class="samp">-s</span></samp>'<dt>`<samp><span class="samp">--status-only</span></samp>'<dd><a name="index-g_t_002ds-54"></a><a name="index-g_t_002d_002dstatus_002donly-55"></a>Print number and size of mails in each account only; do not retrieve mail.
<a name="g_t_002d_002donly_002dnew"></a>
<br><dt>`<samp><span class="samp">-n</span></samp>'<dt>`<samp><span class="samp">--only-new[=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002donly_002dnew-56"></a>Process only new messages. See <a href="#only_005fnew">only_new</a>.
<a name="g_t_002d_002dkeep"></a>
<br><dt>`<samp><span class="samp">-k</span></samp>'<dt>`<samp><span class="samp">--keep[=(on|off)]</span></samp>'<dd><a name="index-g_t_002d_002dkeep-57"></a>Do not delete mails from POP3 servers, regardless of other options or settings.
See <a href="#keep">keep</a>.
<a name="g_t_002d_002dkillsize"></a>
<dt>`<samp><span class="samp">--killsize=(off|</span><var>size</var><span class="samp">)</span></samp>'<dd><a name="index-g_t_002d_002dkillsize-58"></a>Set or unset kill size. See <a href="#killsize">killsize</a>.
<a name="g_t_002d_002dskipsize"></a>
<dt>`<samp><span class="samp">--skipsize=(off|</span><var>size</var><span class="samp">)</span></samp>'<dd><a name="index-g_t_002d_002dskipsize-59"></a>Set or unset skip size. See <a href="#skipsize">skipsize</a>.
<a name="g_t_002d_002dfilter"></a>
<dt>`<samp><span class="samp">--filter=[</span><var>command</var><span class="samp">]</span></samp>'<dd><a name="index-g_t_002d_002dfilter-60"></a>Set a filter which will decide whether to retrieve, skip, or delete each mail by
investigating the mail's headers. See <a href="#filter">filter</a>.
<a name="g_t_002d_002ddelivery"></a>
<br><dt>`<samp><span class="samp">--delivery=</span><var>method</var><span class="samp">,</span><var>method_arguments<small class="dots">...</small></var></samp>'<dd><a name="index-g_t_002d_002ddelivery-61"></a>How to deliver messages received from this account. See <a href="#delivery">delivery</a>. Note that a
comma is used instead of a blank to separate the method from its arguments.
<a name="g_t_002d_002duidls_002dfile"></a>
<dt>`<samp><span class="samp">--uidls-file=</span><var>filename</var></samp>'<dd><a name="index-g_t_002d_002duidls_002dfile-62"></a>File to store UIDLs in. See <a href="#uidls_005ffile">uidls_file</a>.
</dl>
<div class="node">
<p><hr>
<a name="POP3-features"></a>
Next: <a rel="next" accesskey="n" href="#Mail-retrieval-mode">Mail retrieval mode</a>,
Previous: <a rel="previous" accesskey="p" href="#Invocation">Invocation</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">4 POP3 features</h2>
<ul class="menu">
<li><a accesskey="1" href="#Transport-Layer-Security">Transport Layer Security</a>: How to use TLS/SSL
<li><a accesskey="2" href="#Authentication">Authentication</a>: How to use authentication
<li><a accesskey="3" href="#Pipelining">Pipelining</a>: How to use POP3 pipelining
<li><a accesskey="4" href="#Defective-POP3-servers">Defective POP3 servers</a>: Common defectives of POP3 servers
</ul>
<div class="node">
<p><hr>
<a name="Transport-Layer-Security"></a>
Next: <a rel="next" accesskey="n" href="#Authentication">Authentication</a>,
Up: <a rel="up" accesskey="u" href="#POP3-features">POP3 features</a>
</div>
<h3 class="section">4.1 Transport Layer Security</h3>
<p>Quoting from RFC2246 - the TLS 1.0 protocol specification:<br>
"The TLS protocol provides communications privacy over the Internet.
The protocol allows client/server applications to communicate in a way that
is designed to prevent eavesdropping, tampering, or message forgery."
<p>POP3 servers can use TLS in one of two modes:
<ul>
<li>Immediately<br>
This is known as POP3 tunneled through TLS. The default port for this mode is
995 (pop3s).
<li>Via the STARTTLS POP3 command<br>
The POP3 session begins normally. The client sends the STLS command when it
wishes to begin TLS encryption. The default port for this mode is the default
POP3 port: 110 (pop3).
</ul>
mpop can switch between these modes with the `<samp><span class="samp">tls_starttls</span></samp>' command (see
<a href="#tls_005fstarttls">tls_starttls</a>) command or the `<samp><span class="samp">--tls-starttls</span></samp>' option (see
<a href="#g_t_002d_002dtls_002dstarttls">–tls-starttls</a>).
<p>When TLS is started, the server sends a certificate to identify itself. This
certificate contains information about the certificate owner, the certificate
issuer, and the activation and expiration times of the certificate. This
information can be displayed in server information mode.
See <a href="#Server-information-mode">Server information mode</a>.
<p>Some sanity checks are done with the server certificate. These include:
<ul>
<li>Does the certificate belong to the host name of the POP3 server?
<li>Is the certificate activated?
<li>Is the certificate still valid, or has it expired?
</ul>
Sometimes one of these checks fail. mpop will abort the connection in this
case. If the user still wants to use this POP3 server with TLS, the sanity
checks can be switched off with `<samp><span class="samp">tls_certcheck</span></samp>' or `<samp><span class="samp">--tls-certcheck</span></samp>'
(see <a href="#tls_005fcertcheck">tls_certcheck</a>, <a href="#g_t_002d_002dtls_002dcertcheck">–tls-certcheck</a>).
<p>Note that the POP3 server cannot be fully trusted just because the certificate
passes the sanity checks. To verify that the user can trust the POP3 server,
it is necessary to use a (list of) certificates of Certification Authorities
(CAs) that are trusted. If mpop can verify that the server certificate was
issued by one of these CAs, then the POP3 server is trusted.
A file containing CA certificates can be set with `<samp><span class="samp">tls_trust_file</span></samp>' or
`<samp><span class="samp">--tls-trust-file</span></samp>' (see <a href="#tls_005ftrust_005ffile">tls_trust_file</a>, <a href="#g_t_002d_002dtls_002dtrust_002dfile">–tls-trust-file</a>).
<p>If the server requests it, the client can send a certificate, too. This allows
the server to verify the identity of the client. See the EXTERNAL mechanism in
<a href="#Authentication">Authentication</a>. The `<samp><span class="samp">tls_key_file</span></samp>'/`<samp><span class="samp">tls_cert_file</span></samp>' commands or
the `<samp><span class="samp">--tls-key-file</span></samp>'/`<samp><span class="samp">--tls-cert-file</span></samp>' options can be used to set a
client certificate. See <a href="#tls_005fkey_005ffile">tls_key_file</a>/<a href="#g_t_002d_002dtls_002dkey_002dfile">–tls-key-file</a>,
<a href="#tls_005fcert_005ffile">tls_cert_file</a>/<a href="#g_t_002d_002dtls_002dcert_002dfile">–tls-cert-file</a>.
Note that GnuTLS will only send a client certificate if it matches one of the
CAs advertised by the server. If you set a client certificate but it is not send
to the server, probably does not match any CA that the server trusts.
<div class="node">
<p><hr>
<a name="Authentication"></a>
Next: <a rel="next" accesskey="n" href="#Pipelining">Pipelining</a>,
Previous: <a rel="previous" accesskey="p" href="#Transport-Layer-Security">Transport Layer Security</a>,
Up: <a rel="up" accesskey="u" href="#POP3-features">POP3 features</a>
</div>
<h3 class="section">4.2 Authentication</h3>
<p>POP3 servers require a client to authenticate itself before it is allowed to
retrieve mail.
<p>Multiple authentication methods exist. Most POP3 servers support only some of
them. Some methods send authentication data in plain text (or nearly plain
text) to the server. These methods should only be used when TLS is active to
prevent others from stealing the password. See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<p>mpop supports the following authentication methods:
<ul>
<li>`<samp><span class="samp">USER</span></samp>'<br>
This authentication method needs a user name and a password.
Both are send in plain text. All POP3 servers support this authentication
method.
<li>`<samp><span class="samp">APOP</span></samp>'<br>
This authentication method needs a user name and a password.
The authentication data is not sent in plain text, which means this method can
safely be used without TLS.
<li>`<samp><span class="samp">PLAIN</span></samp>'<br>
This authentication method needs a user name and a password.
Both are send in BASE64 encoding, which can be easily decoded to plain text.
<li>`<samp><span class="samp">CRAM-MD5</span></samp>'<br>
This authentication method needs a user name and a password.
The authentication data is not sent in plain text, which means this method can
safely be used without TLS.
<li>`<samp><span class="samp">DIGEST-MD5</span></samp>'<br>
This authentication method needs a user name and a password.
The authentication data is not sent in plain text, which means this method can
safely be used without TLS.
<li>`<samp><span class="samp">GSSAPI</span></samp>'<br>
This authentication method needs a user name. The Kerberos framework takes care
of secure authentication, therefore this method can safely be used without TLS.
<li>`<samp><span class="samp">EXTERNAL</span></samp>'<br>
This is a special authentication method: The actual authentication happens
outside of the POP3 protocol, typically by sending a TLS client certificate
(see <a href="#Transport-Layer-Security">Transport Layer Security</a>).<br>
The EXTERNAL method merely confirms that this authentication succeeded for the
given user (or, if no user name is given, confirms that authentication
succeeded). Thus it may not be necessary for authentication to use this method,
and if the server does not support the EXTERNAL method, this does not mean that
it does not support authentication with TLS client certificates.<br>
This authentication method is not chosen automatically; you have to request it
manually.<br>
Note: (SMTP) Sendmail 8.12.11 advertises the EXTERNAL mechanism only after a
TLS client certificate has been send. It seems to ignore the optional user
name. Does anyone know more about this?
<li>`<samp><span class="samp">LOGIN</span></samp>'<br>
This is a non-standard authentication method similar to (but worse than) PLAIN.
It needs a user name and a password, both of which are send in BASE64 encoding,
which can be easily decoded to plain text.
<li>`<samp><span class="samp">NTLM</span></samp>'<br>
This is an obscure non-standard authentication method. It needs a user name and
a password and in some cases a special domain parameter (see <a href="#ntlmdomain">ntlmdomain</a>).
The authentication data is not send in plain text.
</ul>
<p>It depends on the underlying authentication library and its version whether a
particular method is supported or not. Use <samp><span class="option">--version</span></samp> to find out which
methods are supported by your version of mpop.
<p>Authentication data can be set with the `<samp><span class="samp">user</span></samp>' and `<samp><span class="samp">password</span></samp>' commands
or with the `<samp><span class="samp">--user</span></samp>' option. See <a href="#user">user</a>, <a href="#password">password</a>, <a href="#g_t_002d_002duser">–user</a>.
If no password is set but one is needed during authentication, mpop will try to
find it in <code>~/.netrc</code>, and if that fails, mpop will prompt you for it.
<p>The authentication method can be chosen with the `<samp><span class="samp">auth</span></samp>' command or
`<samp><span class="samp">--auth</span></samp>' option, but it is usually sufficient to just use the `<samp><span class="samp">on</span></samp>'
argument to let mpop choose the method itself. See <a href="#auth">auth</a>, <a href="#g_t_002d_002dauth">–auth</a>.
<p>If mpop chooses the method itself, it will not choose a method that sends
plain text authentication data when TLS is not active. This means that only
APOP, CRAM-MD5, DIGEST-MD5, GSSAPI, and NTLM are available when TLS is inactive.
USER, PLAIN and LOGIN are only available when TLS is active.
If you really want to send clear text authentication data, you have to force
mpop to do that by setting the authentication method to USER, PLAIN or LOGIN
while TLS is off.
<div class="node">
<p><hr>
<a name="Pipelining"></a>
Next: <a rel="next" accesskey="n" href="#Defective-POP3-servers">Defective POP3 servers</a>,
Previous: <a rel="previous" accesskey="p" href="#Authentication">Authentication</a>,
Up: <a rel="up" accesskey="u" href="#POP3-features">POP3 features</a>
</div>
<h3 class="section">4.3 Pipelining</h3>
<p>A POP3 client that sends multiple POP3 commands at once to a POP3 server before
starting to read the server's answers is using POP3 pipelining. Since the client
does not have to wait for the server's answer before sending the next command,
and the server does not have to wait for the next command from the client,
pipelining can speed up a POP3 session substantially.
<p>Pipelining in mpop works by sending up to `<samp><span class="samp">PIPELINE_MAX</span></samp>' commands to the
server, then begin to read its answers, and refill the command pipeline when the
number of unanswered commands drops to `<samp><span class="samp">PIPELINE_MIN</span></samp>'. `<samp><span class="samp">PIPELINE_MIN</span></samp>'
and `<samp><span class="samp">PIPELINE_MAX</span></samp>' are compile time constants.
<p>mpop can enable or disable POP3 pipelining automatically if the server supports
the CAPA command; see <a href="#Server-information-mode">Server information mode</a>.
<p>If your server does not support the CAPA command, but you still want to use
pipelining, you have to enable it manually with the `<samp><span class="samp">pipelining</span></samp>' command
or `<samp><span class="samp">--pipelining</span></samp>' option. See <a href="#pipelining">pipelining</a>, <a href="#g_t_002d_002dpipelining">–pipelining</a>.
<div class="node">
<p><hr>
<a name="Defective-POP3-servers"></a>
Previous: <a rel="previous" accesskey="p" href="#Pipelining">Pipelining</a>,
Up: <a rel="up" accesskey="u" href="#POP3-features">POP3 features</a>
</div>
<h3 class="section">4.4 Defective POP3 servers</h3>
<p>Some POP3 servers still do not support the UIDL command. In this case, mpop
cannot recognize messages that were already successfully retrieved, and will
treat all messages as new. Use the `<samp><span class="samp">--serverinfo</span></samp>' option to find out if a
server supports the UIDL command.
<p>Some POP3 servers count end-of-line characters as two bytes (CRLF) instead
of one (LF), so that the size of a mail as reported by the POP3 server is
slightly larger than the actual size. This has the following consequences:
The size filters are not accurate. Do not rely on exact size filtering.
The progress output may display inaccurate (slightly too low) percentage values
for the first mail retrieved from a POP3 server. mpop will detect this after
the first mail has been read and will display corrected values for subsequent
mails.
<div class="node">
<p><hr>
<a name="Mail-retrieval-mode"></a>
Next: <a rel="next" accesskey="n" href="#Filtering">Filtering</a>,
Previous: <a rel="previous" accesskey="p" href="#POP3-features">POP3 features</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">5 Mail retrieval mode</h2>
<p>In this mode, mpop retrieves mail from one or more POP3 servers. It delivers
each of them using the method that was given with the `<samp><span class="samp">delivery</span></samp>' command
or `<samp><span class="samp">--delivery</span></samp>' option. See <a href="#delivery">delivery</a>, <a href="#g_t_002d_002ddelivery">–delivery</a>.
<p>While retrieving the mail, mpop displays approximate progress information,
which can be turned off with the `<samp><span class="samp">--quiet</span></samp>' option; see <a href="#g_t_002d_002dquiet">–quiet</a>.
<p>If the delivery succeeded, the mail is deleted from the POP3 server by default.
The `<samp><span class="samp">keep</span></samp>' command and `<samp><span class="samp">--keep</span></samp>' option can prevent the deletion of
mails; see <a href="#keep">keep</a>, <a href="#g_t_002d_002dkeep">–keep</a>.
<p><em>Important note:</em> Some POP3 servers will delete mails without any user
interaction. See EXPIRE in <a href="#Server-information-mode">Server information mode</a>. mpop can do nothing
about that.
<p>If you don't want to download certain mails, but skip them or delete them
directly, you can do filtering based on the mail headers. See <a href="#Filtering">Filtering</a>.
<p>If you just want to know if you have new mails (and how many), use the
`<samp><span class="samp">--status-only</span></samp>' option. See <a href="#g_t_002d_002dstatus_002donly">–status-only</a>.
<p>If you just want to authenticate to the POP3 server, but don't want to look at
your mails, use the `<samp><span class="samp">--auth-only</span></samp>' option. See <a href="#g_t_002d_002dauth_002donly">–auth-only</a>. This can be
useful for sending mail through SMTP servers that require SMTP-after-POP
(aka POP-before-SMTP).
<p>Before mpop delivers a mail, it prepends a Received header to it. This is
necessary if the delivery method transmits the mail to an SMTP server, for
example. mpop does not change the contents of the mail in any other way.
<div class="node">
<p><hr>
<a name="Server-information-mode"></a>
Next: <a rel="next" accesskey="n" href="#Examples">Examples</a>,
Previous: <a rel="previous" accesskey="p" href="#Filtering">Filtering</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">6 Server information mode</h2>
<p>In server information mode, mpop prints as much information about the POP3
server as it can get and then exits.
<p>The POP3 features that can be detected are:
<ul>
<li>IMPLEMENTATION<br>
The implementation string of the POP3 server.
<li>CAPA<br>
Support for the POP3 CAPA command. The server sends a list of its capabilities
in response to this command.
<li>PIPELINING<br>
Support for POP3 pipelining. See <a href="#Pipelining">Pipelining</a>.
<li>TOP<br>
Support for the POP3 TOP command. This is needed for header based filtering to
work. See <a href="#Filtering">Filtering</a>.
<li>UIDL<br>
Support for the POP3 UIDL command. This is needed to distinguish between new and
already retrieved messages.
<li>LOGIN-DELAY<br>
The minimum time between two POP3 sessions. The server may refuse a POP3 session
if the last one was active less than this time period ago.
<li>EXPIRE<br>
The time after which old mails are deleted by the POP3 server.
<ul>
<li>NEVER: The POP3 server will not delete mail without the user requesting
it.
<li>0: The POP3 server will not keep mails; all mails will be deleted after
they have been downloaded, regardless of the user's wishes.
<li><var>number</var>: The number of days that the POP3 server will keep mails
before deleting them without user interaction.
</ul>
<li>STARTTLS<br>
See <a href="#Transport-Layer-Security">Transport Layer Security</a>.
<li>AUTH<br>
See <a href="#Authentication">Authentication</a>.
<li>RESP-CODES<br>
If authentication fails and the POP3 server issues an error message beginning
with a square bracket, this message will include additional information about
the source of the error:
<ul>
<li><code>[LOGIN-DELAY]</code>: The login delay period hast not yet expired.
<li><code>[IN-USE]</code>: Authentication succeeded but the mailbox is currently
in use, possibly by another POP3 session.
</ul>
<li>AUTH-RESP-CODE<br>
If authentication fails and the POP3 server issues an error message beginning
with a square bracket, this message will include additional information about
the source of the error:
<ul>
<li><code>[LOGIN-DELAY]</code>: The login delay period hast not yet expired.
<li><code>[IN-USE]</code>: Authentication succeeded but the mailbox is currently
in use, possibly by another POP3 session.
<li><code>[SYS/TEMP]</code>: Temporary system failure; try again later.
<li><code>[SYS/PERM]</code>: Permanent system failure; ask the administrator.
<li><code>[AUTH]</code>: Incorrect user name or password or some other problem with
the user's credentials.
</ul>
</ul>
<p>If TLS is activated for server information mode, the following information will
be printed about the POP3 server's TLS certificate (if available):
<ul>
<li>Owner information
<ul>
<li>Common Name
<li>Organization
<li>Organizational unit
<li>Locality
<li>State or Province
<li>Country
</ul>
<li>Issuer information
<ul>
<li>Common Name
<li>Organization
<li>Organizational unit
<li>Locality
<li>State or Province
<li>Country
</ul>
<li>General
<ul>
<li>Activation time
<li>Expiration time
<li>SHA1 fingerprint
<li>MD5 fingerprint
</ul>
</ul>
<div class="node">
<p><hr>
<a name="Filtering"></a>
Next: <a rel="next" accesskey="n" href="#Server-information-mode">Server information mode</a>,
Previous: <a rel="previous" accesskey="p" href="#Mail-retrieval-mode">Mail retrieval mode</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">7 Filtering</h2>
<p>There are three filtering commands available. They will be executed in the
following order:
<ol type=1 start=1>
<li>`<samp><span class="samp">killsize</span></samp>'
<li>`<samp><span class="samp">skipsize</span></samp>'
<li>`<samp><span class="samp">filter</span></samp>'
</ol>
<p>If a filtering command applies to a mail, the remaining filters will not be
executed.
<p>The POP3 server must support the POP3 TOP command
(<a href="#Server-information-mode">Server information mode</a>) for filtering with a filter command:
It is used to read the mail headers (plus the blank line separating the header
from the body) and pipe them to the filter command.
<p>Note that, if the filter decides that the mail should be retrieved, the complete
mail has to be downloaded, including the headers, so the headers will be
downloaded twice. This is because there's no way in POP3 to download just
the mail body. Sometimes this overhead surpasses the savings of the filtering.
<p>The filter command looks at the mail headers and signals with its exit code what
mpop should do with the mail:
<ul>
<li>0: retrieve the mail
<li>1: delete the mail; do not retrieve it
<li>2: skip the mail; do not retrieve it
</ul>
Return codes greater than or equal to 3 mean that an error occurred.
The <code>sysexits.h</code> error codes may be used to give information about the kind
of the error, but this is optional.
<p>Since the filter command will be passed to a shell, you can use all shell
command constructs in addition to just calling a script or program. This allows
flexible filter constructs. See <a href="#Filtering-with-SpamAssassin">Filtering with SpamAssassin</a>.
<p>Some POP3 servers count end-of-line characters as two bytes (CRLF) instead of
one (LF), so that the size of a mail as reported by the POP3 server is slightly
larger than the actual size. The filters use the size values reported by the
POP3 server since they cannot know the actual size in advance. Thus you cannot
rely on <em>exact</em> size filtering.
<div class="node">
<p><hr>
<a name="Examples"></a>
Next: <a rel="next" accesskey="n" href="#Development">Development</a>,
Previous: <a rel="previous" accesskey="p" href="#Server-information-mode">Server information mode</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">8 Examples</h2>
<ul class="menu">
<li><a accesskey="1" href="#A-configuration-file">A configuration file</a>
<li><a accesskey="2" href="#Filtering-with-SpamAssassin">Filtering with SpamAssassin</a>
</ul>
<div class="node">
<p><hr>
<a name="A-configuration-file"></a>
Next: <a rel="next" accesskey="n" href="#Filtering-with-SpamAssassin">Filtering with SpamAssassin</a>,
Up: <a rel="up" accesskey="u" href="#Examples">Examples</a>
</div>
<h3 class="section">8.1 A configuration file</h3>
<pre class="example"> #
# Default values for all accounts.
#
defaults
# Activate TLS.
tls on
# Use the POP3-over-TLS variant instead of the STARTTLS variant.
tls_starttls off
# Use the procmail mail delivery agent.
delivery mda "/usr/bin/procmail -f '%F' -d $USER"
# For Sendmail:
#delivery mda "/usr/sbin/sendmail -oi -oem -f '%F' -- $USER"
# For msmtp (delivery via SMTP):
#delivery mda "/usr/bin/msmtp --host=localhost --from='%F' -- $USER"
# Delivery to a maildir folder:
#delivery maildir ~/Mail/incoming
# Delivery to a MBOX mail folder:
#delivery mbox ~/Mail/new
#
# Two pop3 mailboxes at the provider.
#
account provider1
host mx.provider.example
user john_smith
password secret
# Copy the settings from the previous account, and only override the
# settings that differ.
account provider2 : provider1
user joey
password secret2
#
# A freemail service.
#
account freemail
host pop.freemail.example
user 1238476
password pass
# The service runs SpamAssassin, so test each mail for the "X-Spam-Status: Yes"
# header, and delete all mails with this header before downloading them.
filter if [ "`grep "^X-Spam-Status: Yes"`" ]; then exit 1; else exit 0; fi
#
# Set a default account (optional).
#
account default : provider1
</pre>
<div class="node">
<p><hr>
<a name="Filtering-with-SpamAssassin"></a>
Previous: <a rel="previous" accesskey="p" href="#A-configuration-file">A configuration file</a>,
Up: <a rel="up" accesskey="u" href="#Examples">Examples</a>
</div>
<h3 class="section">8.2 Filtering with SpamAssassin</h3>
<p>Use the following to delete all mails that SpamAssassin classifies as spam:
<pre class="example"> filter "/path/to/spamc -c > /dev/null"
</pre>
<p>Since no message body is passed to SpamAssassin, you should disable all
body-specific tests in the SpamAssassin configuration file; for example set
use_bayes 0.
<p>If your mail provider runs SpamAssassin for you, you just have to check for
the result. The following script can do that when used as an mpop filter:
<pre class="example"> #!/bin/sh
if [ "`grep "^X-Spam-Status: Yes"`" ]; then
exit 1 # kill this message
else
exit 0 # proceed normally
fi
</pre>
<p>Since the filter command is passed to a shell, all shell constructs are usable,
so you can also use this directly:
<pre class="example"> filter if [ "`grep "^X-Spam-Status: Yes"`" ]; then exit 1; else exit 0; fi
</pre>
<div class="node">
<p><hr>
<a name="Development"></a>
Previous: <a rel="previous" accesskey="p" href="#Examples">Examples</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
</div>
<h2 class="chapter">9 Development</h2>
<p>The homepage of mpop is <a href="http://mpop.sourceforge.net/">http://mpop.sourceforge.net/</a>;
the SourceForge project page is at <a href="http://sourceforge.net/projects/mpop/">http://sourceforge.net/projects/mpop/</a>.
<p>The mailing lists <code>mpop-users</code> can be accessed from the project page.
<p>Please send any questions, suggestions, and bug reports either to the mailing
list or to Martin Lambers (<a href="mailto:marlam@marlam.de">marlam@marlam.de</a>, OpenPGP key:
<a href="http://www.marlam.de/key.txt">http://www.marlam.de/key.txt</a>).
If you send a bug report, please include the output of <code>mpop --version</code>.
</body></html>
|