HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Virtual Users And Domains With Postfix, Courier And MySQL [+ procmail ?] (http://www.howtoforge.com/forums/showthread.php?t=4872)

immobilia 13th June 2006 13:04

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 ? :confused:
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 ? :confused:

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

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

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.

falko 14th June 2006 02:21

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. :)

immobilia 14th June 2006 11:15

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?

falko 14th June 2006 19:09

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.

immobilia 29th June 2006 16:03

/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) ?

falko 30th June 2006 00:20

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.


All times are GMT +2. The time now is 05:59.

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