Skip to content

Commit

Permalink
Only log when numerical number of mails
Browse files Browse the repository at this point in the history
  • Loading branch information
pepa65 committed Sep 7, 2023
1 parent c7d5303 commit 7c6e6d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub](https://img.shields.io/github/license/pepa65/m2m.svg)](LICENSE)
# m2m - Move from POP3 to Maildir

* **v1.7.1**
* **v1.7.2**
* Just pull mails from POP3 servers (TLS can be disabled) and put them in
local Maildirs. Proxies and Onion entry servers are supported.
* RFC6856 compliant (UTF8 before anything) so works with Courier as well.
Expand Down Expand Up @@ -35,7 +35,7 @@

## Help
```
m2m v1.7.1 - Move from POP3 to Maildir
m2m v1.7.2 - Move from POP3 to Maildir
* Downloading emails from POP3 servers and moving them into Maildir folders.
* Repo: github.com/pepa65/m2m
* Usage: m2m [ -h|--help | -q|--quiet ]
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"gopkg.in/yaml.v2"
)

const version = "1.7.1"
const version = "1.7.2"

type Config struct {
Username string
Expand Down Expand Up @@ -223,6 +223,8 @@ func check(account string, filename string, quiet bool) (int, string) {
nmsg, err := strconv.Atoi(stat[0])
if err != nil {
return 0, account+": "+"Malformed number of messages: "+stat[0]
} else {
accounts[account] = stat[0]
}

boxsize, err := strconv.Atoi(stat[1])
Expand All @@ -232,7 +234,6 @@ func check(account string, filename string, quiet bool) (int, string) {

if !quiet {
log.Printf("%s: Found %d messages of total size %d bytes", account, nmsg, boxsize)
accounts[account] = stat[0]
}
for i := 1; i <= nmsg; i++ {
line, data, err := popConn.CmdMulti("RETR %d", i)
Expand Down

0 comments on commit 7c6e6d7

Please sign in to comment.