On Thu, May 11, 2000 at 02:51:25PM +0518, Suresh Ramasubramanian typed:

> poll remote.server.com proto pop3
> user user1 with password pass1 is user user1 here
> user user2 with password pass2 is user user2 here

Pretty painful & time-consuming to maintain if you have more than a few 
users (and you need to know passwords of everyone on the remote box)

A better solution would be :

Create a /etc/procmailrc file on the remote server with the following rule :

:0 :
| formail -I "X-Actual-Recipient: $LOGNAME" >> /var/spool/mail/postbox

This adds a header to the message indicating the actual recipient, and 
puts all mail into a common mailbox. (Without the header it's difficult to 
figure out to who each mail is to be forwarded to). Also "postbox" 
needs to be a user account on the remote box.

Now in the local fetchmail, fetch mails for user "postbox" and direct 
it to a dummy user "postman" on the local machine. His .procmailrc will 
read :

# Get the userid of real recipient
RECIPIENT=`formail -x"X-Actual-Recipient: "`

:0 :
* ^X-Actual-Recipient:.
# This filter is required to avoid a mailloop, if someone sends 
# mail to "postman" with a header "X-Actual-Recipient: postman" 
| formail -I "X-Actual-Recipient:" | /usr/lib/sendmail ${RECIPIENT}

I use something similar in my server setup - My setup has some additional 
features though.. (like bzipping the entire postbox periodically
and mailing it our local vsnl account. Fetchmail gets it from there 
instead of directly from the remote server)

Kala

-----------------------------------------------------------------------
LIH is all for free speech.  But it was created for a purpose - to help
people discuss issues about installing and running Linux.  If your
messages are counterproductive to this purpose, your privileges to
submit messages can and will be revoked.

Reply via email to