[Wylug-help] Fetchmail/procmail question

Anne Wilson cannewilson at googlemail.com
Wed Aug 22 17:20:51 BST 2007


On Wednesday 22 Aug 2007, Stephen Patterson wrote:
> Anne Wilson wrote:
> > For a long time I've used fetchmail/procmail/dovecot for my mail, running
> > fetchmail and procmail as user.  Now I want to be able to fetch mail for
> > David and route it to his mailboxes, which I presume will not be possible
> > when I run as user.
> >
> > I was running fetchmail as a cron job, but have been told that it's
> > better to run it as a daemon, so I'm trying that, but this new
> > development is something I don't really understand.
> >
> > Should fetchmail be running as root (I assume that a user fetchmail will
> > not be able to write to his mailbox)?  Does that mean that procmail also
> > has to run as root?  I assumed so, but then it begs the question of
> > procmailrc.  I tried adding a section at the end, changing the user
> > parameters and setting his filters, but that doesn't seem to work.
>
> Fetchmail doesn't write to procmail directly unless you have configured
> it to do that (with 'mda /usr/bin/procmail' in the fetchmailrc), so a
> fetchmail instance can receive mail for multiple local users. Fetchmail
> sends (via smtp) to the local smtp mail server which then executes
> procmail for each user if they have messages and a .procmailrc
>
Thanks for replying, Stephen.  Up to now I've always used it as user.  
A .forward file then pipes it through procmail, which sorts it into 
mailboxes.

> For multi-user systems fetchmail should be running as a daemon
> (non-root) with a line in the config file for each remote mailbox you
> need to pick up email from.
>
OK - so I go back to what I originally had, with mine and his in the same 
fetchmail file.

> If his local username is different from his login username at the server
> fetchmail downloads from, then you can use the 'user xxx there is yyy
> here' syntax in fetchmailrc.
>
Not quite sure what you have in mind there, but I don't think that's a 
problem.  His login on his workstation is the same as his login on this (imap 
server) box.  I presume that's what you meant?

> I'd suggest removing his .procmailrc initially to simplify testing.
>
There's no problem getting my mail in.  If fetchmail (running as me) gets his 
mail and puts it into his /var/spool/mail mailbox, does it then use .procmail 
in his home directory to sort into his folders?

> > I'm obviously missing something important.  There's no mail in any of his
> > Maildir folders, nor in /var/spool/mail.
>
> It may be worth checking in /var/log, you should see some sign of the
> messages here.
>
Now there's a problem.  I can see what happened to my mail from pm.log - 
written by procmail.  I had told procmail to log his in a similar file in his 
home directory, but although I created it, it's still empty.

> In debian, fetmail logs to /var/log/mail.log & exim (the smtp server)
> logs to /var/log/exim/mainlog.

Anne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://list.wylug.org.uk/pipermail/wylug-help/attachments/20070822/caa06a25/attachment.bin


More information about the Wylug-help mailing list