![](https://seccdn.libravatar.org/avatar/db06524eec146f5f75d0dc6d9032d33d.jpg?s=120&d=mm&r=g)
I am venturing for the first time into collecting email from my linux box. Accordingly, I've got postfix and procmail installed. Now, I've looked at the YaST MTA tool, and that lets me redirect email from ISPs to specific local users. However, I need to filter the emails from one ISP to several local users. There is also the "aliases" tool. Do I understand correctly that this is what I need to use for this? The man page isn't especially informative to me, I'm afraid. Would I be better configuring postfix and procmail manually than using YaST? Perhaps collect all email from my 2 ISP accounts, redirect to procmail to filter the emails to the several local users? Also, I assume that it's possible to filter one email to several local users? There are some email lists that all users read, but to which we have a single subscription (no point downloading the same msgs many times!). TiA John -- John Pettigrew Headstrong Games john@headstrong-games.co.uk Fun : Strategy : Price http://www.headstrong-games.co.uk/ Board games that won't break the bank Valley of the Kings: ransack an ancient Egyptian tomb but beware of mummies!
![](https://seccdn.libravatar.org/avatar/861b5545c111d2257fa12e533e723110.jpg?s=120&d=mm&r=g)
The 03.06.06 at 09:40, John Pettigrew wrote:
Now, I've looked at the YaST MTA tool, and that lets me redirect email from ISPs to specific local users. However, I need to filter the emails from one ISP to several local users. There is also the "aliases" tool. Do I understand correctly that this is what I need to use for this? The man page isn't especially informative to me, I'm afraid.
No, you need procmail for that: read the procmail man pages (three of them), it has examples of what you are asking for. Basically, you download the acount(s) as one user (any one, preferably not root), and create rules on that user to forward to the rest. -- Cheers, Carlos Robinson
![](https://seccdn.libravatar.org/avatar/db06524eec146f5f75d0dc6d9032d33d.jpg?s=120&d=mm&r=g)
In a previous message, Carlos E. R. wrote:
The 03.06.06 at 09:40, John Pettigrew wrote:
However, I need to filter the emails from one ISP to several local users. There is also the "aliases" tool. Do I understand correctly that this is what I need to use for this?
No, you need procmail for that
So, IIUC, the YaST MTA section applies only to postfix, and will collect email from the specified ISP accounts and deliver the email into batch files within /var/mail/<user> ? Which local user should I pick to receive the unfiltered email? I see that there's a local user called 'mail' already defined - should I use this, or is that a bad idea? Perhaps I should create a new user specifically to receive emails from the servers and then distribute them to the other users, to prevent confusion between the unfiltered and filtered batch files? Then, once the email has arrived for this user, procmail is run on it - do I need a ~/.forward file using SuSE8.2 and postfix? What I want is for the incoming email to be divided into two (or more) normal email batch files, one for each user (based on various filtering rules within procmail), ideally located in /var/mail/<user>, ready for collection using mutt or whatever. Is this sensible and/or feasible like this? John -- John Pettigrew Headstrong Games john@headstrong-games.co.uk Fun : Strategy : Price http://www.headstrong-games.co.uk/ Board games that won't break the bank Valley of the Kings: ransack an ancient Egyptian tomb but beware of mummies!
![](https://seccdn.libravatar.org/avatar/861b5545c111d2257fa12e533e723110.jpg?s=120&d=mm&r=g)
The 03.06.06 at 14:45, John Pettigrew wrote:
So, IIUC, the YaST MTA section applies only to postfix, and will collect email from the specified ISP accounts and deliver the email into batch files within /var/mail/<user> ?
Right, postfix will put the email in mbox format there.
Which local user should I pick to receive the unfiltered email? I see that
I would use either one of the final recipients (the one acting as "boss"), or a new one. Just make sure that email that doesn't fit any recipe is sent to somebody that can forward it and correct the procmail rule.
Then, once the email has arrived for this user, procmail is run on it - do I need a ~/.forward file using SuSE8.2 and postfix?
No, just tell yast that you will use procmail for local delivery, and yast will configure it for you. Remember to set an alias for root, because he will no longer receive mail (documented in postfix faq). Then create a /home/user/.procmailrc file with your recipes. There are examples in the manpages.
What I want is for the incoming email to be divided into two (or more) normal email batch files, one for each user (based on various filtering rules within procmail), ideally located in /var/mail/<user>, ready for collection using mutt or whatever. Is this sensible and/or feasible like this?
Procmail can be set to deliver to mailboxes files, or to forward to a user (local or remote), so that postfix will handle it again. As long as the user is a different one than the one that does the forward, there will be no loops. It is also possible to call procmail directly from fetchmail, but I have never done it. Some people on this list do it that way. Again, "man procmailex". -- Cheers, Carlos Robinson
![](https://seccdn.libravatar.org/avatar/db06524eec146f5f75d0dc6d9032d33d.jpg?s=120&d=mm&r=g)
In a previous message, Carlos E. R. wrote:
Which local user should I pick to receive the unfiltered email?
I would use either one of the final recipients (the one acting as "boss"), or a new one. Just make sure that email that doesn't fit any recipe is sent to somebody that can forward it and correct the procmail rule.
What is the best way to ensure that fetchmail runs continuously? The main user won't always be logged in, so starting fetchmail in daemon mode in .xinitrc doesn't seem to be the right way, and (given there is a daemon mode) it seems less ideal to use cron to run fetchmail every x minutes. TiA John -- John Pettigrew Headstrong Games john@headstrong-games.co.uk Fun : Strategy : Price http://www.headstrong-games.co.uk/ Board games that won't break the bank Valley of the Kings: ransack an ancient Egyptian tomb but beware of mummies!
![](https://seccdn.libravatar.org/avatar/861b5545c111d2257fa12e533e723110.jpg?s=120&d=mm&r=g)
The 03.06.10 at 10:35, John Pettigrew wrote:
What is the best way to ensure that fetchmail runs continuously? The main user won't always be logged in, so starting fetchmail in daemon mode in .xinitrc doesn't seem to be the right way, and (given there is a daemon mode) it seems less ideal to use cron to run fetchmail every x minutes.
I think that daemon mode is better that a cron job: if the fetchmail run has not finished, due to big emails, cron will not know; not that it matters much, because fetchmail will refuse to start a new sesion (for the same user). I call fetchmail from inside ip-up.local, once normal mode, then daemon mode; and I kill it from ip-down.local, as user root. Fetched mail is sent to my local user(s). This works well for a system with a modem only, no permanent internet connection. (My ip-up script simultaneously starts mail/news/fido send/receive cycles and clock sync). -- Cheers, Carlos Robinson
participants (2)
-
Carlos E. R.
-
John Pettigrew