Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th June 2006, 12:04
immobilia immobilia is offline
Junior Member
 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Virtual Users And Domains With Postfix, Courier And MySQL + Add Mailfiltering

Hello, i'have succefully try your excelent tutorial : Virtual Users And Domains With Postfix, Courier And MySQL

Now, i need configure spam level for each users, how to ?
SA-learning seems use procmail, but Postfix use VDA to delivered mail.

Need i to add a delivered (procmail) agent in /etc/postfix/master.cf ? as
#procmail unix - n n - - pipe flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
But what is the correct syntax ?

How to use procmail why Virtual mysql users ?

Question : When we use transport of one domain to maildrop, we can't use users forwardings ?

Another question, how to create a Maildir/ file named "MyDir" instead of ".MyDir", it's a restriction of Courier server or other ?

And when i add Add Mailfiltering to the Falko howto Postfix Guide
I think i don't use correctly the filter while i creating me a file .spam, doesn't it create me Maidir ?

Quote:
Next we need a basic Mailfilter to test:

In my example mailfilters will be stored in the following location:

/home/vmail/.mailfilter/user@domain.com


Below we have a very basic filter:

logfile "/home/vmail/.mailfilters/mailfilter-log.txt"

if ( /^Subject: SPAM/)
{
log "------------------------------------------------------------- Spam general. "
to "/home/vmail/example.com/lnoiseau/.spam" # Make this "cc" for copy or "to" to not send it to Inbox.
}
else
{
to "/home/vmail/example.com/lnoiseau/."
}
In fact with this filter, if Maildir doesn't exist, maildrop create just one file as we are Not Maildir/ mail files.
Must be add verification and if necessary create Maildir/ file whith maildirmake.

Last edited by immobilia; 13th June 2006 at 17:30. Reason: Mailfiltering Procmail / Maildrop
Reply With Quote
Sponsored Links
  #2  
Old 14th June 2006, 01:21
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Did you have a look here? http://www.howtoforge.com/postfix_mailfilter

It's an extension to my Postfix virtual users howto and might answer some of your questions.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 14th June 2006, 10:15
immobilia immobilia is offline
Junior Member
 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default I think i have read all post in this forum

Yes falko, i think i have look the totality of forum

Add Mailfiltering to the Falko howto Postfix Guide
http://www.howtoforge.com/postfix_mailfilter

Virtual Users And Domains With Postfix, Courier And MySQL
http://www.howtoforge.com/virtual_po..._quota_courier

and more...

My old problem (resolve) is when i use mailfiltering (with transport of my domain to maildrop), i thinked lost the advantage of forwardings table.
Example :
Quote:
forwardings
+--------------------------+------------------------------------------+
| source | destination |
+--------------------------+------------------------------------------+
| all@example.com | lnoiseau@example.com,immobilia@example.com |
| test@example.com | lnoiseau@example.com |
+--------------------------+------------------------------------------+

transport
+-------------+-----------+
| domain | transport |
+-------------+-----------+
| example.com | maildrop |
+-------------+-----------+

users
+--------+----------------------+---------------+----------+----------------------------------+------+------+
| active | email | password | quota | maildir | uid | gid |
+--------+----------------------+---------------+----------+----------------------------------+------+------+
| yes | sjachym@example.com | FWvXS/iXuU6Nw | 10485760 | /home/vmail/example.com/sjachym | 5000 | 5000 |
| yes | lnoiseau@example.com | iXyUV7AAvxWPE | 10485760 | /home/vmail/example.com/lnoiseau | 5000 | 5000 |
| yes | test@example.com | BE2rooLJsSyOo | 10485760 | /home/vmail/example.com/test | 5000 | 5000 |
+--------+----------------------+---------------+----------+----------------------------------+------+------+
When i send mail to all@example.com, transport look priority on forwardings, and maildrop try to delivered mail to user : all who doesn't exist.
Jun 14 09:23:48 server1 postfix/pipe[32741]: 895FC3C002B: to=<all@example.com>, relay=maildrop, delay=0, status=deferred (temporary failure. Command output: /usr/local/maildrop/bin/maildrop: Invalid user specified. )

But i think it was "receive_override_options = no_address_mappings" that kill alias.
Now i'have comment :
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
I have not yet retry with this options ON.

But my error is in maildrop when delivering message
Quote:
if ( /^Subject: SPAM/)
{
log "------------------------------------------------------------- Spam general. "
to "/home/vmail/example.com/lnoiseau/.spam" # Make this "cc" for copy or "to" to not send it to Inbox.
}
The message is dump in a mbox file instead of a maildir.
I need create Folder first from my Imap client for it's work. This is obligatory ?


Somebody can indicate me a mail serveur able to manage :
virtual users (mysql, ldap, ...) ,
optionnaly quota per user ,
virtuals domains ,
SMTP + imap + pop ,
antivirus (free) ,
antispam (free and definition file peer user) ,
mailfiltering
+
a webmail (multilanguage including FR) + (declaration mail spam for learning) + (vacation) + (administration of mail filters)
optionally a back office to adminstrate virtual users and virtual domains

Or help me to use Virtual Users And Domains With Postfix, Courier And MySQL with another MDA (Procmail...) without transport.

http://www.oav.net/vda/VIRTUAL_README.txt
The agent does not support user+foo address extensions, aliases or .forward files (use the virtual table instead), and therefore doesn't support file or program aliases. This choice was made to simplify and streamline the code (it allowed me to dispense with 70% of local's code - mostly the bits that are a security headache) - if you need this functionality, this agent isn't for you.

What the best file format ? mbox or maildir?

Last edited by immobilia; 14th June 2006 at 13:00. Reason: Modifiy conf
Reply With Quote
  #4  
Old 14th June 2006, 18:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by immobilia
The message is dump in a mbox file instead of a maildir.
I need create Folder first from my Imap client for it's work. This is obligatory ?
What's in your maildroprc?


Quote:
Originally Posted by immobilia
What the best file format ? mbox or maildir?
I prefer Maildir because it stores one email message per file instead of all email messages in one file.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 29th June 2006, 15:03
immobilia immobilia is offline
Junior Member
 
Join Date: Jun 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

/etc/maildroprc :
Code:
# Global maildrop filter file

# Uncomment this line to make maildrop default to ~/Maildir for
# delivery- this is where courier-imap (amongst others) will look.
#DEFAULT="$HOME/Maildir"

LOGNAME=tolower("$LOGNAME")
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="/home/vmail/$HOST/$USER/."

if ( "$EXTENSION" ne "" )
{
  DELIMITER="+"
}

if (!$SENDER)
{
  SENDER = "<>"
}

#
# Autocreate maildir, if not existant
#

`test -e /home/vmail/$HOST`
if ( $RETURNCODE != 0 )
{
  `mkdir /home/vmail/$HOST`
}

`test -e /home/vmail/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
  `/usr/local/maildrop/bin/maildirmake /home/vmail/$HOST/$USER`
  `chmod -R 0700 /home/vmail/$HOST`
}

#
# Check that user has his own maildrop include,
# if not available, check if $DEFAULT is set
# (newer maildrop get's that from the DB and updates
# it) and deliver or fail temporarily if not available
#

`test -f /home/vmail/.mailfilters/$LOGNAME`
if ( $RETURNCODE == 0 )
{
  include "/home/vmail/.mailfilters/$LOGNAME"
}
else
{
  if ( "$DEFAULT" ne "" )
  {
    to "$DEFAULT"
  }
  else
  {
    EXITCODE=75
    exit
  }
}
In fact my reel question must be:
Can user connect to her mailbox before i create his maildir (manualy or automatically when user received first mail) ?
Reply With Quote
  #6  
Old 29th June 2006, 23:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
 
Default

Quote:
Originally Posted by immobilia
In fact my reel question must be:
Can user connect to her mailbox before i create his maildir (manualy or automatically when user received first mail) ?
No, Maildir must exist before you connect to it.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs mholownych HOWTO-Related Questions 10 29th May 2006 03:39
Autoreply problem using Virtual Users And Domains With Postfix, Courier And MySQL triak HOWTO-Related Questions 1 19th May 2006 15:25
Virtual Users And Domains With Postfix, Courier And MySQL - "apt-get" and Courier burritonator HOWTO-Related Questions 3 15th March 2006 20:11
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 02:53
Another Problem: Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP bluegrass Installation/Configuration 24 8th March 2006 01:41


All times are GMT +2. The time now is 16:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.