maildrop filter rule

maildrop filter rule

am 20.05.2005 12:07:56 von Ronny

Hi,

can anybody show me how to bulid a maildrop rule to do put a mail for
a special domain including a special flag to a special imap folder?

I know the recipient is stored in LOGNAME and I know how to stor in a
special folder but I don't know the "if" phrase.

if(/^X-VIRUS-STATUS:.*INFECTED/)
{
exception {
...
MAILDIR = $MAILDIR.Virus/
}
}

exception {
to "$MAILDIR"
}

What I really need is is the part checking for the domain: "if
domain.tld is in $LOGNAME then".

regards

Ronny Seffner

Re: maildrop filter rule

am 20.05.2005 12:47:36 von Alan Connor

On comp.mail.misc, in
<43bf262a.0505200207.1224ddf8@posting.google.com>,
"Ronny Seffner" wrote:

> Hi,
>
> can anybody show me how to bulid a maildrop rule
> to do put a mail for a special domain including a
> special flag to a special imap folder?
>
> I know the recipient is stored in LOGNAME and I know
> how to stor in a special folder but I don't know the
> "if" phrase.

>
> if(/^X-VIRUS-STATUS:.*INFECTED/)
> {
> exception {
> ...
> MAILDIR = $MAILDIR.Virus/
> }
> }
>
> exception {
> to "$MAILDIR"
> }
>
> What I really need is is the part checking for the domain: "if
> domain.tld is in $LOGNAME then".
>
> regards
>
> Ronny Seffner

"Unlike procmail, maildrop uses a structured filtering
language that's a bit easier on the eyes."

Unlike procmail, I don't understand it. As for being "easier
on the eyes"? Who gives a fuck? (But first, who knows what that
even MEANS?)

And procmail's filtering language is certainly structured.

:0
* ^X-VIRUS-STATUS:.*INFECTED
{

:0
* ^To.*domain.tld
folder/

O:
different_folder/

}

If it has the X... header and it is to domain.ltd,
put it in that maildir folder under $MAILDIR.

If it isn't to domain..., then send it to a different
mailbox.

Hang loose. There's got to be a maildrop expert around here
somewhere.

Or you could switch to procmail. It's an ace program and does
everything in the maildrop description and there are experts
in its use crawling out of the woodwork, and more documentation
than you could ever read.

(Note: there's a punk troll around here. I don't read
its posts. Gotta million sock-puppets.)

AC


--
alanconnor AT earthlink DOT net
Use your real return address or I'll never know you
even tried to mail me. http://tinyurl.com/2t5kp

Re: maildrop filter rule

am 20.05.2005 15:07:50 von Sam

This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.

--=_mimegpg-commodore.email-scan.com-24971-1116594470-0002
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Ronny Seffner writes:

> Hi,
>
> can anybody show me how to bulid a maildrop rule to do put a mail for
> a special domain including a special flag to a special imap folder?
>
> I know the recipient is stored in LOGNAME and I know how to stor in a
> special folder but I don't know the "if" phrase.
>
> if(/^X-VIRUS-STATUS:.*INFECTED/)
> {
> exception {
> ...
> MAILDIR = $MAILDIR.Virus/

You should use quotes here:

MAILDIR="$MAILDIR.Virus"

And the trailing slash is not required.

> }
> }
>
> exception {
> to "$MAILDIR"
> }
>
> What I really need is is the part checking for the domain: "if
> domain.tld is in $LOGNAME then".

Presumably, something like this:

if ($LOGNAME =~ /@domain\.tld$/)

It really depends upon the actual format your recipients' addresses are
encoded in.




--=_mimegpg-commodore.email-scan.com-24971-1116594470-0002
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCjeEmx9p3GYHlUOIRAjneAKCBidc3nTS8xbfXuWbxDlL2X7hjxACe IZYI
q8KKl22PCDXsuf3j6rKlbJk=
=9xgW
-----END PGP SIGNATURE-----

--=_mimegpg-commodore.email-scan.com-24971-1116594470-0002--

Re: maildrop filter rule

am 20.05.2005 15:23:00 von Sam

This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.

--=_mimegpg-commodore.email-scan.com-24971-1116595380-0003
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Beavis writes:

> "Unlike procmail, maildrop uses a structured filtering
> language that's a bit easier on the eyes."
>
> Unlike procmail, I don't understand it.

You also don't understand how to properly wipe yourself after taking a dump.

So, what's your point?

> As for being "easier
> on the eyes"? Who gives a fuck? (But first, who knows what that
> even MEANS?)

Anyone who is a real programmer, instead of a Beavis wanna-be.

> And procmail's filtering language is certainly structured.
>
> :0
> * ^X-VIRUS-STATUS:.*INFECTED

And what kind of a structure would this be, Beavis?

> Hang loose. There's got to be a maildrop expert around here
> somewhere.

And more, Beavis.

> Or you could switch to procmail. It's an ace program and does
> everything in the maildrop description

Really, Beavis? Cough up procmail's equivalent of the following. Take your
time.

gdbmopen("recipientmap.dat", "R")

foreach /^(To|Cc): .*/
{
foreach (getaddr $MATCH) =~ /.+/)
{
FOLDER=gdbmfetch(tolower($MATCH), "D")
if ($FOLDER ne "")
{
cc "Maildir/.$FOLDER"
}
}
}

to "Maildir"

> (Note: there's a punk troll around here. I don't read
> its posts. Gotta million sock-puppets.)

Beavis, Tourette's syndrome can be treated with medication. Ask your
shrink.


--=_mimegpg-commodore.email-scan.com-24971-1116595380-0003
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCjeS0x9p3GYHlUOIRAk4TAJ0ZCk8zOxTmDnOUiysvqIegc+IkIACf ZcW5
uwAQToL99XE1639hAcpaAJc=
=iE1F
-----END PGP SIGNATURE-----

--=_mimegpg-commodore.email-scan.com-24971-1116595380-0003--

Re: maildrop filter rule

am 20.05.2005 15:50:18 von Sven Fehling

Ronny Seffner wrote:

> can anybody show me how to bulid a maildrop rule to do put a mail for
> a special domain including a special flag to a special imap folder?
>
> I know the recipient is stored in LOGNAME and I know how to stor in a
> special folder but I don't know the "if" phrase.
>
> if(/^X-VIRUS-STATUS:.*INFECTED/)
> {
> exception {
> ...
> MAILDIR = $MAILDIR.Virus/
> }
> }
>
> exception {
> to "$MAILDIR"
> }

If this rule should match on all mails for recepients in domain.tld I
would you use something like this:

if (/^X-VIRUS-STATUS:.*INFECTED/ && \
/^Envelope-to:.*domain\.tld$*/)
{
log '====> Virusinfected'
to $MAILDIR/.Virus
}

if your MTA sets an Envelope-to: header otherwise you could use a
similar headerline identifying domain.tld.


HTH
Sven