Koozali.org: home of the SME Server

cc copy as a default config

droid_cebu

cc copy as a default config
« on: March 29, 2006, 11:57:04 AM »
Is it possible to configure SME to create cc copies on all outgoing mails to a desired mailbox as a default for all users?

Any advice is greatly appreciated. Thanks

Offline JonB

  • *
  • 351
  • +0/-0
cc copy as a default config
« Reply #1 on: March 29, 2006, 12:52:43 PM »
droid,

What you want is available from a plugin in qpsmtpd and is called Bcc

From the console as root

Code: [Select]
config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com
signal-event email-update


where the BccUser is the email address you want all copies of all incoming and outgoing emails to go to.

Note that in some countries you are required by law to notify your users that you are keeping a copy of all their emails. You would be surprised how quickly it cuts down on personal email. However it also has the effect of an increase in the use of hotmail, Yahoo etc

Jon
...

wallyrp

cc copy as a default config
« Reply #2 on: March 30, 2006, 05:54:38 PM »
Good Morning,

I'm still looking for a way to block all BCC email as this is the preferred method of spammers. I know that this bucks the whole system and all but as a general rule of thumb, I don't need BCC.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
cc copy as a default config
« Reply #3 on: March 30, 2006, 08:53:52 PM »
Quote from: "wallyrp"

I'm still looking for a way to block all BCC email ...


BCC is a feature of individual mail programs. It can't be blocked at the server (otherwise there would be a trivial way to block spam, wouldn't there? And there obviously isn't.).

droid_cebu

cc copy as a default config
« Reply #4 on: April 11, 2006, 03:14:30 PM »
Hi,

Thanks for the help. you did however miss the d on "enable"

It should be "config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com

It worked great!

Offline veeresh

  • **
  • 51
  • +0/-0
problem with cc copy as default config
« Reply #5 on: June 26, 2006, 08:00:29 AM »
Hi,

I ran the folowing command for cc as default config

config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com
signal-event email-update

But I am not getting copies to the BccUser.

there is an entry in /var/log/qpsmtpd/current as follows

loading bcc mode cc all xxx@domain.com

can anybody point me as to how to debug this.

thanks in advance

Veeresh

Offline raem

  • *
  • 3,972
  • +4/-0
Re: problem with cc copy as default config
« Reply #6 on: June 26, 2006, 09:19:31 AM »
veeresh

Check your settings with
config show qpsmtpd

The Bcc & BccUser settings should match what you configured

qpsmtpd=service
Bcc=disabled
BccUser=maillog
DNSBL=disabled
LogLevel=6
MaxScannerSize=25000000
RBLList=sbl-xbl.spamhaus.org,whois.rfc-ignorant.org,dnsbl.njabl.org,relays.ordb.org
RHSBL=disabled
RequireResolvableFromHost=no
SBLList=dsn.rfc-ignorant.org
access=public
status=enabled
...

Offline veeresh

  • **
  • 51
  • +0/-0
cc copy as a default config
« Reply #7 on: June 26, 2006, 12:36:01 PM »
Hi,

Thanks Ray


here is the result of
#config show qpsmtpd

qpsmtpd=service
Bcc=enabled
BccUser=xxx@mydomain.com
DNSBL=disabled
LogLevel=8
MaxScannerSize=25000000
RBLList=sbl-xbl.spamhaus.org,whois.rfc-ignorant.org,dnsbl.njabl.org,relays.ordb.org
RHSBL=disabled
RequireResolvableFromHost=no
SBLList=dsn.rfc-ignorant.org
access=public
status=enabled

but still i do not get BccUser copies

Veeresh

Offline raem

  • *
  • 3,972
  • +4/-0
cc copy as a default config
« Reply #8 on: June 26, 2006, 01:02:53 PM »
veeresh

> BccUser=xxx@mydomain.com

Did you literally enter this as xxx@mydomain.com or have you obfuscated your post ? You should enter the real email address of the cc recipient.

> DNSBL=disabled
> RHSBL=disabled

You might like to enable these settings for greatly improved spam rejection see

http://mirror.contribs.org/smeserver//contribs/rmitchell/smeserver/howto/Spam%20blocking%20HOWTO%20using%20qpsmtpd%20&%20RBL%20for%20sme%20server.htm
...

Offline veeresh

  • **
  • 51
  • +0/-0
cc copy as a default config
« Reply #9 on: June 26, 2006, 01:29:01 PM »
Hi,

I obfuscated my post, it is not literally xxx@mydomain.com

any further leads

thanks

Offline JonB

  • *
  • 351
  • +0/-0
cc copy as a default config
« Reply #10 on: June 26, 2006, 02:11:06 PM »
Veeresh, works perfectly for me.

Is xxx@domain.com a user on your server or external?
Can you send an ordinary email to that user and receive it?
Can you send a Bcc email to that user and receive it?

Jon
...

Offline veeresh

  • **
  • 51
  • +0/-0
cc copy as a default config
« Reply #11 on: June 26, 2006, 03:15:45 PM »
Hi,

Thanks RayMitchell and JonB,

It works fine.  

The problem was that i had logged in to the server as root for enabling BccUser.  After that I sent the mails from the console itself as root.
these were not copied to BccUser. But when I sent mails from the mail client as any other user i get copies to BccUser.

Is this by design.

Anyways thanks for the support.

Veeresh

aelculladajr

no function
« Reply #12 on: February 22, 2007, 08:23:40 AM »
i try to use the code given

config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com
signal-event email-update

there is no result! i put my own account replace to "xxx@domain.com", the bcc is enabled i can recieve incoming but i can't recieve the outgoing mail

here is the result of
#config show qpsmtpd

qpsmtpd=service
Bcc=enabled
BccUser=aelculladajr@danielefurniture.net
DNSBL=disabled
LogLevel=8
MaxScannerSize=25000000
RBLList=sbl-xbl.spamhaus.org,whois.rfc-ignorant.org,dnsbl.njabl.org,relays.ordb.org
RHSBL=disabled
RequireResolvableFromHost=no
SBLList=dsn.rfc-ignorant.org
access=public
signal-event=email-update
status=enabled


pls help me!

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
cc copy as a default config
« Reply #13 on: February 22, 2007, 09:01:13 AM »
Quote from: "wallyrp"
Good Morning,

I'm still looking for a way to block all BCC email as this is the preferred method of spammers. I know that this bucks the whole system and all but as a general rule of thumb, I don't need BCC.


Yes, you almost certainly do. Bcc mail is just one case of mail where the envelope recipients do not match the header recipients. Mailing lists are another. Mail systems which don't understand the difference between the envelope and the headers are evil.
............

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
cc copy as a default config
« Reply #14 on: February 22, 2007, 09:05:42 AM »
Quote from: "veeresh"

The problem was that i had logged in to the server as root for enabling BccUser.  After that I sent the mails from the console itself as root.
these were not copied to BccUser. But when I sent mails from the mail client as any other user i get copies to BccUser.

Is this by design.


Yes. Mail injected on the server itself is not normally injected via SMTP and so does not pass through qpsmtpd. This means that mail from cron and similar is not stored in the BccUser's mailbox. In general, this is a good thing. Mail injected in the normal ways - SMTP clients and webmail (which is also SMTP) are handled.
............

Offline JonB

  • *
  • 351
  • +0/-0
cc copy as a default config
« Reply #15 on: February 22, 2007, 09:18:45 AM »
Ah, whats this

Code: [Select]
access=public
[b]signal-event=email-update [/b]
status=enabled


You have done a

Code: [Select]
config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com signal-event email-update

It is actually two commands

Now you need to do

Code: [Select]
config delprop qpsmtpd signal-event email-update
signal-event email-update


which will remove the incorrect property and reload the email configurations

Note: it is two seperate comands

Jon
...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
cc copy as a default config
« Reply #16 on: February 22, 2007, 03:50:49 PM »
Quote from: "JonB"

Now you need to do

Code: [Select]
config delprop qpsmtpd signal-event email-update
signal-event email-update


which will remove the incorrect property and reload the email configurations


The first line should be just

Code: [Select]

config delprop qpsmtpd signal-event

Offline JonB

  • *
  • 351
  • +0/-0
cc copy as a default config
« Reply #17 on: February 22, 2007, 09:07:43 PM »
Oops,

I should check what I am copying and pasting. It will however still work as the command takes only the first property.

Jon
...

peertopeer

cc copy as a default config
« Reply #18 on: March 05, 2007, 04:25:50 PM »
Hi,

how can I use qpsmtpd and Bcc to copy only all incoming mails ?

Peer

Offline byte

  • *
  • 2,183
  • +2/-0
cc copy as a default config
« Reply #19 on: March 05, 2007, 07:02:34 PM »
Quote from: "peertopeer"

How can I use qpsmtpd and Bcc to copy only all incoming mails ?


As far as I'm aware the Bcc copy only does incoming/outgoing you don't have choice unless you know how to write a qpsmtp plugin
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

peertopeer

cc copy as a default config
« Reply #20 on: March 06, 2007, 12:26:04 PM »
Thanks for your fast reply - I think there's a switch

I found this in the script:

Forwards a copy of all mail (or just incoming or outgoing mail) to the
given email address (useful for archiving etc.) ....

=item all <email>

Send a copy of all email to the given address.

=item incoming <email>

Send a copy of all incoming email to the given address. Mail is considered
incoming if it is going to a recipient with a domain in 'rcpthosts'.

=item outgoing <email>

Send a copy of all outgoing email to the given address. Mail is considered
outgoing if it is sent from a relay client.

Code: [Select]

    my ($key, $value) = split /\s+/, $_, 2;
    next unless $key =~ m/(mode|all|incoming|outgoing)/;


I trie "config setprop qpsmtpd BccMode incoming" and "config setprop qpsmtpd BccIncoming on"

but sadly without any results perhaps anyone knows the switches or the config file ? I don't find a bcc config file on my server :-( !?

Peer

peertopeer

cc copy as a default config
« Reply #21 on: March 14, 2007, 09:38:21 AM »
Hi,

how can I delete a wrong entry in qpsmtpd ?

Peer

Offline raem

  • *
  • 3,972
  • +4/-0
cc copy as a default config
« Reply #22 on: March 14, 2007, 10:57:53 AM »
peertopeer

> how can I delete a wrong entry in qpsmtpd ?

I assume you mean qpsmtpd entries in the configuration database
At a command prompt type
db
to show you the syntax
...

peertopeer

cc copy as a default config
« Reply #23 on: March 14, 2007, 11:30:18 AM »
Thanks for your fast reply - Idon't know how to use "db"

I want to delete the entry BccUser=xxx@xxx.de
and BccAll=off

Perhaps you can write the syntax ?

Thanks

Peer

Offline raem

  • *
  • 3,972
  • +4/-0
cc copy as a default config
« Reply #24 on: March 14, 2007, 02:19:04 PM »
peertopeer

> I don't know how to use "db"

log in as root and at the command prompt type
db
press enter
it will show you a list of syntax commands to use

Then work out from the entries you have what to do next eg
from an earlier post by jonb
config setprop qpsmtpd Bcc enabled BccUser xxx@domain.com


> Perhaps you can write the syntax ?

You should learn the basics of this as it is fundamental to using sme server
and you can apply it to other db entries/commands

[root@server ~]# db
usage:
    /sbin/e-smith/db dbfile keys
    /sbin/e-smith/db dbfile print [key]
    /sbin/e-smith/db dbfile show [key]
    /sbin/e-smith/db dbfile get key
    /sbin/e-smith/db dbfile set key type [prop1 val1] [prop2 val2] ...
    /sbin/e-smith/db dbfile setdefault key type [prop1 val1] [prop2 val2] ...
    /sbin/e-smith/db dbfile delete key
    /sbin/e-smith/db dbfile printtype [key]
    /sbin/e-smith/db dbfile gettype key
    /sbin/e-smith/db dbfile settype key type
    /sbin/e-smith/db dbfile printprop key [prop1] [prop2] [prop3] ...
    /sbin/e-smith/db dbfile getprop key prop
    /sbin/e-smith/db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ...
    /sbin/e-smith/db dbfile delprop key prop1 [prop2] [prop3] ...


So you choose the syntax from those listed and put the values in that you wish to change.
It sounds like you want this syntax entry type
/sbin/e-smith/db dbfile delprop key prop1 [prop2] [prop3]
So to delete the entry BccUser=xxx@xxx.de
and BccAll=off

do
/sbin/e-smith/db configuration delprop qpsmtpd BccUser

/sbin/e-smith/db configuration delprop qpsmtpd BccAll

in sme7 you don't need to type the /sbin/e-smith/ part at all
and for the configuration database only, these can be shortened to
config delprop qpsmtpd BccUser
config delprop qpsmtpd BccAll
...

peertopeer

cc copy as a default config
« Reply #25 on: March 14, 2007, 03:26:40 PM »
Thanks!! It works fine

peertopeer

cc copy as a default config
« Reply #26 on: March 16, 2007, 12:58:46 PM »
Now I found a solution to copy only the incoming mails

/var/service/qpsmtpd/config/peers -> shows in all files

bcc mode cc all xxxx@xxxx.com


I change this to


bcc mode cc incoming xxxx@xxxx.com


Sadly I don't know the real switch for config setprop qpsmtpd :-(

at the moment after a signal-event email-update

 "all" overwrite "incoming" and you have to edit the files once more

Perhaps someone knows the switch !? By the way thanks to Gavin Carr (the programmer of the bcc plugin) he helped me to find the switch in the peers



Peer

Offline raem

  • *
  • 3,972
  • +4/-0
cc copy as a default config
« Reply #27 on: March 16, 2007, 10:09:10 PM »
peertopeer

> Sadly I don't know the real switch for config setprop qpsmtpd
> at the moment after a signal-event email-update
> "all" overwrite "incoming" and you have to edit the files once more


You can't just use/create new db entries/switches because you'd like  to have one, the base code needs to support those db entries.

What you are experiencing is by design, if you change config files directly these will be overwritten with system default vales the next time a system event occurs.

The sme way to make changes permanent when there is no db entry available to make the change, is to create custom templates. Whenever a system event occurs these "new" default values in .../templates-custom/... will override the system default values in the normal templates/databases.

I suggest you read the Developers guide as it explains the templating process and then look at the template fragments code for qpsmtpd or whichever config file you have changed.
The devguide also explains howto create (generic) custom templates.
You need to apply that knowledge to your particular requirement.
...

Offline byte

  • *
  • 2,183
  • +2/-0
cc copy as a default config
« Reply #28 on: March 17, 2007, 12:14:19 AM »
Also have a look at how we did it here ;)

http://bugs.contribs.org/show_bug.cgi?id=13
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!