Paulo Roberto <nirv199(_at_)yahoo(_dot_)com> writes:
Hello,
I am having some trouble trying to run fetchmail in daemon mode, being
started from /etc/ppp/ppp.linkup in FreeBSD 4.6.
At the /var/log/ppp.log I get:
ppp[56]: tun0: Command: papchap: ! sh /usr/local/bin/fetchmail -v -f
/root/.fetchmailrc >> /tmp/FETCHMAIL.LOG
But no mail is retrieved (yup, I sent myself dozens of emails to test
it) and even no output is directed to my test file.
Does fetchmail needs any special parameter to be run at ppp.linkup?
ppp seems not to do shell expansion, but just exec the line without
shell, so fetchmail gets the '>>/tmp/FETCHMAIL.LOG' as argument and
thinks it's an account name -- if you run this from a shell, the shell
deals with the redirection and does NOT pass this to fetchmail. You may
also want to look into fetchmail's native logging options.
So, try
! sh -c "/usr/local/bin/fetchmail -v -f /root/.fetchmailrc >>/tmp/FETCHMAIL.LOG"
(i. e. add a -c and the quotes) rather than what you have.
The examples in ppp.linkup (for example at pmdemand:) do that (sh -c
"mumble") as well. Please report back if that helps.
--
Matthias Andree