-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Herbert Graeber wrote:
Am Mittwoch, 2. Mai 2007 schrieb Jerry Feldman:
On Tue, 1 May 2007 19:57:59 +0200
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
Herbert Graeber <lists@graeber-clan.de> wrote: 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
I think someone wandered off point here :-) The original poster indicated in reply that he was using fetchmail to obtain mail but that he wanted to perform some additional processing of the mail before it was delivered. Fetchmail is strongest at getting mail and delivering it to appropriate mail boxes but has NO facilities to pre process mail before delivery. Procmail gives one the facility to pre process mail, and I personally use it for a) spam processing and b) for moving some low priority mail from the mail box so that I should only see stuff I am interested in when I access mail from my Nokia. (Saves bills..:-)) This pre processing can involve forwarding mail, for external mail fetchmail would be best but for mail delivered locally procmail is more effective. Horses for courses... -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFGOZ+JasN0sSnLmgIRAv3KAJ9sAo+AHECASj4fupGBcrqwJ9t5YQCgzL5m /RkgEwgGN7/wf3UKVQJLbwI= =CWJ/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org