|
|
| Author |
Message |
| 19 new of 118 responses total. |
gelinas
|
|
response 100 of 118:
|
Feb 24 00:37 UTC 2007 |
This is the first you've actually asked _just_ for an entry in motd, Sindi.
All of your previous requests have been "Install this" and "Delete mailboxes."
Send the text you want in the motd to staff@cyberspace.org, and one of us
(probably me) will post it for you.
|
cross
|
|
response 101 of 118:
|
Feb 24 02:52 UTC 2007 |
My problem with Sindi's requests are that she has absolutely no understanding
of the technology. None. It's frankly a bother to respond back to her time
and again when she says the same sophmoric thing over and over again.
|
keesan
|
|
response 102 of 118:
|
Feb 24 05:02 UTC 2007 |
I would be happy if someone on staff would take over from remmers on the spam
filter project. I have asked on my linux list for help creating a script that
would automate changing the login in my sample .procmailrc based on what the
user types as login, and copying the result to their home directory. Then
nobody would have to email me for help, they could just run that script. The
author of our linux suggested:
echo "Type in your login name"
read answer
cat file | sed -e /another string/$answer? > new-file
(I think another string would be keesan in this case, to replace
my login with theirs, and file would be my sample .procmailrc, whereas
new-file would be .procmailrc).
It would help to first automatically copy my sample file to their home
directory, but it was suggested to identify where that is by parsing
/etc/passwd
cat /etc/passwd|grep ^username|cut -d: -f6
(I am lost here - would the username here be the same as answer above?).
They would also need to copy over .forward from my directory.
Can anyone here do better than that? I would be happy to put such a script
in my home directory and make world-executable. I already have several sample
.procmailrcs. Then the motd could just announce the existence of a usable
script instead of giving my email address.
I do not know how to write shell scripts. Would the above work for all
available shells at grex or just bash? Probably people who have changed their
shell know how to edit .procmailrc to change the login.
How about a contest for writing the simplest script that would copy two files
from my directory to a user's directory (or append them to existing files)
and then replace keesan with the user's login name? I already had lots of
help setting up the filter from McNally and other's, and a kind stranger from
Germany explained how to use spamassassin.
|
keesan
|
|
response 103 of 118:
|
Feb 24 05:16 UTC 2007 |
I looked at the proposed script and tried to figure out how it worked.
Instead of the above, if the user is running the script from their own
directory, would `whoami` produce their login? If so:
cat ~keesan/procmailrc.sample | sed -e /keesan/`whoami`/ > .procmailrc
cat ~keesan/.forward > .forward
This would replace these two files if they already existed. How do I append
to them instead?
Does anyone brave want to test the above from their own directory?
(I forget just what I named my most recent sample .procmailrc and there may
be several of different names). I am sending anything with three or more spam
points to /dev/null, I think, but it could be to a spam folder instead.
Do NOT look at my actual .procmailrc, which is a game I am playing with the
spammers.
|
mcnally
|
|
response 104 of 118:
|
Feb 24 17:48 UTC 2007 |
This response has been erased.
|
mcnally
|
|
response 105 of 118:
|
Feb 24 18:06 UTC 2007 |
A couple of pointers:
1) almost everybody (everybody?) will have the $USER environment
variable set by login, so you probably won't have to ask the
user for their login specifically, just use $USER. If you
don't want to use the USER variable there are other ways,
e.g. touch a test file in /tmp and look at the ownership for it,
then remove it afterwards.. Or use `who am i`
2) when used with the "-i" flag sed will do an in-place edit on
a file. Or, skip the copy phase and use sed to do it, e.g.
# check for existing .forward and back it up before proceeding
[ -f ~/.forward ] && mv ~/.forward ~/.forward.$$
# copy keesan's .forward but change instances of keesan to $USER
sed "s/keesan/${USER}" ~keesan/.forward > ~/.forward
Those are rough suggestions. And they won't work (as is) for anyone
who uses the Bourne shell (/bin/sh) if it really is a Bourne shell
(I haven't tested on OpenBSD to see if it's an "improved" Bourne shell
that understands stuff like "~keesan".)
But the mechanics will work in most cases.
The problem with getting someone to write an officially-sanctioned one
is that there are always the oddball cases, which require a lot more
trouble to anticipate and code for.
|
keesan
|
|
response 106 of 118:
|
Feb 24 20:38 UTC 2007 |
Thanks Mike. I will attempt to understand this. Anyone who has switched from
the default shell (bash?) should be able to edit .procmailrc without help.
Anyone who has their own .forward file should be able to edit this one.
I need to read about what sed does. I don't know shell programming.
But I think your line starting in sed copies my two files and changes
one string in the first. This should be done to .procmailrc not .forward.
cp ~keesan/.forward . should work (after backing up). I will test this.
|
mcnally
|
|
response 107 of 118:
|
Feb 24 21:02 UTC 2007 |
If your .forward file only contains a pipe to procmail, then yeah,
you don't need to do it to .forward.
The lines I provided only act on the .forward. You would duplicate
them if you wanted lines that would act similarly on the .procmailrc
sed is a "stream editor" -- that is, it performs alterations on a
stream of input and then sends the results somewhere. sed can also
be used to do in-place edits on many files using the "-i" flag.
The syntax used by sed commands (e.g. "s/keesan/foobar/" comes from
a very early Unix editor, ed, but will be quite familiar to users
of ed's descendants (e.g. ex, vi, nvi, vim, etc..)
|
keesan
|
|
response 108 of 118:
|
Feb 24 21:20 UTC 2007 |
Some users, such as Denise, would also need to type E to exit the Menu system
first (from the Menu screen). I need to mention this in motd.
|
keesan
|
|
response 109 of 118:
|
Feb 25 00:32 UTC 2007 |
cat ~keesan/procmailrc.sample | sed -e/keesan/$USER/ >> ~./procmailrc
This is supposed to append my sample file to a user's .procmailrc rather than
back up and replace it. Similarly for .forward. Would that be okay?
If I get something working, perhaps staff could put it some place other than
my home directory, on the path. Or at least link to it.
|
cmcgee
|
|
response 110 of 118:
|
Feb 25 00:33 UTC 2007 |
Sindi, what you need to mention in the MOTD is that you are available to help,
and that there is an easy way to use spamassassin here.
The MOTD is not the place for instructions.
|
keesan
|
|
response 111 of 118:
|
Feb 25 00:46 UTC 2007 |
If I get more than 10 responses to the offer, perhaps some staff member could
set up something more permanent, that would be easier than running a script
in my directory.
|
keesan
|
|
response 112 of 118:
|
Feb 27 01:24 UTC 2007 |
Would a staff member just put in motd to email keesan@grex.org for help in
setting up a custom mail filter based on spamassassin. If I get a lot of
requests I will automate the process.
|
cross
|
|
response 113 of 118:
|
Feb 27 01:47 UTC 2007 |
Actually, I've got a better idea: let's get hooked up being one of
messagelabs.com's customers.
|
tsty
|
|
response 114 of 118:
|
Mar 23 04:14 UTC 2007 |
grex is my officiaol email addrs for lots of stuff. sendmail is JustFine (tm)
except for the edit/concatonatinfg provlem.
|
cross
|
|
response 115 of 118:
|
Mar 23 13:04 UTC 2007 |
Grex hasn't used sendmail for years.
|
tsty
|
|
response 116 of 118:
|
Mar 29 06:48 UTC 2007 |
well, whatever is the repl;acement then.
|
cross
|
|
response 117 of 118:
|
Mar 29 17:36 UTC 2007 |
Then perhaps you'd volunteer to maintain it?
|
mcnally
|
|
response 118 of 118:
|
Mar 29 18:11 UTC 2007 |
TS, to the best of my knowledge, *nobody* else but you has ever
encountered this problem.
I know a way to demonstrate whether or not you're causing it
yourself (which is what *I* think is happening..) if you're
interested in trying it.
|