procmail filters – apply to received mails.

If you already have some mail in your maildir and you have set procmail filters, then it is difficult to apply the procmail filter, right? Not so, you just need to go to the Inbox directory and then execute the command.

for i in *; do cat $i|procmail; rm -f "$i"; done

This will pass all of your e-mail through procmail again and then your filters will get applied. Mails will go to their appropriate directory and you will be one happy man, I hope.


Enhanced by Zemanta

sendmail or sending mail

If you want to use sendmail so that you can send all your mails from the local system to your email address, then you have to use sendmail.  Now, configuring sendmail has never been that easy and if you are working internally on your corporate network then for sending mails to the same domain, generally you don’t have to login. That being the case, you can use something simpler like “sstmp“. Install ssmtp with:

sudo yum install ssmtp

and then just open the file “/etc/ssmtp/ssmtp.conf”, change the email address, and you should be done. If your mail host is not reachable as “mail“, then you might need to change mailhub. Just check the alternatives with “galternatives” to make sure that mta/sendmail alternative default is set to “ssmtp“.


Enhanced by Zemanta