§2024-04-30

¶Install Dovecot

To install a basic Dovecot server with common POP3 and IMAP functions, run the following command:

$ sudo apt install dovecot-imapd dovecot-pop3d
$ systemctl status dovecot

There are various other Dovecot modules including dovecot-sieve (mail filtering), dovecot-solr (full text search), dovecot-antispam (spam filter training), dovecot-ldap (user directory).

¶ test with telent from 192.168.2.133, orgpi8g

alexlai@opi58G:~$ telnet  h2jammy.yushei.net 143
Trying 59.126.118.193...
Connected to h2jammy.yushei.net.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.
a1 login alexlai alex1765
a1 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in
a2 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $label1)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $label1 \*)] Flags permitted.
* 1 EXISTS
* 1 RECENT
* OK [UNSEEN 1] First unseen.
* OK [UIDVALIDITY 1714266940] UIDs valid
* OK [UIDNEXT 32] Predicted next UID
* OK [HIGHESTMODSEQ 72] Highest
a2 OK [READ-WRITE] Select completed (0.006 + 0.000 + 0.005 secs).
a3 FETCH 1 BODY[]
* 1 FETCH (FLAGS (\Seen \Recent) BODY[] {3032}
Return-Path: <rai.sousuke@gmail.com>
X-Original-To: alexlai@h2jammy.yushei.net
Delivered-To: alexlai@h2jammy.yushei.net
Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174])
	by h2Jammy.yushei.net (Postfix) with ESMTPS id 484E955632
	for <alexlai@h2jammy.yushei.net>; Tue, 30 Apr 2024 15:02:01 +0800 (CST)
Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-36b21e8c6ccso22927025ab.2
        for <alexlai@h2jammy.yushei.net>; Tue, 30 Apr 2024 00:02:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1714460519; x=1715065319; darn=h2jammy.yushei.net;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ycU6R5yxzNyjsJAB+GvIC+cmMBexPaS/P/YSfweeRYQ=;
        b=cQi4JUXVE9bTneBJovCrV4MWA432J9iLbQ+qysQNTIXRB0SvQY5q18zK1DTUNp17gt
         Vm+W0EueFbIrT8sg5Ok/W9IErCzvyHNPBFu3AJeuXp7O/POOPLH9gDsvSAq6Exi7tTn4
         LFfPOgpuV2cAJstPIA1VQLgMAVk86fIdGzNk1RKWuWR2ryPoTBvcuypiNH+dWqbHqvrA
         SMtInFXke9IE0jbbTa3mi4/fx8a94xM4u0oNY+yAoG+hCoz3WYy44ZhhZTgIuHn5THI5
         6aL0cZy+6OzTaLyMHvWnh54a7f4Veiff5A7KhJRNUDLYBYCUPCcYc+ZartgaBUhSlSiG
         Pcbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1714460519; x=1715065319;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ycU6R5yxzNyjsJAB+GvIC+cmMBexPaS/P/YSfweeRYQ=;
        b=UjjQ4DAy6fyzSdgqhM9YzmU7X9q3yDKKyFUWZVZ//9HKSZjd5xTsfgQNWt2n/SpLPQ
         sxsklB7BfrkqoKrhMVocXd9xc4AJ3C95lb+nnTNivaLjo0ztdJyy6Udr3XIJXzBKb3vt
         bPIBQxw8WywgPNEALgnMrxo8dRjIB45l10/Gs4s7gn+bZAOfCXjEYE6MV/374jDFGkMs
         E0UBRKER8KbOVabw5zD9Z1SDGoY+Ya2UJnMpXn1o5akmq/bKajhWKnZTtt2Y+BMnsmCW
         dwZ3ZFX3aOC7SJ5LaYqxR+OC+ye13l1kp++2432bUmvZbaS0urB0EeDGU0OOXJ3F90a9
         zXmg==
X-Gm-Message-State: AOJu0Yxt+HKyqeAMFY7nwyi2xZbKprLxRhEFnVGCNyME6xrSgxZ33oue
	ya5rVQunolZsNoRARMjqzCauTqZIG3u/UK1PCThEeSFYyS8R6MPioiU6ikyukZoWQWT5EwC5QbK
	qbtgn1lQNbu2sPeZYp7yOoNEr3aEu
X-Google-Smtp-Source: AGHT+IH+XzXG8O/KNoZDLQV4fuNqOV75XUgu8x1fDaKWl3UCFDFskm3jFAPtpvNx+LTw1BMMIns3b7smDyBNlc96gvU=
X-Received: by 2002:a92:c047:0:b0:36c:4457:ca49 with SMTP id
 o7-20020a92c047000000b0036c4457ca49mr7921969ilf.25.1714460519459; Tue, 30 Apr
 2024 00:01:59 -0700 (PDT)
MIME-Version: 1.0
From: =?UTF-8?B?6aC85a6X5L2R?= <rai.sousuke@gmail.com>
Date: Tue, 30 Apr 2024 15:01:48 +0800
Message-ID: <CAO83_PVqft8k-gmFg7FhLAz_rEAkjpKzfK0KYm5rVm96opJbtA@mail.gmail.com>
Subject: Hi from gmail.com
To: alexlai@h2jammy.yushei.net
Content-Type: multipart/alternative; boundary="0000000000003e765e06174af286"

--0000000000003e765e06174af286
Content-Type: text/plain; charset="UTF-8"

time 2024-04-30 15:01

--0000000000003e765e06174af286
Content-Type: text/html; charset="UTF-8"

<div dir="ltr">time 2024-04-30 15:01</div>

--0000000000003e765e06174af286--
)
a3 OK Fetch completed (0.004 + 0.000 + 0.003 secs).
^]
telnet> quit
Connection closed.

¶testing POP3

alexlai@opi58G:~$ telnet  h2jammy.yushei.net 110
Trying 59.126.118.193...
Connected to h2jammy.yushei.net.
Escape character is '^]'.
+OK Dovecot (Ubuntu) ready.
USER alexlai
+OK
PASS alex1765
+OK Logged in.
LIST
+OK 1 messages:
1 3032
.
RETR 1
+OK 3032 octets
Return-Path: <rai.sousuke@gmail.com>
X-Original-To: alexlai@h2jammy.yushei.net
Delivered-To: alexlai@h2jammy.yushei.net
Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174])
	by h2Jammy.yushei.net (Postfix) with ESMTPS id 484E955632
	for <alexlai@h2jammy.yushei.net>; Tue, 30 Apr 2024 15:02:01 +0800 (CST)
Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-36b21e8c6ccso22927025ab.2
        for <alexlai@h2jammy.yushei.net>; Tue, 30 Apr 2024 00:02:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1714460519; x=1715065319; darn=h2jammy.yushei.net;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ycU6R5yxzNyjsJAB+GvIC+cmMBexPaS/P/YSfweeRYQ=;
        b=cQi4JUXVE9bTneBJovCrV4MWA432J9iLbQ+qysQNTIXRB0SvQY5q18zK1DTUNp17gt
         Vm+W0EueFbIrT8sg5Ok/W9IErCzvyHNPBFu3AJeuXp7O/POOPLH9gDsvSAq6Exi7tTn4
         LFfPOgpuV2cAJstPIA1VQLgMAVk86fIdGzNk1RKWuWR2ryPoTBvcuypiNH+dWqbHqvrA
         SMtInFXke9IE0jbbTa3mi4/fx8a94xM4u0oNY+yAoG+hCoz3WYy44ZhhZTgIuHn5THI5
         6aL0cZy+6OzTaLyMHvWnh54a7f4Veiff5A7KhJRNUDLYBYCUPCcYc+ZartgaBUhSlSiG
         Pcbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1714460519; x=1715065319;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ycU6R5yxzNyjsJAB+GvIC+cmMBexPaS/P/YSfweeRYQ=;
        b=UjjQ4DAy6fyzSdgqhM9YzmU7X9q3yDKKyFUWZVZ//9HKSZjd5xTsfgQNWt2n/SpLPQ
         sxsklB7BfrkqoKrhMVocXd9xc4AJ3C95lb+nnTNivaLjo0ztdJyy6Udr3XIJXzBKb3vt
         bPIBQxw8WywgPNEALgnMrxo8dRjIB45l10/Gs4s7gn+bZAOfCXjEYE6MV/374jDFGkMs
         E0UBRKER8KbOVabw5zD9Z1SDGoY+Ya2UJnMpXn1o5akmq/bKajhWKnZTtt2Y+BMnsmCW
         dwZ3ZFX3aOC7SJ5LaYqxR+OC+ye13l1kp++2432bUmvZbaS0urB0EeDGU0OOXJ3F90a9
         zXmg==
X-Gm-Message-State: AOJu0Yxt+HKyqeAMFY7nwyi2xZbKprLxRhEFnVGCNyME6xrSgxZ33oue
	ya5rVQunolZsNoRARMjqzCauTqZIG3u/UK1PCThEeSFYyS8R6MPioiU6ikyukZoWQWT5EwC5QbK
	qbtgn1lQNbu2sPeZYp7yOoNEr3aEu
X-Google-Smtp-Source: AGHT+IH+XzXG8O/KNoZDLQV4fuNqOV75XUgu8x1fDaKWl3UCFDFskm3jFAPtpvNx+LTw1BMMIns3b7smDyBNlc96gvU=
X-Received: by 2002:a92:c047:0:b0:36c:4457:ca49 with SMTP id
 o7-20020a92c047000000b0036c4457ca49mr7921969ilf.25.1714460519459; Tue, 30 Apr
 2024 00:01:59 -0700 (PDT)
MIME-Version: 1.0
From: =?UTF-8?B?6aC85a6X5L2R?= <rai.sousuke@gmail.com>
Date: Tue, 30 Apr 2024 15:01:48 +0800
Message-ID: <CAO83_PVqft8k-gmFg7FhLAz_rEAkjpKzfK0KYm5rVm96opJbtA@mail.gmail.com>
Subject: Hi from gmail.com
To: alexlai@h2jammy.yushei.net
Content-Type: multipart/alternative; boundary="0000000000003e765e06174af286"

--0000000000003e765e06174af286
Content-Type: text/plain; charset="UTF-8"

time 2024-04-30 15:01

--0000000000003e765e06174af286
Content-Type: text/html; charset="UTF-8"

<div dir="ltr">time 2024-04-30 15:01</div>

--0000000000003e765e06174af286--
.
QUIT        
+OK Logging out.
Connection closed by foreign host.