Discussion:
[MAILSCANNER] Block outgoing mail with rules
Kevin Old
2006-01-13 03:30:48 UTC
Permalink
[ The following text is in the "ISO-8859-1" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]

Hello everyone,

I have a need to block a user from sending to a few email addresses.
I've looked at the examples under the rules directory, but can't
figure out how to have a message archived instead of being delivered
if going TO a certain email address.

I think my rule should be like this:

To ***@idontwantsentto not sure what to put here

Also, to complicate things, I only want messages TO that address to
not be delivered if and only if the From address is ***@mydomain.

I've read the docs and still can't seem to figure it out....

Any help is appreciated,
Kevin
--
Kevin Old
***@gmail.com

------------------------ MailScanner list ------------------------
To unsubscribe, email ***@jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!
Kevin Old
2006-01-13 03:30:48 UTC
Permalink
[ The following text is in the "ISO-8859-1" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]
[snip]
Instead of blahblahblah you should put whatever would have been the
correct result for that configuration option if you hadn't used a
ruleset at all. For example, if this is going on the "Archive Mail"
option, then the correct blahblahblah would be a directory or file name.
Ok, according to EXAMPLES in /etc/MailScanner/rules , I've done this:

I put this into /etc/MailScanner/MailScanner.conf:

Block Outgoing To = /etc/MailScanner/rules/block.outgoing.rules

And here's my /etc/MailScanner/rules/block.outgoing.rules

To: ***@gmail.com and From: ***@uavco.com /tmp/kdo.txt

Here's the error I get from MailScanner:

Sep 22 11:41:30 uavco MailScanner[13358]: Syntax error(s) in configuration file:
Sep 22 11:41:30 uavco MailScanner[13358]: Unrecognised keyword
"blockoutgoingto" at line 1911
Sep 22 11:41:30 uavco MailScanner[13358]: Aborting due to syntax
errors in /etc/MailScanner/MailScanner.conf.


How do I define a new keyword for a new rules file?

Should I put this in another rules file?

Any help is appreciated,
--
Kevin Old
***@gmail.com

------------------------ MailScanner list ------------------------
To unsubscribe, email ***@jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!
Kevin Old
2006-01-13 03:30:48 UTC
Permalink
[ The following text is in the "ISO-8859-1" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]
[snip]
Post by Kevin Old
How do I define a new keyword for a new rules file?
Kevin,
You can't define any new keyword in MS. You have to make do with the
Non Spam Actions = deliver
to use your ruleset. But remember that the last keyword on every line
in your ruleset must be one of the following (I guess you'll want to use
# deliver - deliver the message as normal
# delete - delete the message
# store - store the message in the quarantine
# striphtml - convert all in-line HTML content to plain
text
# header "name: value" - Add the header
# name: value
# to the message. name must not contain any
spaces.
Thanks Denis. This is exactly what I needed to do. I'm including it
here for the archives.

Kevin
--
Kevin Old
***@gmail.com

------------------------ MailScanner list ------------------------
To unsubscribe, email ***@jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!
Kevin Old
2006-01-13 03:30:49 UTC
Permalink
[ The following text is in the "ISO-8859-1" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]
[snip]
Instead of blahblahblah you should put whatever would have been the
correct result for that configuration option if you hadn't used a
ruleset at all. For example, if this is going on the "Archive Mail"
option, then the correct blahblahblah would be a directory or file name.
Ok, according to EXAMPLES in /etc/MailScanner/rules , I've done this:

I put this into /etc/MailScanner/MailScanner.conf:

Block Outgoing To = /etc/MailScanner/rules/block.outgoing.rules

And here's my /etc/MailScanner/rules/block.outgoing.rules

To: ***@gmail.com and From: ***@uavco.com /tmp/kdo.txt

Here's the error I get from MailScanner:

Sep 22 11:41:30 uavco MailScanner[13358]: Syntax error(s) in configuration file:
Sep 22 11:41:30 uavco MailScanner[13358]: Unrecognised keyword
"blockoutgoingto" at line 1911
Sep 22 11:41:30 uavco MailScanner[13358]: Aborting due to syntax
errors in /etc/MailScanner/MailScanner.conf.


How do I define a new keyword for a new rules file?

Should I put this in another rules file?

Any help is appreciated,
--
Kevin Old
***@gmail.com

Continue reading on narkive:
Loading...