-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 11 Apr 2002, Devon Harding - GTHLA wrote:
>What would the command-line option be to retrieve mail from
>'mail.domain.com' with user 'john' and password 'doe' and have it forward to
>'mail.server.com' to user [EMAIL PROTECTED]?

Create a fetchmail config file for this, named /etc/bsmith.fetchmailrc and 
make it readable only by root. It should contain a line like this:

  poll mail.domain.com proto POP3 fetchall nokeep \
       username john password doe

Then, as root, call fetchmail like this:

  fetchmail -f /etc/bsmith.fetchmailrc -S mail.server.com \
            --smtpname [EMAIL PROTECTED]

All these options are described the the fetchmail man page.

You cannot specify the remote SMTP server or recipient address from within 
the fetchmailrc file. You have to do it on the command line. So you have to 
call fetchmail once for each user whose mail you want to retrieve. A script 
like this would do that:

#!/bin/sh
cd /etc
for fetchfile in `ls *.fetchmailrc`; do
  mailuser=`basename $fetchfile .fetchmailrc`
  fetchmail -f /etc/$mailuser.fetchmailrc -S mail.server.com \
            --smtpname $[EMAIL PROTECTED]
done


Tony
- -- 
Anthony E. Greene <mailto:[EMAIL PROTECTED]%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
AOL/Yahoo Chat: TonyG05         HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Anthony E. Greene <[EMAIL PROTECTED]> 0x6C94239D

iD8DBQE8t42rpCpg3WyUI50RAkH4AJ9CGp+dQUydQFJE2r1PV5FwjNB+/wCg4L7Y
2/T9UJUTHxZ0fskQwKmS+Wc=
=l1ax
-----END PGP SIGNATURE-----



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to