OpenWrt Forum Archive

Topic: Fetchmail, SetUID Issue

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying to setup Fetchmail / Procmail / Dovecot on my WRTSL54GS w/ a small RAID array attached.  For the most part things are going well, but I need some help.

Note:  I do want to do this.  I know this is a tiny machine.  I have my reasons.  I live off-grid and a five watt server with an 8 watt raid array is very important to me.  Every watt counts in my world.

So here is my issue:
I have several email accounts on an external hosting provider.  I have created local accounts on my OpenWRT box.  I can attach to them via Dovecot.  Things work very nicely.
I can use Procmail to deliver messages to the Maildir filestructure.
I can use Fetchmail to get mail from my external providers.

What I can't do is get the fetchmail to run procmail as the appropriate local user on the OpenWRT and as a result, all mail collected via fetchmail gets delivered to root.  I've tried wrapping things in a setuid script, but that doesn't work.  So much for easy.

It seems my options are either:
(a) recompile busy box with proper user support such that I can 'su'.
(b) recompile fetchmail?

I think I want to pursue (b) as this seems much less more invasive than (a). 

Is there something I'm missing?  Any pointers or alternate suggestions would be very much appreciated.
Thanks.

I also tried using the -d option on procmail.   No dice.

As best I can tell everything is compiled with all the multi-user options turned off.  Again, any suggestions would be appreciated.

I figured out a way to do it.  I built my own package for Dovecot 1.0.2.  Dovecot 1.0.2 provides it's own local delivery agent that will do the setuid switches properly.  I configured fetchmail to call it, and presto, everything appears to be working.

The discussion might have continued from here.