Koozali.org: home of the SME Server

How can I change the SPAM heading for spam mail ??

Offline steve288

  • *
  • 336
  • +0/-0
How can I change the SPAM heading for spam mail ??
« on: February 24, 2009, 06:33:12 PM »
We have recently upgraded to 7.3 SME.

In the past we had email that was spam come to us as [SPAM]

Now its just coming to us as ***SPAM****

We want to change it back to [SPAM]. Many users had rules set up to handle mail that used this format.

I have found a file called
/etc/e-smith/templates/etc/mail/spamassassin/local.cf10rewrite_subject

Which I asume is the place that it gets set up. But I dont know what to do with it. It has in it the following text.


{
    return "" unless ($spamassassin{SubjectTag} eq 'enabled');

    return "" unless ($spamassassin{Subject});

    return "rewrite_header Subject $spamassassin{Subject}";
}

Im sure that Im not suppose to change this, but how can I change the subject from ***SPAM*** to [SPAM]

Strangely in the
/etc/mail/spamassassin/local.cf file it has
the following line in it.

rewrite_header Subject [SPAM]

Im not sure if this means it suppose to be using square brackets or if this is just the syntax of the line.
I think? the question is where does it get this line from ?? that must be were I can change the SPAM warning format.

Regards






Offline steve288

  • *
  • 336
  • +0/-0
Re: How can I change the **SPAM** heading for spam mail ??
« Reply #2 on: February 24, 2009, 08:07:51 PM »
**Great that works fine.

By the way usually when I make changes to a script or something I put in a comment in the file so when and if I go back I know that I have done something. But in the spamassassin file that I have made changes to, it seems this is some sort of odd file. There are no # comments or anything???

Do you or anyone know how I can made a comment in this file??
Thanks.

For others On SME 7:

If you want to change the subject line that defaults to ***SPAM*** to something like [SPAM]

When you get a spam email message.

1. Go to /usr/share/qpsmtpd/plugins
2. make a cp of spamassassin file just in case you wreck something. e.g.
cp spamassassin spamassassin.old

3. Open the file using a text editor. eg vi spamassassin

4. Look near the bottom of the file for these lines.

my $subject = $transaction->header->get('Subject') || '';
  $transaction->header->replace('Subject', "***SPAM*** $subject");

5. Now carfully replace the words ***SPAM*** with what ever you like. We use [SPAM].

6. Save it.

7. I never know which of the these command Im suppose to do So I do both of them.

signal-event email-update ; svc -t /service/qpsmtpd

Thats it.




Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How can I change the SPAM heading for spam mail ??
« Reply #3 on: February 25, 2009, 07:37:34 PM »
Look Here:

http://forums.contribs.org/index.php/topic,34384.0.html

and here:

http://forums.contribs.org/index.php/topic,35329.0.html
Please do not give bad advice like this, as clearly in the template there is a database key defined which can be easily used without customization like done in the post above this:
I have found a file called
/etc/e-smith/templates/etc/mail/spamassassin/local.cf10rewrite_subject

Which I asume is the place that it gets set up. But I dont know what to do with it. It has in it the following text.

Code: [Select]
{
    return "" unless ($spamassassin{SubjectTag} eq 'enabled');

    return "" unless ($spamassassin{Subject});

    return "rewrite_header Subject $spamassassin{Subject}";
}
Part of it can be easily be configured through the server-manager and in this rare case (the subject tag is not set through the server-manager, so) you might need the shell commands to for that.

steve288 did you ever look at the server-manager panel(s) and read the manual? If not I suggest you do so as it is a very valuable source of information. SME Server is designed to be administered through the server-manager webinterface and most users never need the SME Server shell to do administration.

So to do this on the command line you need to do this:
Code: [Select]
db configuration setprop spamassassin Subject "[SPAM]" SubjectTag enabled
signal-event email-modify
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I change the SPAM heading for spam mail ??
« Reply #4 on: February 25, 2009, 08:02:33 PM »
cactus,

I believe if you will read the threads I supplied and look at what happens on your own server, you will find that the database setting is not actually where the subject tag comes from.

I personally think this should be raised as a bug as it is misleading. I also was going to point the OP to the db command that you recommend I then checked it on my server and found that although the db setting showed [SPAM] the subject was actually being written as ***SPAM***. If your server has the same results as mine, you will find that changing the db setting does NOT change the subject, instead the subject comes from a qpsmtpd plugin as described in the two posts I referenced.

If this is all incorrect or not the most efficient way to do what OP suggested I stand corrected and am open to further input.

Royce

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How can I change the SPAM heading for spam mail ??
« Reply #5 on: February 25, 2009, 08:11:07 PM »
I believe if you will read the threads I supplied and look at what happens on your own server, you will find that the database setting is not actually where the subject tag comes from.
I am sorry, I did not test this and assumed it would work.

I personally think this should be raised as a bug as it is misleading.
I agree on this as I, perhaps as others, assumed it would work and have the opinion it should work that way.

I also was going to point the OP to the db command that you recommend I then checked it on my server and found that although the db setting showed [SPAM] the subject was actually being written as ***SPAM***. If your server has the same results as mine, you will find that changing the db setting does NOT change the subject, instead the subject comes from a qpsmtpd plugin as described in the two posts I referenced.
Sorry once again, but since you seem to have the details, woud you be willing to launch the bug report? Thanks in advance!

If this is all incorrect or not the most efficient way to do what OP suggested I stand corrected and am open to further input.
Thanks for your reply and I am open for input as well and stand corrected :-)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I change the SPAM heading for spam mail ??
« Reply #6 on: February 25, 2009, 08:13:33 PM »
I will launch a bug later today or tomorrow.

Thanks,

Royce

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How can I change the SPAM heading for spam mail ??
« Reply #7 on: February 25, 2009, 08:14:46 PM »
I will launch a bug later today or tomorrow.
Thanks! Please post a reference to the bug... saves me (and others) searching for it. :-)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)


Offline steve288

  • *
  • 336
  • +0/-0
Re: How can I change the SPAM heading for spam mail ??
« Reply #9 on: February 26, 2009, 03:43:33 PM »
Thanks for all of your suggestions.

Yes I did read all the helps but frankly this version 7 is different than 6 and despite spending hours on reading things. Like most people I miss a lot and struggle to understand what you are reading, since so much of it goes by so quickly. Sometimes you need to get into so much granularity of a program just to do something "seemingly simple". It isnt alway easy to juggle your understanding of all the various programs. Strangely sometimes advice conflicts. In one of the help faq's as I recall, dont shoot me if im not 100% right but it says you should not do anything from the comand prompt, yet much of what you need to do you do have to do that way. Add to that the different way SME does this eg the templates, so that the system is so resilliant it adds another layer.
As far as the interface I didn't think there was anywhere to change the Spam heading.

Its a lot like the possible bug of [spam] in local.cf. It seems the things you think are dumb that you may mention you get ragged on for and then you remain silent on the things that you should mention. News groups are a lot like wives (sorry girls). What ever you say you always have someone whining that you didnt do the right things in the right way or read well enough and what a numbscull you are.

Thanks for all your advice it has all been helpfull. I hope the discussion helps others.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I change the SPAM heading for spam mail ??
« Reply #10 on: February 26, 2009, 04:22:22 PM »
steve288,

SME is an interesting offshoot of the linux tree. It takes the power of a trained tech's operating system and attempts to make it useable by the rest of us. In doing this it brings together a group of users on the forums that have a much larger disparity of skill levels then you would typically find on a linux forum. This causes a bit of pain on both ends of the skill scale as we tend to judge each other based on what we think is obvious.

The more skilled person has probably spent much time researching and reading to gain their level of skill. They have attained this skill partly because it is their personality to try to understand all they can about a system. When they perceive that someone is asking a question that is already well documented, their reaction is "I could find this in 5 seconds, why can't he?" They end with the conclusion that the poster is lazy and wants them to do the poster's work.

The less skilled person has possibly inherited IT responsibility as an additional part of another job (In my company Accounting automatically inherits some IT responsibility) They do not care as much how the system works as their interest may be accounting, maintenance, etc. They just care that it works. When they ask a question and somebody that they know could answer gives them an answer of "read the manual" their question is "Why didn't he type 5 more words and just give me the answer?" They end up with the conclusion that he is an arrogant beast that doesn't care about their problem.

The best solution that I can see to these two points of view is for both parties to try and understand what the other is thinking. Then apply what I was always told was the "Golden Rule" 'do unto others as you would have them do to you'.

99% of the time Cactus' answer is correct. "If you don't understand the code, STAY AWAY FROM THE COMMAND LINE." You can screw things up in ways you can't even imagine. The exception to this is the db commands. These are designed to be run from the command line by any admin. They have a level of safety built in because they can be returned to default values if the system becomes unstable after an incorrect entry.

If you are needing to modify SME in ways that are not available from the console or the db settings and you are an inexperienced or unskilled admin (I don't mean this offensively) you need to look at hiring a consultant or you will risk an unstable system.

If you are skilled and need to make major modifications I think you will find that SME may not be the distro for you. The templating system, while powerful for its specified use, limits the customization that can be done with linux at the operating system level.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: How can I change the SPAM heading for spam mail ??
« Reply #11 on: February 26, 2009, 06:13:24 PM »
mercyh

Quote
The templating system, while powerful for its specified use, limits the customization that can be done with linux at the operating system level.

I don't think Charlie & others would agree with that. In what way does it limit customisation ?
Pretty much anything that can be directly modified in /etc/xxx/...conf files, can be modified permanently via custom templates. Where does the limitation come in ?

Anyway, it's meant to make customisation safer and easier, and much easier to recover from errors that less skilled admins make, compared to making changes directly to conf files (which changes can become lost in time and create difficulties recovering from if you are a bit gung ho with conf file setting changes).
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I change the SPAM heading for spam mail ??
« Reply #12 on: February 26, 2009, 06:30:34 PM »
I thought I may be taken to task for that wording and I probably deserve it....

I think the wording instead of "limits" could be "complicates" and even that is maybe too strong.

I know of several situations where admins have moved certain services from SME to other linux distros because of this. By saying this I am in no way criticizing the SME work. There are just certain applications that in my mind fall outside of the mission of this project. Several quick examples:

Really advanced firewalls with multiple interfaces. We all know that SME with linux at its core can do this. Does it really pay to try to customize all the templates to make this happen on SME? In my opinion it does not and I do not think this capability should be part of the SME package. It is simply outside of our scope and mission.

Commercial Web and e-mail hosting services. This is not our target market and we are not optimized to do it. Of course it could be done but once again it is simply too much work to customize all the templates and open up certain services to the WAN when there are better distro options out there.

I would request this topic be locked as I have nothing but good in mind for this distro and this forum. These sorts of discussions seem to draw the more reactionary users of this forum and the last thing we need is yet another thread shot down in flames.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How can I change the SPAM heading for spam mail ??
« Reply #13 on: February 26, 2009, 09:59:43 PM »
Pretty much anything that can be directly modified in /etc/xxx/...conf files, can be modified permanently via custom templates.

Not pretty much anything - anything. Period.

The templating process doesn't limit what customisation you can do, but is limited. It only deals with configuration files. If you want to add, remove or modify programs, then you need a different approach. The current SPAM heading is done by a program (qpsmtpd).

If you want to fix the problem, please followup in the bug tracker.

Otherwise, enough has been said, hasn't it?

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I change the SPAM heading for spam mail ??
« Reply #14 on: February 26, 2009, 10:04:13 PM »
Otherwise, enough has been said, hasn't it?

Yep

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How can I change the SPAM heading for spam mail ??
« Reply #15 on: February 26, 2009, 10:35:55 PM »
Thanks for all of your suggestions.
You're welcome.

Yes I did read all the helps but frankly this version 7 is different than 6 and despite spending hours on reading things.
Both already used the server-manager, template system and the configuration database.

In one of the help faq's as I recall, dont shoot me if im not 100% right but it says you should not do anything from the comand prompt, yet much of what you need to do you do have to do that way.
I don't think you are right there. Almost all administration can be done through the server-manager, to manage my servers I hardly sue the SME Server shell.

Add to that the different way SME does this eg the templates, so that the system is so resilliant it adds another layer.
Not to make it resilient but to facilitate the user in not needing the linux knowlegde to run such a beast as SME Server.

As far as the interface I didn't think there was anywhere to change the Spam heading.
No one here said that. I never said that, I said you could enable the spam heading there the changing of the format was an exception to the normal style and should need shell access:
Part of it can be easily be configured through the server-manager and in this rare case (the subject tag is not set through the server-manager, so) you might need the shell commands to for that.

Its a lot like the possible bug of [spam] in local.cf. It seems the things you think are dumb that you may mention you get ragged on for and then you remain silent on the things that you should mention. News groups are a lot like wives (sorry girls). What ever you say you always have someone whining that you didnt do the right things in the right way or read well enough and what a numbscull you are.
I seriously suggest not to take you dissatisfaction/grief out on anyone unrelated to your issues and choose a better less offensive comparison.

Thanks for all your advice it has all been helpfull. I hope the discussion helps others
Not sure if it really is a discussion, to me it merely seems you spitting your dissatisfaction, fair enough, but you are free to choose any other system of course. Apart from that I don't think the last part will help people much as your posts after the bug reference your posts are off-topic to this thread AFAIC.
« Last Edit: February 26, 2009, 10:37:31 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Re: How can I change the SPAM heading for spam mail ??
« Reply #16 on: March 27, 2009, 03:19:39 AM »
There is no valid reason to lock this thread.  This discussion is valid and in the spirit of SME and the mission of these boards.
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.