Am Mittwoch, 2. Mai 2007 schrieb Jerry Feldman:
On Tue, 1 May 2007 19:57:59 +0200
Herbert Graeber <lists@graeber-clan.de> wrote:
Am Dienstag, 1. Mai 2007 schrieb Feris Thia:
I have a global (catch-all) account at my ISP. In my Linux box I need to download all the emails from the account and want to delivered it to local user's inbox. I've just learned about .forward and .procmailrc and have no problem with Regular Expression.
How do I match an email's address pattern (username@abc.com) from RECEIVED field in mail's header and then resend it ?
Why procmail? You may better use fetchmail. This is partly supported by YaST. What's missing is the catch-all case (multi drop mailboxes). This must be configured manually in /etc/fetchmailrc. Look into the man page of fetchmail for details.
Procmail is a mail delivery agent. Fetchmail is a mail retrieval agent. You can use Fetchmail to grab email from your ISP's POP3 or IMAP servers and deliver it to local users on your Linux system. This may be preferable to the global account at your ISP, but that depends on many factors.
But fetchmail has the ability to evaluate the Received fields or (better) other custom fields added by the ISP that contain the envelope of the emails.
With procmail you can use a number of rules to deliver email as you know. The problem is that there are a number of Received fields. One thing you could do is similar to the way we use Spamassasin, is to pipe the message through a program or script that you write, and add a unique field that you can key on. Here is my .procmailrc generic spamc rule.
:0fw: spamassassin.lock
- < 256000
| spamc
So, you could use something like: :0fw:mycode.lock : | mycode
Mycode would then create a header line, such as "mycode: username" Then you would create a simple set of rules for the new header line you inserted.
Sure, procmail is a useful and flexible tool. But for getting mail from a multi drop mailbox and delivering it into separate mailboxes via postfix or sendmailm, fetchmail works better. You can even use procmail for other tasks, too.
There may be a more elegant way of doing this, but it should work.
Even when I think fetchmail is better for the task of loading and sorting mails from multi drop mailboxes, this is not elegant too, because multi drop mailboxes itself are a kludge. Cheers, Herbert -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org