Fetchmail - Probably misconfigured but not working

Hi Again,

Using RT4.4.4 on Ubuntu 18.04

Setting fetchmail to receive emails for my queues seems to be a mystical art. I cannot get it to work.
There appears to be several issues:

1, Me the user googling stuff and not getting a black and white answer.
2, The config i get looks ok
3, Starting the daemon returns an error.

My /etc/fetchmailrc config:

set invisibleset
poll outlook.office365.com
protocol IMAP
username "osschanges@arghh.com"
password "passwordredacted"
ssl
mda "/opt/rt4/bin/rt-mailgate--queue general --action correspond --url https://rt.arghh.com/" keep

After chowning to the fetchmail user, i try and start the daemon by running:

systemctl start fetch mail

Which appears to start and exit but remain active!?.. but does nothing.

.â—Ź fetchmail.service - LSB: init-Script for system wide fetchmail daemon
     Loaded: loaded (/etc/init.d/fetchmail; generated)
     Active: active (exited) since Mon 2020-10-12 21:46:38 UTC; 1min 57s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 23789 ExecStart=/etc/init.d/fetchmail start (code=exited, status=0/SUCCESS)

Oct 12 21:46:38 rt1-isp systemd[1]: Starting LSB: init-Script for system wide fetchmail daemon...
Oct 12 21:46:38 rt1-isp fetchmail[23789]:  * Not starting fetchmail daemon, disabled via /etc/default/fetchmail
Oct 12 21:46:38 rt1-isp systemd[1]: Started LSB: init-Script for system wide fetchmail daemon.

I’m a little confused… what am I doing wrong?

Thanks

You can try running systemctl status fetchmail maybe for some more info.

I usually start by making sure the config works by running /usr/bin/fetchmail manually and pointing it to my config with verbose logging enabled

Thanks for the reply.
The systemctl fetchmail status is a bit vague…

```
.â—Ź fetchmail.service - LSB: init-Script for system wide fetchmail daemon
     Loaded: loaded (/etc/init.d/fetchmail; generated)
     Active: active (exited) since Mon 2020-10-12 21:46:38 UTC; 1min 57s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 23789 ExecStart=/etc/init.d/fetchmail start (code=exited, status=0/SUCCESS)

Oct 12 21:46:38 rt1-isp systemd[1]: Starting LSB: init-Script for system wide fetchmail daemon...
Oct 12 21:46:38 rt1-isp fetchmail[23789]:  * Not starting fetchmail daemon, disabled via /etc/default/fetchmail
Oct 12 21:46:38 rt1-isp systemd[1]: Started LSB: init-Script for system wide fetchmail daemon.
```

I have tried running the options directly from the command line after looking at the man pages (which are vast) - i don’t think i am getting it right as it starts asking for a password to

/usr/bin/fetchmail poll outlook.office365.com user "osschanges@arghh.com" pass "redacted" -k -v

This then starts asking for passwords…

Enter password for root@poll:
Enter password for root@outlook.office365.com:
Enter password for root@user:

Which seems really odd (i know i shouldn’t use the root user for this but i don’t think that’s attributed to the problem)

Is there an easier option to maybe not use fetchmail?

Thanks again

You can forward email from the users inbox to the RT server. This should be a setting the exchange options

1 Like

Thanks again for the response.

After multiples of issues (the firewall preventing me from connecting to office365), i have had success in connecting and seeing email using fetchmail.

mda "/opt/rt4/bin/rt-mailgate --queue oss --action correspond --url https://rt.arghh.com/"

...rewritten version is CC: OSS Changes <osschanges@arghh.com>.
fetchmail: about to deliver with: /opt/rt4/bin/rt-mailgate --queue oss --action correspond --url https://rt.arghh.com/
1 was not the expected length (46666 actual != 56182 expected)

Eventually, i realised i had not entered in my hostname in to my hosts file. I re-ran and the emails flooded in.

Struggling with a few other things but I think this chapter can be closed.

Thanks again.