Koozali.org: home of the SME Server

incoming mail also in maillog copy box

Offline mringoot

  • 4
  • +0/-0
incoming mail also in maillog copy box
« on: January 15, 2010, 04:34:36 PM »
Hello,

I'm managing a SME server where a pop3 catch-all mailbox is read from the sme server and placed in a mailbox on the server.
To archive sned mail I've configured the BCC option using the maillog user.

However incoming mail is also copied to the maillox box.
Is there a way to change the configuration that only sent mail is copied tot the maillog mailbox ?

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: incoming mail also in maillog copy box
« Reply #1 on: January 15, 2010, 05:31:19 PM »
hi, welcome here..

log in as root

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
cp /etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/13bcc /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
pico 13bcc

change the code from:
Code: [Select]
{
     return "# bcc disabled" unless ($qpsmtpd{Bcc} eq "enabled");
     return "bcc mode " . $qpsmtpd{BccMode} . " all " . $qpsmtpd{BccUser};
}

to
Code: [Select]
{
     return "# bcc disabled" unless ($qpsmtpd{Bcc} eq "enabled");
     return "bcc mode " . $qpsmtpd{BccMode} . " outgoing " . $qpsmtpd{BccUser};
}

save with Ctrl-X and confirm with y

then do
Code: [Select]
signal-event email-update

it should work

more info:
Code: [Select]
perldoc /usr/share/qpsmtpd/plugins/bcc

HTH

Offline mringoot

  • 4
  • +0/-0
Re: incoming mail also in maillog copy box
« Reply #2 on: January 15, 2010, 06:37:17 PM »
Thanks for the clear explanation.

However changing the parameter to outcoming doesn't seem to work.
" incoming " works and also " all ""
with " outgoing " no copy is made and sent to maillog. the documentation states something on the environment variable RELAYCLIENT which I don't understand.

Regards

Offline mringoot

  • 4
  • +0/-0
Re: incoming mail also in maillog copy box
« Reply #3 on: January 15, 2010, 06:52:34 PM »
Did another attempt from scratch

now it works :-D

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: incoming mail also in maillog copy box
« Reply #4 on: January 15, 2010, 06:53:16 PM »
ops.. my bad

I suspect you have to create a custom template also for these files:

./etc/e-smith/templates/var/service/qpsmtpd/config/plugins/13bcc
./etc/e-smith/templates/var/service/qpsmtpd/config/peers/local/13bcc

repeat the steps above modifying the folders accordingly

when done, raise
Code: [Select]
signal-event email-update

let us know, thank you

if something goes wrong, simply delete the templates-custom/var/service/qpsmtpd/config/ folder and raise the email-update event

Offline mringoot

  • 4
  • +0/-0
Re: incoming mail also in maillog copy box
« Reply #5 on: January 15, 2010, 08:32:18 PM »
tried and tested updating the additional 13bcc files, then it doess't work anymore.

So deleted the ..../config/peers/local file and dir and also the .../config/plugins file and dir

did a signal-event email-update again and the outgoing copy was functioning again.
So only the .../config/peers/0/ templates should be copied and modified

(in my first attempt I forgot to create the template-custom dir, which explains....)

Thanks for the quick help