1

I'm trying to setup fetchmail for download some mail from gmail using pop3. The problem, as you can see, is that fetchmail instead of use the pop protocol will use imap.

For being sure to not have commit any error during the configuration i will summarize the procedure:

  1. I edited the file called "fetchmail" in the folder /etc/default and set the variable demon to "yes";

  2. Now I created the configuration file "fetchmailrc" in the folder /etc. In this one I wrote:

    set postmaster "root"
    set daemon 600
    
    poll pop.gmail.com with proto POP3
        user 'insertEmailHere@gmail.com' there with password 'secretPWD' is root here options ssl
    
  3. And then i proceed with a test for see if it works using the command:"fetchmail -d0 -vk pop.gmail.com". The response of the command is as follows:

    fetchmail: 6.4.2 querying pop.gmail.com (protocol auto) at Mon Jul 12 12:43:41 2021: poll started
    fetchmail: 6.4.2 querying pop.gmail.com (protocol IMAP) at Mon Jul 12 12:43:41 2021: poll started
    Trying to connect to 173.194.69.109/143...connection failed.
    fetchmail: connection to pop.gmail.com:imap [173.194.69.109/143] failed: Connection timed out.
    Trying to connect to 173.194.69.108/143...connection failed.
    fetchmail: connection to pop.gmail.com:imap [173.194.69.108/143] failed: Connection timed out.
    Trying to connect to 2a00:1450:4013:c00::6c/143...connection failed.
    fetchmail: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6c/143] failed: Network is unreachable.
    Trying to connect to 2a00:1450:4013:c00::6d/143...connection failed.
    fetchmail: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6d/143] failed: Network is unreachable.
    fetchmail: Connection errors for this poll:
    name 0: connection to pop.gmail.com:imap [173.194.69.109/143] failed: Connection timed out.
    name 1: connection to pop.gmail.com:imap [173.194.69.108/143] failed: Connection timed out.
    name 2: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6c/143] failed: Network is unreachable.
    name 3: connection to pop.gmail.com:imap [2a00:1450:4013:c00::6d/143] failed: Network is unreachable.
    IMAP connection to pop.gmail.com failed: Network is unreachable
    fetchmail: 6.4.2 querying pop.gmail.com (protocol IMAP) at Mon Jul 12 12:48:02 2021: poll                         completed
    fetchmail: 6.4.2 querying pop.gmail.com (protocol auto) at Mon Jul 12 12:48:02 2021: poll completed
    fetchmail: Query status=2 (SOCKET)
    fetchmail: normal termination, status 2
    

As I can assume, fetchmail is trying to force the imap protocol instead of pop. I can't understand at all why is doing something like that.

Maybe my low conoscence are made me missing something. Right now I'm working on the last version of Ubuntu server. Thank you very much for your attention and I'm sorry for my bad English.

P.S. I know that using the root account is discouraged, but for now I'm only doing some tries. When I will understand how to configure fetchmail the next step is to setup a compleat mail server using postfix, dovecot and fetchmail. Also, I already know the existence of getmail and his extreamly easy setup. But now I would like to understand the cause of this error.

1 Answers1

2

When you run fetchmail from the commandline, by default it will use the /.fetchmailrc file and nothing else.

To manually test the configuration file "fetchmailrc" in the folder /etc you need to use the -f <pathname> or --fetchmailrc <pathname> option.

In other words test with

fetchmail -d0 -vk --fetchmailrc /etc/fetchmailrc
Nobody
  • 36
  • 1
  • Thank you very much. Now it works fine. The only problem that stand now is the authorized access by gmail but I assume I have to allowed access to less secure apps. Thank you again and have a nice day. – DottorBooom Jul 12 '21 at 14:40