{ "name": "fetchmail", "version": "6.6.8", "summary": "fetchmail: collects mail from POP3 and IMAP mailboxes and hands it to a local mail program or SMTP server", "category": "network", "license": "GPL-2.0-or-later", "homepage": "https://www.fetchmail.info/", "source": { "url": "https://downloads.sourceforge.net/project/fetchmail/branch_6.6/fetchmail-6.6.8.tar.xz", "sha256": "fff279d7ffbf4d9449110f715c0deb5ff5a2b13b317914b6f2c810ea12a0b7e1" }, "watch": {"kind": "index", "url": "https://sourceforge.net/projects/fetchmail/rss?path=/", "regex": "fetchmail-([0-9]+(?:\\.[0-9]+)+)\\.tar\\.xz", "source": "https://downloads.sourceforge.net/project/fetchmail/branch_{major}.{minor}/fetchmail-{version}.tar.xz"}, "deps": [ "openssl" ], "env_packages": [], "static": true, "nss": true, "check": "t=$(mktemp -d) && bin/fetchmail --version 2>&1 | has 'fetchmail release 6.6.8' && printf '%s\\n' 'import socket, sys' 's = socket.socket()' 's.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)' 's.bind((\"127.0.0.1\", int(sys.argv[1])))' 's.listen(1)' 'c, _ = s.accept()' 'f = c.makefile(\"rwb\")' 'msg = b\"From: a@example.org\\r\\nTo: bvs@example.org\\r\\nSubject: bvs fetchmail\\r\\n\\r\\nbody line\\r\\n\"' 'def w(x):' ' f.write(x + b\"\\r\\n\")' ' f.flush()' 'w(b\"+OK bvs pop3 ready\")' 'for line in f:' ' p = line.strip().split(b\" \")' ' cmd = p[0].upper()' ' if cmd == b\"CAPA\":' ' w(b\"+OK\"); w(b\"USER\"); w(b\"UIDL\"); w(b\"TOP\"); w(b\".\")' ' elif cmd == b\"USER\":' ' w(b\"+OK\")' ' elif cmd == b\"PASS\":' ' w(b\"+OK\" if p[1:] == [b\"s3cret\"] else b\"-ERR bad password\")' ' elif cmd == b\"STAT\":' ' w(b\"+OK 1 %d\" % len(msg))' ' elif cmd == b\"LIST\":' ' w(b\"+OK 1 %d\" % len(msg)) if len(p) > 1 else (w(b\"+OK\"), w(b\"1 %d\" % len(msg)), w(b\".\"))' ' elif cmd == b\"UIDL\":' ' w(b\"+OK 1 bvs-uid-1\") if len(p) > 1 else (w(b\"+OK\"), w(b\"1 bvs-uid-1\"), w(b\".\"))' ' elif cmd in (b\"RETR\", b\"TOP\"):' ' w(b\"+OK\"); f.write(msg); w(b\".\")' ' elif cmd == b\"DELE\":' ' w(b\"+OK\")' ' elif cmd == b\"QUIT\":' ' w(b\"+OK bye\")' ' break' ' else:' ' w(b\"-ERR\")' 'c.close()' > \"$t/pop3.py\" && P=$(free_port) && { python3 \"$t/pop3.py\" \"$P\" & echo $! > \"$t/pid\"; } && wait_port \"$P\" && printf 'set no syslog\\npoll 127.0.0.1 service %s protocol pop3 user \"bvs\" password \"s3cret\" sslproto \"\" mda \"cat > %s/got\"\\n' \"$P\" \"$t\" > \"$t/rc\" && chmod 600 \"$t/rc\" && HOME=$t FETCHMAILHOME=$t bin/fetchmail -N -f \"$t/rc\" > \"$t/log\" 2>&1 && has -x 'Subject: bvs fetchmail' < \"$t/got\" && has -x 'body line' < \"$t/got\" && echo \"fetchmail 6.6.8: a message collected from a POP3 server on port $P and handed to an MDA\"; r=$?; [ $r = 0 ] || cat \"$t/log\" >&2; [ -f \"$t/pid\" ] && kill \"$(cat \"$t/pid\")\" 2>/dev/null; exit $r" }