On Mon, 30 Nov 2009, Steve wrote:

>
> -------- Original-Nachricht --------
>> Datum: Fri, 20 Nov 2009 14:47:03 +0100 (CET)
>> Von: Nicolas Vilz <[email protected]>
>> An: Steve <[email protected]>
>> CC: [email protected]
>> Betreff: Re: [Dspam-user] Configuration Problem DeliveryHost
>
>>> -------- Original-Nachricht --------
>>>> Datum: Thu, 19 Nov 2009 16:16:47 +0100 (CET)
>>>> Von: Nicolas Vilz <[email protected]>
>>>> An: [email protected]
>>>> Betreff: [Dspam-user] Configuration Problem DeliveryHost
>>>
>>>> Hello guys,
>>>>
>>> Hallo Nicolas,
>> Hallo Steve,
>>
>>>
>>>
>>>> following szenario, i have a mail server which provides personal email
>>>> as well as mailman mailinglists. Software is postfix, dspam, dovecot,
>>>> clamav and mailman. The server is supposed to use dspam as lda and
>>>> should give mails directly to dspam. Postfix SMTP client will use
>>>> dspam as content filter. Fair enough.
>>>>
>>>> Now the tricky part: mailman will run locally, so dspam has to give
>>>> back mails for my subdomain in order that the other transport will process
>>>> mails. So i considered Option DeliveryHost.dom.ain in dspam.conf.
>>>> First i tried all Delivery-Options with Domain (i.e. DeliveryPort and so
>>>> on). After looking at the source, i discovered, that this is not needed.
>>>>
>>>> Now, dspam doesn't find a DeliveryHost for my main personal mail which
>>>> it is supposed to pass directly to dovecot delivery agent.
>>>>
>>>> Any help with this? Do i have to hack the source to do my requirements
>>>> or did i miss something?
>>>>
>>> You don't need to hack the software to get that working. I have exactly
>>> that setup over here and I did not hacked anything to get mailman to
>>> process the mail.
>>>
>>> Before I start giving you advices... Can you please post some more info
>>> how you have chained everything together? The stuff from master.cf is
>>> important, then main.cf (how do you identify mailman domains), then your
>>> mm_cfg.py, then your dspam.conf and last the output of "dspam --version".
>>
>> first my master.cf:
>>
>> 127.0.0.1:10026 inet    n       -       -       -       -       smtpd
>>                  -o content_filter=
>>                  -o
>> receive_override_options=no_unknown_recipient_checks,no_header_body_checks
>>                  -o smtpd_helo_restrictions=
>>                  -o smtpd_client_restrictions=
>>                  -o smtpd_sender_restrictions=
>>                  -o smtpd_recipient_restrictions=permit_mynetworks,reject
>>                  -o mynetworks=127.0.0.0/8
>>                  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
>> smtp      inet  n       -       n       -       -       smtpd
>>     -o content_filter=lmtp:inet:127.0.0.1:2424
>> mailman unix - n n - - pipe  flags=FR user=mailman
>> argv=/usr/lib/mailman/bin/postfix-to-mailman.py \${nexthop} ${user}
>>
>> the first entry is for giving back mail to postfix after checking.
>>
>> the second line lets postfix give mails to lda which is in my case dspam.
>> (dspam is listening on port 2424 in LMTP mode)
>>
>> The third is the mailman transport, which is supposed to collect... that
>> was
>> something i tried out, but it failed (i got several python errors).
>>
>> so i tried the following:
>>
>> (excerpt of my main.cf)
>>
>> ....
>> alias_maps = hash:/var/lib/mailman/data/aliases
>> ....
>> mydestination = $myhostname, localhost, localhost.localdomain,
>> lists.mydom.ain
>> ....
>> that finally worked sofar, if i let dspam give back the mails to postfix.
>> in the alias map, there will be the pipe mapping to the mailman scripts.
>>
>> In my dspam.conf i have the following (and the whole dspam.conf as
>> attachment):
>>
>> ....
>> TrustedDeliveryAgent "/usr/libexec/dovecot/deliver -d %u"
>> ....
>> QuarantineAgent "/usr/libexec/dovecot/deliver -d %u -m SPAM"
>>
>> DeliveryHost.lists.mydom.ain 127.0.0.1
>> DeliveryPort 10026
>> DeliveryIdent localhost
>> DeliveryProto SMTP
>> ...
>> ServerPort              2424
>> ...
>> ServerPID              /var/run/dspam/dspam.pid
>> ServerMode standard
>>
>>
>> at last... my mm_cfg.py:
>>
>> MTA = 'Postfix'
>> DEFAULT_EMAIL_HOST = 'lists.mydom.ain'
>> DEFAULT_URL_HOST = 'mydom.ain'
>> DEFAULT_URL_PATTERN = 'https://ssl.%s/services/mailman/'
>> add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
>> IMAGE_LOGOS = '/services/mailman/mailman-icons/'
>>
>> POSTFIX_STYLE_VIRTUAL_DOMAINS = [DEFAULT_EMAIL_HOST]
>>
>> PUBLIC_ARCHIVE_URL =
>> 'https://ssl.%s/services/mailman/pipermail/%(listname)s'
>>
>> ---
>> There was a tutorial, that includes the virtual-mailman transport table,
>> which
>> maps my subdomain to the local map. That points to the mailman scripts...
>> so
>> this is probably also obsolete now.
>>
> Ohhh boy, oh boy. You mix up things here. In your main.cf you have:
> alias_maps = hash:/var/lib/mailman/data/aliases
>
> Okay. This is telling that Mailman is running as a local domain. But in your 
> mm_cfg.py you tell that Mailman is running in virtual mode:
> add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
> POSTFIX_STYLE_VIRTUAL_DOMAINS = [DEFAULT_EMAIL_HOST]
>
> That is mixed up. Either you use a virtual Mailman setup or you use a local
> Mailman setup. Why mixing the both?
i will try to use a virtual mailman setup now.

>
> You should at least add to main.cf:
> --------------
> ##
> ## Lookup tables that alias specific mail addresses or
> ## domains to other local or remote address
> ##
> virtual_alias_maps =
>       hash:/var/lib/mailman/data/virtual-mailman
>       [....other...lookup...maps....]
> --------------
>
> And allow Mailman to relay:
> --------------
> ##
> ## What destination domains (and subdomains thereof) this
> ## system will relay mail to
> ##
> relay_domains =
>        proxy:mysql:${config_directory}/mailman_domains.cf
>        [....other...lookup...maps....]
> --------------
>
> If you use Postfix.Admin (I think you do, if I have understood your mail 
> correctly) then your mailman_domains.cf should +/- look like this:
> --------------
> ## mailman_domains.cf
> #
> # Description:  GNU mailman domains.
> ##
>
> user            = <your mysql user name>
> password        = <your mysql password>
> dbname          = <your mysql database>
> hosts           = unix:/var/run/mysqld/mysqld.sock
> query           = SELECT domain FROM domain WHERE domain=_latin1'%s' AND
>                   backupmx='0' AND active='1' AND
>                   FIND_IN_SET(SUBSTRING_INDEX(transport,':',1),'mailman')
> --------------
>
> And now you need to tell Postfix.Admin that you have Mailman domains. In 
> Postfix.Admin you need to add any Mailman domain into the domain table of 
> Postfix.Admin and specify the transport to be "mailman" or "mailman:":
> -------
> +----------------------+-----------+--------+
> | domain               | transport | active |
> +----------------------+-----------+--------+
> | lists.dom.ain        | mailman   |      1 |
> | lists.anotherdom.ain | mailman   |      1 |
> | lists.moredom.ain    | mailman   |      1 |
> | lists.etcdom.ain     | mailman   |      1 |
> +----------------------+-----------+--------+
> -------
>
> And you should remove lists.dom.ain from mydestination.
>
> The lookup table here 
> http://www.howtoforge.org/postfix_mysql_dovecot_dspam_clamav_postgrey_rbl_
> debian_etch_p4 
> for /etc/postfix/mysql_virtual_domains_maps.cf is old. You should not try 
> to follow How-To's for Debian if you use Gentoo. Debian has ancient stuff 
> installed and the format used in the How-To is for Postfix < 2.2 and 
> Gentoo (and most other distros) has long, long ago moved to Postfix 2.5.x.

it was a really nice howto, and i haven't found anything like that for
gentoo, so i just adapted it... and combined it with multiple
instances...

So a big thank you for the help so far.

> For a recent Postfix that table would look:
> ----------------
> user = vmail_user
> password = vmail_user_password
> hosts = unix:/var/run/mysqld/mysqld.sock
> query = SELECT domain FROM domain WHERE domain=_latin1'%s' AND backupmx='0' 
> AND active='1'
> ----------------
>
> You could limit the query to just return virtual stuff back by using 
> something like this here:
> ----------------
> SELECT domain FROM domain WHERE domain=_latin1'%s' AND backupmx='0' AND 
> active='1' AND FIND_IN_SET(SUBSTRING_INDEX(transport,':',1),'virtual,mailman
> ,maildrop,dovecot,relay,smtp')
> ----------------

i just updated that...

> If you set up everything to be virtual, then you don't need to fiddle around 
> with delivery in DSPAM. You could leave it as it is and Mailman will pickup 
> the mail before it reaches the normal delivery in Postfix. Doing so you 
> could completely remove the mailman service from master.cf in Postfix as it 
> is not needed any more.
>

... and cleaned my setup up so far... but my resources are very limited.. 
so I will setup a box to handle my mailinglists still virtually but on a
separate box.

One Question... How does postfix know now how to handle mailman
stuff.. i mean, where is the connection between mailman transport and
the mailman scripts?

It once was in the alias maps in the local setup, but where is it now?

Sincerly
Nicolas

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Dspam-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-user

Reply via email to