FAQ
Ok, I got sidetracked a long time ago, and because this isn't pressing,
it went to a back-burner, but I'm ready to do this now. My apologies in
advance if I'm being overly cautious, but I've avoided a lot of
problems, some major, by asking a lot of questions before doing
something like this that I've never done before.

Goal is simple: change the URL/hostname for my lists from their current
'myhost.example.com' to 'lists.example.com'.

If it matters, these lists are *not* publicly accessible, and they are
*not* archived.

After re-reading the two FAQs regarding this, I have a few things I'm
not certain of, so will pose the questions one at a time, and will
include my current Defaults.py and my new mm_cfg.py with the new
settings/changes commented at the bottom of each message.

The first question I have is about POSTFIX_STYLE_VIRTUAL_DOMAINS. In the
FAQs about changing hostnames, this setting is not mentioned.

Now, this server only hosts lists for one domain: example.com.

So - should I also change that setting to lists.example.com too (per
below)? Or, since I am not running lists for more than one domain, can
my setup be simplified somehow? Or does it even come into play?

Thanks,

Charles

******************* My current and proposed new settings:

Defaults.py currently contains
DEFAULT_EMAIL_HOST = 'myhost.example.com'
DEFAULT_URL_HOST = 'myhost.example.com'
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
And my current/recently edited mm_cfg.py - the commented settings/lines
below are the changes I've added, in preparation for the change, and
will just comment/uncomment the relevant ones to 'flip the switch':
##################################################
# Put YOUR site-specific settings below this line.
MTA = 'Postfix'
#DEFAULT_EMAIL_HOST = 'example.com'
#DEFAULT_URL_HOST = 'lists.example.com'
#add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
#VIRTUAL_HOSTS.clear()
DEFAULT_URL_PATTERN = 'https://%s/mailman/'
#POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.example.com']
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myhost.example.com']
ALLOW_SITE_ADMIN_COOKIES = Yes

Search Discussions

  • Mark Sapiro at May 2, 2010 at 9:22 pm

    On 5/2/2010 12:41 PM, Tanstaafl wrote:
    The first question I have is about POSTFIX_STYLE_VIRTUAL_DOMAINS. In the
    FAQs about changing hostnames, this setting is not mentioned.

    Now, this server only hosts lists for one domain: example.com.

    So - should I also change that setting to lists.example.com too (per
    below)? Or, since I am not running lists for more than one domain, can
    my setup be simplified somehow? Or does it even come into play?

    Since the email domain for all your lists is (or should be) example.com,
    anything other than example .com in POSTFIX_STYLE_VIRTUAL_DOMAINS has no
    effect. I.e.

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myhost.example.com']

    would only do anything for a list whose host_name (email domain) is
    myhost.example.com, and changing it to

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.example.com']

    would only do anything for a list whose host_name (email domain) is
    lists.example.com.
    Defaults.py currently contains
    DEFAULT_EMAIL_HOST = 'myhost.example.com'
    DEFAULT_URL_HOST = 'myhost.example.com'
    probably wrong.

    DEFAULT_URL_PATTERN = 'http://%s/mailman/'
    And my current/recently edited mm_cfg.py - the commented settings/lines
    below are the changes I've added, in preparation for the change, and
    will just comment/uncomment the relevant ones to 'flip the switch':
    ##################################################
    # Put YOUR site-specific settings below this line.
    MTA = 'Postfix'
    #DEFAULT_EMAIL_HOST = 'example.com'
    #DEFAULT_URL_HOST = 'lists.example.com'
    #add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
    #VIRTUAL_HOSTS.clear()
    The order of the above two is wrong. "VIRTUAL_HOSTS.clear()" clears the
    VIRTOUAL_HOSTS dictionary. You don't want it after your add_virtualhost
    as you will end up with nothing. You first want

    VIRTUAL_HOSTS.clear()

    to remove any incorrect or irrelevant entry from Defaults.py. This is
    followed by

    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    to add the newly defined values.

    DEFAULT_URL_PATTERN = 'https://%s/mailman/'
    #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.example.com']
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myhost.example.com']
    ALLOW_SITE_ADMIN_COOKIES = Yes

    If your list mail goes to ... at example.com and example.com is a local
    domain in Postfix (i.e. in mydestinations), you don't want
    POSTFIX_STYLE_VIRTUAL_DOMAINS at all and you don't want any references
    to Mailman's virtual-mailman in virtual_alias_maps in Postfix.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 2, 2010 at 9:49 pm

    On 2010-05-02 5:22 PM, Mark Sapiro wrote:
    On 5/2/2010 12:41 PM, Tanstaafl wrote:
    The first question I have is about POSTFIX_STYLE_VIRTUAL_DOMAINS. In the
    FAQs about changing hostnames, this setting is not mentioned.

    Now, this server only hosts lists for one domain: example.com.

    So - should I also change that setting to lists.example.com too (per
    below)? Or, since I am not running lists for more than one domain, can
    my setup be simplified somehow? Or does it even come into play?
    Since the email domain for all your lists is (or should be) example.com,
    anything other than example .com in POSTFIX_STYLE_VIRTUAL_DOMAINS has no
    effect. I.e.
    Ok, so, after your previous, I'm confused as to what to do to fix this...
    Defaults.py currently contains
    DEFAULT_EMAIL_HOST = 'myhost.example.com'
    DEFAULT_URL_HOST = 'myhost.example.com'
    probably wrong.
    Yeah, I kind of figured that, so now I just need to know how to fix it
    without breaking anything...
    The order of the above two is wrong. "VIRTUAL_HOSTS.clear()" clears the
    VIRTOUAL_HOSTS dictionary. You don't want it after your add_virtualhost
    as you will end up with nothing. You first want

    VIRTUAL_HOSTS.clear()

    to remove any incorrect or irrelevant entry from Defaults.py. This is
    followed by

    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    to add the newly defined values.
    Thanks, fixed...
    DEFAULT_URL_PATTERN = 'https://%s/mailman/'
    #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.example.com']
    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myhost.example.com']
    ALLOW_SITE_ADMIN_COOKIES = Yes
    If your list mail goes to ... at example.com and example.com is a local
    domain in Postfix (i.e. in mydestinations), you don't want
    POSTFIX_STYLE_VIRTUAL_DOMAINS at all and you don't want any references
    to Mailman's virtual-mailman in virtual_alias_maps in Postfix.
    It's not local, I'm using virtual_mailbox_domains/maps... I do host
    email for two other domains, just no lists (and no need for them)...

    So, now my new mm_cfg.py is:
    ##################################################
    # Put YOUR site-specific settings below this line.
    MTA = 'Postfix'
    #DEFAULT_EMAIL_HOST = 'example.com'
    #DEFAULT_URL_HOST = 'lists.example.com'
    #VIRTUAL_HOSTS.clear()
    #add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
    DEFAULT_URL_PATTERN = 'https://%s/mailman/'
    #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['lists.example.com']
    #POSTFIX_STYLE_VIRTUAL_DOMAINS = ['myhost.example.com']
    ALLOW_SITE_ADMIN_COOKIES = Yes
    ?

    Or, should I make POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.com']

    --

    Charles
  • Mark Sapiro at May 2, 2010 at 11:02 pm

    Tanstaafl wrote:
    On 2010-05-02 5:22 PM, Mark Sapiro wrote:

    If your list mail goes to ... at example.com and example.com is a local
    domain in Postfix (i.e. in mydestinations), you don't want
    POSTFIX_STYLE_VIRTUAL_DOMAINS at all and you don't want any references
    to Mailman's virtual-mailman in virtual_alias_maps in Postfix.
    It's not local, I'm using virtual_mailbox_domains/maps... I do host
    email for two other domains, just no lists (and no need for them)...

    This gets complicated. My question at this point is how is mail to
    listname at example.com getting to Mailman. Any virtual mappings in
    Mailman's virtual-mailman will be for the listname at myhost.example.com,
    etc. addresses, so Postfix can't be relying on that for delivery. So
    if example.com is not a local domain, how is mail to that domain
    getting to Postfix's local delivery in order that Mailman's pipe
    aliases are effective. Are transport maps involved for this domain?

    I probably need to see "postconf -n" and to understand whether there
    are only list addresses @example.com or if there are non-list virtual
    mailbox users @example.com too.

    Also, there are mailman generated addresses such as list-bounces, and
    these are currently all generated @myhost.example.com, so how is that
    mail delivered?

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 3, 2010 at 11:13 am

    On 2010-05-02 7:02 PM, Mark Sapiro wrote:
    Tanstaafl wrote:
    On 2010-05-02 5:22 PM, Mark Sapiro wrote:
    If your list mail goes to ... at example.com and example.com is a local
    domain in Postfix (i.e. in mydestinations), you don't want
    POSTFIX_STYLE_VIRTUAL_DOMAINS at all and you don't want any references
    to Mailman's virtual-mailman in virtual_alias_maps in Postfix.
    It's not local, I'm using virtual_mailbox_domains/maps... I do host
    email for two other domains, just no lists (and no need for them)...
    This gets complicated. My question at this point is how is mail to
    listname at example.com getting to Mailman.
    Hopefully you can help me figure that out... :)
    Any virtual mappings in Mailman's virtual-mailman will be for the
    listname at myhost.example.com,
    Confirmed, /var/lib/mailman/data/virtual-mailman contains blocks like:

    # STANZA START: listname
    # CREATED: Wed Jan 11 18:32:22 2006
    listname at myhost.example.com listname

    Of course, they are complete with all required aliases for each list.
    etc. addresses, so Postfix can't be relying on that for delivery. So
    if example.com is not a local domain, how is mail to that domain
    getting to Postfix's local delivery in order that Mailman's pipe
    aliases are effective.
    As far as I know and understand postfix, I'm using postfix's virtual
    delivery agent currently, although I'll be switching this to dovecot-LDA
    later. Getting the mailman hostname changed is one thing in a long list
    - most of which are done now - of things I had to get done before
    switching to dovecot.
    Are transport maps involved for this domain?
    I do have one, but it is nothing really - it just has the one entry for
    the vacation responder for postfixadmin, and a commented example entry
    for bypassing our primary relayhost for any problematic domains. I had
    to use it once a long time ago for a few domains that were having
    problems accepting data from our primary relayhost (outsourced anti-spam
    service), but they fixed that long ago and I haven't used it since.
    I probably need to see "postconf -n" and to understand whether there
    are only list addresses @example.com or if there are non-list virtual
    mailbox users @example.com too.
    See below...
    Also, there are mailman generated addresses such as list-bounces, and
    these are currently all generated @myhost.example.com, so how is that
    mail delivered?
    Mark, I honestly don't know enough about this stuff to answer that with
    any certainty...

    Hmmm... could it somehow be from my alias_maps?

    /var/lib/mailman/data/aliases contains blocks like the following for
    each list:

    # STANZA START: listname
    # CREATED: Wed Jan 11 18:32:22 2006
    listname: "|/usr/lib64/mailman/mail/mailman post listname"

    Again, of course, each has all of the required aliases.

    myhost ~ # postconf -n
    alias_maps = hash:/etc/mail/aliases, hash:/var/lib/mailman/data/aliases
    anvil_rate_time_unit = 360s
    anvil_status_update_time = 3600s
    bounce_size_limit = 1
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = //usr/lib64/postfix
    data_directory = /var/lib/postfix
    delay_warning_time = 15m
    home_mailbox = .maildir/
    html_directory = /usr/share/doc/postfix-2.6.6/html
    mail_owner = postfix
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    message_size_limit = 51200000
    mydomain = example.com
    myhostname = smtp.example.com
    mynetworks = 127.0.0.0/8 ###.###.###.###
    newaliases_path = /usr/bin/newaliases
    parent_domain_matches_subdomains =
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.6.6/readme
    recipient_delimiter = +
    relay_domains =
    relayhost = [smtp.example2.com]
    sample_directory = /etc/postfix
    sendmail_path = /usr/sbin/sendmail
    setgid_group = postdrop
    smtp_fallback_relay = [smtp.example3.net]
    smtpd_hard_error_limit = 3
    smtpd_recipient_limit = 100
    smtpd_recipient_restrictions = check_recipient_access
    hash:/etc/postfix/moved-employees, permit_mynetworks,
    permit_sasl_authenticated, reject_unauth_destination,
    check_client_access cidr:/etc/postfix/allowed_clients.cidr,
    check_recipient_access hash:/etc/postfix/x-employees,
    check_sender_access hash:/etc/postfix/blocked_senders,
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain = $mydomain
    smtpd_tls_auth_only = yes
    smtpd_tls_cert_file = /etc/ssl/wildcard.crt
    smtpd_tls_key_file = /etc/ssl/wildcard.key
    smtpd_use_tls = yes
    transport_maps = hash:/etc/postfix/transport
    virtual_alias_maps = mysql:/etc/postfix/mysql_vam.cf,
    hash:/var/lib/mailman/data/virtual-mailman
    virtual_gid_maps = static:207
    virtual_mailbox_base = /var/virtual/mail
    virtual_mailbox_domains = mysql:/etc/postfix/mysql_vmd.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql_vmm.cf
    virtual_minimum_uid = 207
    virtual_uid_maps = static:207
    myhost ~ #

    Thanks again Mark...

    --

    Charles
  • Mark Sapiro at May 3, 2010 at 4:32 pm

    Tanstaafl wrote:
    On 2010-05-02 7:02 PM, Mark Sapiro wrote:

    This gets complicated. My question at this point is how is mail to
    listname at example.com getting to Mailman.
    Hopefully you can help me figure that out... :)

    I think I can.

    /var/lib/mailman/data/aliases contains blocks like the following for
    each list:

    # STANZA START: listname
    # CREATED: Wed Jan 11 18:32:22 2006
    listname: "|/usr/lib64/mailman/mail/mailman post listname"

    Again, of course, each has all of the required aliases.

    Right, and those are absolutely required for all deliveries.

    myhost ~ # postconf -n
    alias_maps = hash:/etc/mail/aliases, hash:/var/lib/mailman/data/aliases

    And the above references those Mailman aliases which is good.


    [...]
    mydomain = example.com

    And this says that example.com is the local domain and it is included
    by default in mydestination which means mail to the example.com domain
    is delivered by postfix/local and uses Mailman's aliases.


    [...]
    virtual_alias_maps = mysql:/etc/postfix/mysql_vam.cf,
    hash:/var/lib/mailman/data/virtual-mailman

    And this references Mailman's virtual maps created for the
    myhost.example.com domain. Normally, for delivery of mail addressed
    to, e.g. listname-owner at myhost.example.com via the virtual mapping
    which maps that address to the local address listname-owner, you also
    need

    virtual_alias_domains = myhost.example.com

    If it is working without that, there might be something in the
    mysql:/etc/postfix/mysql_vam.cf that is enabling it, or those
    addresses may not be working, but if they are not, bounce processing
    and some owner notifications may not be working,

    So, How to proceed.

    My understanding is you want the list addresses to be @example.com and
    only the web host to be lists.example.com.

    Given that understanding, what you want to end up with in mm_cfg.py is

    MTA = 'Postfix'
    DEFAULT_EMAIL_HOST = 'example.com'
    DEFAULT_URL_HOST = 'lists.example.com'
    VIRTUAL_HOSTS.clear()
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    with no POSTFIX_STYLE_VIRTUAL_DOMAINS at all, and, you can remove

    hash:/var/lib/mailman/data/virtual-mailman

    from Postfix virtual_alias_maps and remove the
    /var/lib/mailman/data/virtual-mailman* files.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 3, 2010 at 9:05 pm
    I apologize for this taking so long to figure out, Mark... hopefully
    we're almost there...
    On 2010-05-03 12:32 PM, Mark Sapiro wrote:
    Tanstaafl wrote:
    On 2010-05-02 7:02 PM, Mark Sapiro wrote:
    This gets complicated. My question at this point is how is mail to
    listname at example.com getting to Mailman.
    Hopefully you can help me figure that out... :)
    I think I can.
    Somehow I believe you... ;)
    myhost ~ # postconf -n
    <snip>
    [...]
    mydomain = example.com
    And this says that example.com is the local domain
    Hmmm... the postfix docs do not say that this setting equates to a LOCAL
    domain...
    and it is included by default in mydestination
    Not according to the docs:

    http://www.postfix.org/postconf.5.html#mydestination

    mydestination (default: $myhostname, localhost.$mydomain, localhost)

    localhost.$mydomain != $mydomain
    which means mail to the example.com domain is delivered by
    postfix/local and uses Mailman's aliases.
    Hmmm... well, deliveries to normal email addresses @example.com
    definitely have always used postfix/virtual:

    May 3 13:48:25 myhost postfix/smtpd[24359]: connect from
    hostname.inboundrelay.com[###.###.###.###]
    May 3 13:48:25 myhost postfix/smtpd[24359]: EF3DB650B4F:
    client=hostname.inboundrelay.com[###.###.###.###]
    May 3 13:48:26 myhost postfix/cleanup[24236]: EF3DB650B4F:
    message-id=<4BDF0E0A.7010908 at inboundhost.inbounddomain.com>
    May 3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F:
    from=<external_user at smtp.example2.com>, sizeB218, nrcpt=1 (queue active)
    May 3 13:48:26 myhost postfix/virtual[24368]: EF3DB650B4F:
    to=<valid_user at example.com>, relay=virtual, delay=0.68,
    delays=0.67/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
    May 3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F: removed
    May 3 13:48:26 myhost postfix/smtpd[24359]: disconnect from
    hostname.inboundrelay.com[###.###.###.###]

    But, you are right, messages to any of the *list* addresses are
    definitely handled by postfix/local (I just must have never noticed),
    and there is something unexpected (see below log sample)...
    [...]
    virtual_alias_maps = mysql:/etc/postfix/mysql_vam.cf,
    hash:/var/lib/mailman/data/virtual-mailman
    And this references Mailman's virtual maps created for the
    myhost.example.com domain. Normally, for delivery of mail addressed
    to, e.g. listname-owner at myhost.example.com via the virtual mapping
    which maps that address to the local address listname-owner, you also
    need

    virtual_alias_domains = myhost.example.com
    Nope... these return nothing:

    myhost # ~ postmap -q myhost.example.com mysql:/etc/postfix/mysql_vmd.cf
    myhost # ~ postmap -q smtp.example.com mysql:/etc/postfix/mysql_vmd.cf

    This returns 'Primary Domain' (description in postfixadmin db):

    myhost # ~ postmap -q example.com mysql:/etc/postfix/mysql_vmd.cf
    If it is working without that, there might be something in the
    mysql:/etc/postfix/mysql_vam.cf that is enabling it,
    user = myuser
    password = mypassword
    hosts = localhost
    dbname = mydb
    query = SELECT goto FROM alias WHERE address='%s'
    or those addresses may not be working,
    By those addresses, you mean valid_user at example.com? Been working for
    over 4 years like this...
    but if they are not, bounce processing and some owner notifications
    may not be working,
    I do get messages to listname-owner, as well as bounce notifications...

    Something that might help shed some more light though... now that I know
    that list deliveries are handled by postfix/local and regular email
    addresses by postfix/virtual, I looked more closely at the logs...

    Here is a snippet of a list message - note the line where my servers
    name (myhost) is appended:

    13:17:44 myhost postfix/smtpd[24018]: connect from
    my.workstation.example.com[###.###.###.###]
    May 3 13:17:44 myhost postfix/smtpd[24018]: 45FC66B690E:
    client=my.workstation.example.com[###.###.###.###], sasl_method=PLAIN,
    sasl_username=me at example.com
    May 3 13:17:44 myhost postfix/cleanup[24025]: 45FC66B690E:
    message-id=<4BDF0537.6030405 at example.com>
    May 3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E:
    from=<me at example.com>, size�0, nrcpt=1 (queue active)
    May 3 13:17:44 myhost postfix/smtpd[24018]: disconnect from
    my.workstation.example.com[###.###.###.###]
    May 3 13:17:44 myhost imapd-ssl: DISCONNECTED, user=me at example.com,
    ip=[::ffff:###.###.###.###], headers!44, bodyV70, rcvd02,
    sentV680, time08, starttls=1
    May 3 13:17:44 myhost postfix/local[24039]: 45FC66B690E:
    to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
    relay=local, delay=0.64, delays=0.02/0.04/0/0.58, dsn=2.0.0, status=sent
    (delivered to command: /usr/lib64/mailman/mail/mailman post listname)
    May 3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E: removed
    May 3 13:17:46 myhost postfix/smtpd[24020]: connect from
    localhost[127.0.0.1]
    May 3 13:17:46 myhost postfix/smtpd[24020]: 265E36285BC:
    client=localhost[127.0.0.1]
    May 3 13:17:46 myhost postfix/cleanup[24025]: 265E36285BC:
    message-id=<4BDF0537.6030405 at Example.com>

    May 3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC:
    from=<listname-bounces at myhost.example.com>, size34, nrcpt=4 (queue
    active)
    ^^^^^^
    NOTE: ^^^^^^ where did that come from?

    May 3 13:17:46 myhost postfix/smtpd[24020]: disconnect from
    localhost[127.0.0.1]
    May 3 13:17:46 myhost postfix/virtual[24027]: 265E36285BC:
    to=<listmember at example.com>, relay=virtual, delay=0.02,
    delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
    May 3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC: removed
    So, How to proceed.

    My understanding is you want the list addresses to be @example.com and
    only the web host to be lists.example.com.
    Yes... but... I also want example.com to *not* be considered a local
    domain for normal email...
    Given that understanding, what you want to end up with in mm_cfg.py is

    MTA = 'Postfix'
    DEFAULT_EMAIL_HOST = 'example.com'
    DEFAULT_URL_HOST = 'lists.example.com'
    VIRTUAL_HOSTS.clear()
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    with no POSTFIX_STYLE_VIRTUAL_DOMAINS at all, and, you can remove

    hash:/var/lib/mailman/data/virtual-mailman

    from Postfix virtual_alias_maps and remove the
    /var/lib/mailman/data/virtual-mailman* files.
    So:

    1. Stop postfix

    2. Stop mailman

    3. Make the (above) changes to mm_cfg.py

    4. Run $prefix/bin/withlist -l -a -r fix_url to fix all existing lists

    5. Run $prefix/bin/genaliases

    6. Start mailman

    7. Start postfix
    What about web server changes for the lists.example.com vs.
    myhost.example.com change (there may not be any), and DNS for the
    lists.example.com domain?
    I've already got the DNS setup... but this question made me realize,
    there isn't any vhost file set up for mailman access, and its been a
    long time since I originally set this up (with some help from someone
    else who apparently only knew a little more than I did - ;) ...

    The current list management pages are at the address:

    https://myhost.example.com/mailman/...

    I looked at /etc/apache2/modules.d/50_mailman.conf, but it doesn't show
    anything about my hostname, so, what controls the root directory?

    Thanks again Mark, I think (hope) we're almost there... I'm gonna owe
    you a kegger (or more/whatever you prefer) when we're done... :)

    --

    Charles
  • Mark Sapiro at May 3, 2010 at 10:24 pm

    On 5/3/2010 2:05 PM, Tanstaafl wrote:
    On 2010-05-03 12:32 PM, Mark Sapiro wrote:

    [...]
    mydomain = example.com
    And this says that example.com is the local domain
    Hmmm... the postfix docs do not say that this setting equates to a LOCAL
    domain...
    and it is included by default in mydestination
    Not according to the docs:

    You're right. I confused myself because in my Postfix installation,
    mydomain and myhostname have the same value.


    [...]
    Hmmm... well, deliveries to normal email addresses @example.com
    definitely have always used postfix/virtual:

    May 3 13:48:25 myhost postfix/smtpd[24359]: connect from
    hostname.inboundrelay.com[###.###.###.###]
    May 3 13:48:25 myhost postfix/smtpd[24359]: EF3DB650B4F:
    client=hostname.inboundrelay.com[###.###.###.###]
    May 3 13:48:26 myhost postfix/cleanup[24236]: EF3DB650B4F:
    message-id=<4BDF0E0A.7010908 at inboundhost.inbounddomain.com>
    May 3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F:
    from=<external_user at smtp.example2.com>, sizeB218, nrcpt=1 (queue active)
    May 3 13:48:26 myhost postfix/virtual[24368]: EF3DB650B4F:
    to=<valid_user at example.com>, relay=virtual, delay=0.68,
    delays=0.67/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
    May 3 13:48:26 myhost postfix/qmgr[3930]: EF3DB650B4F: removed
    May 3 13:48:26 myhost postfix/smtpd[24359]: disconnect from
    hostname.inboundrelay.com[###.###.###.###]

    OK.

    But, you are right, messages to any of the *list* addresses are
    definitely handled by postfix/local (I just must have never noticed),
    and there is something unexpected (see below log sample)...

    See comments below.

    [...]
    virtual_alias_maps = mysql:/etc/postfix/mysql_vam.cf,
    hash:/var/lib/mailman/data/virtual-mailman
    And this references Mailman's virtual maps created for the
    myhost.example.com domain. Normally, for delivery of mail addressed
    to, e.g. listname-owner at myhost.example.com via the virtual mapping
    which maps that address to the local address listname-owner, you also
    need

    virtual_alias_domains = myhost.example.com
    Nope... these return nothing:

    myhost # ~ postmap -q myhost.example.com mysql:/etc/postfix/mysql_vmd.cf
    myhost # ~ postmap -q smtp.example.com mysql:/etc/postfix/mysql_vmd.cf

    This returns 'Primary Domain' (description in postfixadmin db):

    myhost # ~ postmap -q example.com mysql:/etc/postfix/mysql_vmd.cf

    So it appears that example.com is a virtual_mailbox_domain. So what's in
    virtual_mailbox_maps (mysql:/etc/postfix/mysql_vmm.cf)? Does

    postmap -s mysql:/etc/postfix/mysql_vmm.cf

    work?

    If it is working without that, there might be something in the
    mysql:/etc/postfix/mysql_vam.cf that is enabling it,
    user = myuser
    password = mypassword
    hosts = localhost
    dbname = mydb
    query = SELECT goto FROM alias WHERE address='%s'
    or those addresses may not be working,
    By those addresses, you mean valid_user at example.com? Been working for
    over 4 years like this...

    No. I mean addresses like list-owner at myhost.example.com.

    but if they are not, bounce processing and some owner notifications
    may not be working,
    I do get messages to listname-owner, as well as bounce notifications...

    Something that might help shed some more light though... now that I know
    that list deliveries are handled by postfix/local and regular email
    addresses by postfix/virtual, I looked more closely at the logs...

    Here is a snippet of a list message - note the line where my servers
    name (myhost) is appended:

    13:17:44 myhost postfix/smtpd[24018]: connect from
    my.workstation.example.com[###.###.###.###]
    May 3 13:17:44 myhost postfix/smtpd[24018]: 45FC66B690E:
    client=my.workstation.example.com[###.###.###.###], sasl_method=PLAIN,
    sasl_username=me at example.com
    May 3 13:17:44 myhost postfix/cleanup[24025]: 45FC66B690E:
    message-id=<4BDF0537.6030405 at example.com>
    May 3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E:
    from=<me at example.com>, size�0, nrcpt=1 (queue active)
    May 3 13:17:44 myhost postfix/smtpd[24018]: disconnect from
    my.workstation.example.com[###.###.###.###]
    May 3 13:17:44 myhost imapd-ssl: DISCONNECTED, user=me at example.com,
    ip=[::ffff:###.###.###.###], headers!44, bodyV70, rcvd02,
    sentV680, time08, starttls=1
    May 3 13:17:44 myhost postfix/local[24039]: 45FC66B690E:
    to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
    relay=local, delay=0.64, delays=0.02/0.04/0/0.58, dsn=2.0.0, status=sent
    (delivered to command: /usr/lib64/mailman/mail/mailman post listname)

    Apparently, smtp.example.com is myhostname which is in mydestinations by
    default, but now I am puzzled. What is it in your Postfix that maps
    ListName at Example.com to local 'listname'? There must be something. This
    is the strange part - why is listname at example.com mapped to local
    listname but non-listname-user at example.com is mapped to a virtual
    mailbox maildir?

    May 3 13:17:44 myhost postfix/qmgr[3930]: 45FC66B690E: removed
    May 3 13:17:46 myhost postfix/smtpd[24020]: connect from
    localhost[127.0.0.1]
    May 3 13:17:46 myhost postfix/smtpd[24020]: 265E36285BC:
    client=localhost[127.0.0.1]
    May 3 13:17:46 myhost postfix/cleanup[24025]: 265E36285BC:
    message-id=<4BDF0537.6030405 at Example.com>

    May 3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC:
    from=<listname-bounces at myhost.example.com>, size34, nrcpt=4 (queue
    active)
    ^^^^^^
    NOTE: ^^^^^^ where did that come from?

    That's what I've been saying all along. The list's host_name is
    myhost.example.com, so EVERY mailman generated list related address is
    @myhost.example.com.

    This is part of what is 'wrong' in your current configuration.


    [...]
    My understanding is you want the list addresses to be @example.com and
    only the web host to be lists.example.com.
    Yes... but... I also want example.com to *not* be considered a local
    domain for normal email...

    Apparently, that is what's happening now. The question is why?

    Note: All mail to Mailman is ultimately delivered according to the pipe
    commands in Mailman's aliases file. For this to work, that mail must be
    delivered by Postfix local delivery because local is the only delivery
    that consults alias_maps.

    So you need list addresses to be handled by local and other addresses in
    the example.com domain to be handled by virtual. As I said, that is
    apparently working now. On way to accomplish this is via transport_maps.
    It is possible even to make a script so mailman writes virtual-mailman
    maps which are edited into transport mappings that specify the local
    transport for those addresses. But you said there's nothing in
    transport_maps doing this now.

    Find out how the list at example.com addresses are being mapped to local
    addresses.

    Given that understanding, what you want to end up with in mm_cfg.py is

    MTA = 'Postfix'
    DEFAULT_EMAIL_HOST = 'example.com'
    DEFAULT_URL_HOST = 'lists.example.com'
    VIRTUAL_HOSTS.clear()
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    with no POSTFIX_STYLE_VIRTUAL_DOMAINS at all, and, you can remove

    hash:/var/lib/mailman/data/virtual-mailman

    from Postfix virtual_alias_maps and remove the
    /var/lib/mailman/data/virtual-mailman* files.
    So:

    1. Stop postfix

    2. Stop mailman

    3. Make the (above) changes to mm_cfg.py

    4. Run $prefix/bin/withlist -l -a -r fix_url to fix all existing lists

    5. Run $prefix/bin/genaliases

    6. Start mailman

    7. Start postfix

    First we have to figure out exactly why Postfix is doing the right thing
    with the example.com domain now. Until we know that, we don't know
    whether virtual_alias_maps and POSTFIX_STYLE_VIRTUAL_DOMAINS are important.

    What about web server changes for the lists.example.com vs.
    myhost.example.com change (there may not be any), and DNS for the
    lists.example.com domain?
    I've already got the DNS setup... but this question made me realize,
    there isn't any vhost file set up for mailman access, and its been a
    long time since I originally set this up (with some help from someone
    else who apparently only knew a little more than I did - ;) ...

    The current list management pages are at the address:

    https://myhost.example.com/mailman/...

    I looked at /etc/apache2/modules.d/50_mailman.conf, but it doesn't show
    anything about my hostname, so, what controls the root directory?

    There is a ScriptAlias for mailman. If it is in a global section of
    httpd.conf, it's OK as is. If it is in a VirtualHost block for
    myhost.example.com, it will have to be moved/added to a VirtualHost
    block for lists.example.com. Likewise for any pipermail Alias and any
    Directory blocks relating to Mailman directories.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 4, 2010 at 4:05 pm

    On 2010-05-03 6:24 PM, Mark Sapiro wrote:
    On 5/3/2010 2:05 PM, Tanstaafl wrote:

    On 2010-05-03 12:32 PM, Mark Sapiro wrote:
    You're right. I confused myself because in my Postfix installation,
    mydomain and myhostname have the same value.
    Heh... I'm more than a little confused right now, so no worries.

    But see below - I actually think I've at least answered how/why it is
    working, but I'm not sure what needs to be done to 'fix it' - or even if
    it needs 'fixing'...
    So it appears that example.com is a virtual_mailbox_domain. So what's
    in virtual_mailbox_maps (mysql:/etc/postfix/mysql_vmm.cf)? Does

    postmap -s mysql:/etc/postfix/mysql_vmm.cf

    work?
    No :( is it supposed to?

    # postmap -s mysql:/etc/postfix/mysql_vmm.cf
    postmap: fatal: mysql table /etc/postfix/mysql_vmm.cf: sequence
    operation is not supported

    Now... toward the end of your email, you had essentially summed up the
    issue as:
    Apparently, smtp.example.com is myhostname which is in mydestinations by
    default, but now I am puzzled. What is it in your Postfix that maps
    ListName at Example.com to local 'listname'? There must be something. This
    is the strange part - why is listname at example.com mapped to local
    listname but non-listname-user at example.com is mapped to a virtual
    mailbox maildir?
    So, I started at the beginning and started querying all of my maps, and
    voila:

    # postmap -q listname at example.com mysql:/etc/postfix/mysql_vam.cf
    listname at myhost.example.com

    which then maps to

    # postmap -q listname at myhost.example.com
    hash:/var/lib/mailman/data/virtual-mailman
    listname

    and /var/lib/mailman/data/virtual-mailman is fully populated with these
    STANZA's for all lists:

    # STANZA START: listname
    # CREATED: Wed Jan 11 18:32:22 2006
    listname at myhost.example.com listname
    etc...

    But this kind of seems backwards to me... or at least, more complicated
    than it needs to be. Maybe I initially wanted a virtual setup, but now
    realize I only need lists for the one/main domain? <shrug>

    Anyway, now I guess I just need to know if there's anything broken that
    I really need to fix, or at least if it can be simplified. I'm also
    thinking long term, for when MM3 is released and upgrade time comes.

    Thanks again Mark...
  • Mark Sapiro at May 4, 2010 at 5:25 pm

    Tanstaafl wrote:
    On 2010-05-03 6:24 PM, Mark Sapiro wrote:

    So it appears that example.com is a virtual_mailbox_domain. So what's
    in virtual_mailbox_maps (mysql:/etc/postfix/mysql_vmm.cf)? Does

    postmap -s mysql:/etc/postfix/mysql_vmm.cf

    work?
    No :( is it supposed to?

    # postmap -s mysql:/etc/postfix/mysql_vmm.cf
    postmap: fatal: mysql table /etc/postfix/mysql_vmm.cf: sequence
    operation is not supported

    No, it's not supposed to work, but I didn't know. I don't have any
    mysql tables. The docs say that -s only works with some database
    types, but doesnt say which ones, so I suspected it wouldn't work, but
    didn't know for sure.


    # postmap -q listname at example.com mysql:/etc/postfix/mysql_vam.cf
    listname at myhost.example.com

    which then maps to

    # postmap -q listname at myhost.example.com
    hash:/var/lib/mailman/data/virtual-mailman
    listname

    and /var/lib/mailman/data/virtual-mailman is fully populated with these
    STANZA's for all lists:

    # STANZA START: listname
    # CREATED: Wed Jan 11 18:32:22 2006
    listname at myhost.example.com listname
    etc...

    But this kind of seems backwards to me... or at least, more complicated
    than it needs to be. Maybe I initially wanted a virtual setup, but now
    realize I only need lists for the one/main domain? <shrug>

    Here's how it looks to me. It was initially set up with email domain
    myhost.example.com and that is all fine. It all works as it should.
    You then decided that you wanted to be able to post to
    listname at example.com so you added a virtual_alias_mapping in
    mysql:/etc/postfix/mysql_vam.cf to map listname at example.com to
    listname at myhost.example.com where it would be further mapped to local
    listname via Mailman's hash:/var/lib/mailman/data/virtual-mailman

    The only problem with this is the listname listinfo page, list welcome
    messages, etc all say post to listname at myhost.example.com

    Anyway, now I guess I just need to know if there's anything broken that
    I really need to fix, or at least if it can be simplified. I'm also
    thinking long term, for when MM3 is released and upgrade time comes.

    You can continue to do what you're doing and just change
    myhost at example.com to lists.example.com, but that means you have to
    manually maintain the particular mappings from listname at example.com to
    listname at lists.example.com.

    It would be better to just have the email domain as example.com and have

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.com']

    so mailman creates the virtual-mailman. Then it appears that since
    mapping listname at example.com to listname at myhost.example.com in the
    current mysql:/etc/postfix/mysql_vam.cf works, you could just remove
    those mappings from mysql:/etc/postfix/mysql_vam.cf and let the
    mappings in virtual-mailman do the job.

    However, read the FAQ at <http://wiki.list.org/x/ZoCj> which I just
    wrote yesterday. Now I'm not sure whether that is even necessary.
    Clearly my understanding of Postfix is not complete. In your setup, is
    example.com a virtual_mailbox_domain (listed in
    mysql:/etc/postfix/mysql_vmd.cf)?

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 5, 2010 at 1:52 pm

    On 2010-05-04 1:25 PM, Mark Sapiro wrote:
    Tanstaafl wrote:
    On 2010-05-03 6:24 PM, Mark Sapiro wrote:
    Here's how it looks to me. It was initially set up with email domain
    myhost.example.com and that is all fine. It all works as it should.
    You then decided that you wanted to be able to post to
    listname at example.com so you added a virtual_alias_mapping in
    mysql:/etc/postfix/mysql_vam.cf to map listname at example.com to
    listname at myhost.example.com where it would be further mapped to
    local listname via Mailman's
    hash:/var/lib/mailman/data/virtual-mailman
    Whew... you pretty much nailed it. Its been so long since I set this up
    - and its been working so well - that I had completely forgotten how I
    did this, but I remember now, and you're right, I did manually create
    those aliases. :)
    The only problem with this is the listname listinfo page, list welcome
    messages, etc all say post to listname at myhost.example.com
    No problem, since I'm going to fix this up now, thanks to you... :)
    It would be better to just have the email domain as example.com and
    have

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.com']

    so mailman creates the virtual-mailman. Then it appears that since
    mapping listname at example.com to listname at myhost.example.com in the
    current mysql:/etc/postfix/mysql_vam.cf works, you could just remove
    those mappings from mysql:/etc/postfix/mysql_vam.cf and let the
    mappings in virtual-mailman do the job.

    However, read the FAQ at <http://wiki.list.org/x/ZoCj> which I just
    wrote yesterday. Now I'm not sure whether that is even necessary.
    I read it, and don't think it is... it seems to be just a different way
    to do the same thing, but is much more complicated (and therefore more
    room for breakage)...
    Clearly my understanding of Postfix is not complete. In your setup,
    is example.com a virtual_mailbox_domain (listed in
    mysql:/etc/postfix/mysql_vmd.cf)?
    Yes:

    # postmap -q example.com mysql:/etc/postfix/mysql_vmd.cf
    Example Primary Domain

    Ok, so, now that we know how/why the current setup works, can you
    confirm the steps to fix it properly as:

    1. Stop postfix

    2. Stop mailman

    3. Make these changes to mm_cfg.py:

    MTA = 'Postfix'
    DEFAULT_EMAIL_HOST = 'example.com'
    DEFAULT_URL_HOST = 'lists.example.com'
    POSTFIX_STYLE_VIRTUAL_DOMAINS = 'example.com'
    VIRTUAL_HOSTS.clear()
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    4. Run $prefix/bin/withlist -l -a -r fix_url to fix all existing lists

    5. Run $prefix/bin/genaliases

    6. Delete the listname*@example.com > listname*@myhost.example.com
    alias mappings from the mysql:/etc/postfix/mysql_vam.cf db

    7. Start mailman

    8. Start postfix

    ?

    Many thanks again Mark... this has at least been a learning experience
    for me... :)

    --

    Charles
  • Mark Sapiro at May 5, 2010 at 2:12 pm

    Tanstaafl wrote:
    Ok, so, now that we know how/why the current setup works, can you
    confirm the steps to fix it properly as:

    1. Stop postfix

    2. Stop mailman

    3. Make these changes to mm_cfg.py:

    MTA = 'Postfix'
    DEFAULT_EMAIL_HOST = 'example.com'
    DEFAULT_URL_HOST = 'lists.example.com'
    POSTFIX_STYLE_VIRTUAL_DOMAINS = 'example.com'

    The above needs to be

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.com']

    (it's a list of strings, not a string)

    VIRTUAL_HOSTS.clear()
    add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

    4. Run $prefix/bin/withlist -l -a -r fix_url to fix all existing lists

    5. Run $prefix/bin/genaliases

    6. Delete the listname*@example.com > listname*@myhost.example.com
    alias mappings from the mysql:/etc/postfix/mysql_vam.cf db

    7. Start mailman

    8. Start postfix

    ?

    With the one change above, this seems all good.

    Please let us know how this goes. I will need to revise that FAQ.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 5, 2010 at 2:32 pm

    On 2010-05-05 10:12 AM, Mark Sapiro wrote:
    Tanstaafl wrote:
    POSTFIX_STYLE_VIRTUAL_DOMAINS = 'example.com'
    The above needs to be

    POSTFIX_STYLE_VIRTUAL_DOMAINS = ['example.com'] <snip>
    With the one change above, this seems all good.

    Please let us know how this goes. I will need to revise that FAQ.
    Happy to do so, although I won't do this until tomorrow morning
    (assuming I get in here early enough), as these lists are relatively
    busy during the day.

    Thanks again, Mark!

    --

    Charles
  • Tanstaafl at May 9, 2010 at 9:00 pm

    On 2010-05-05 10:12 AM, Mark Sapiro wrote:
    Please let us know how this goes. I will need to revise that FAQ.
    Ok, apologies for the delay, but I didn't get to this until now...

    It went smooth as silk and everything is running fine, but I have one
    minor question.

    Here's a log entry for a test delivery after the changes:

    1. May 9 16:39:35 myhost postfix/smtpd[21517]: connect from
    my.client.example.com[###.###.###.###]
    2. May 9 16:39:35 myhost postfix/smtpd[21517]: AE6D7621142:
    client=my.client.example.com[###.###.###.###], sasl_method=PLAIN,
    sasl_username=myuser at example.com
    3. May 9 16:39:35 myhost postfix/cleanup[21523]: AE6D7621142:
    message-id=<4BE71D87.6030805 at example.com>
    4. May 9 16:39:35 myhost postfix/qmgr[21380]: AE6D7621142:
    from=<Me at Example.com>, size�2, nrcpt=1 (queue active)
    5. May 9 16:39:35 myhost postfix/local[21525]: AE6D7621142:
    to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
    relay=local, delay=0.24, delays=0.03/0.01/0/0.2, dsn=2.0.0, status=sent
    (delivered to command: /usr/lib64/mailman/mail/mailman post listname)
    6. May 9 16:39:35 moria postfix/qmgr[21380]: AE6D7621142: removed
    7. May 9 16:39:36 moria postfix/smtpd[21517]: disconnect from
    my.client.example.com[###.###.###.###]

    My question is about line #5 above:

    5. May 9 16:39:35 myhost postfix/local[21525]: AE6D7621142:
    to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
    relay=local, delay=0.24, delays=0.03/0.01/0/0.2, dsn=2.0.0, status=sent
    (delivered to command: /usr/lib64/mailman/mail/mailman post listname)

    Why is it listname at smtp.example.com instead of listname at lists.example.com?

    smtp.example.com is the postfix hostname, so I'm sure that's where it's
    coming from, and it isn't a big deal, but for some reason I thought that
    it would use the URL subdomain? No worries if it isn't trivial to change
    this so it uses lists.example.com, but thats what I'd prefer...

    Profuse thanks again to you Mark for being willing to bang this out with me!
  • Mark Sapiro at May 9, 2010 at 9:29 pm

    Tanstaafl wrote:
    It went smooth as silk and everything is running fine, but I have one
    minor question.

    Thanks for the report.

    My question is about line #5 above:

    5. May 9 16:39:35 myhost postfix/local[21525]: AE6D7621142:
    to=<listname at smtp.example.com>, orig_to=<ListName at Example.com>,
    relay=local, delay=0.24, delays=0.03/0.01/0/0.2, dsn=2.0.0, status=sent
    (delivered to command: /usr/lib64/mailman/mail/mailman post listname)

    Why is it listname at smtp.example.com instead of listname at lists.example.com?

    smtp.example.com is the postfix hostname, so I'm sure that's where it's
    coming from, and it isn't a big deal, but for some reason I thought that
    it would use the URL subdomain? No worries if it isn't trivial to change
    this so it uses lists.example.com, but thats what I'd prefer...

    Postfix knows nothing about your Mailman configuration.

    The virtual mapping in data/virtual-mailman has the entry

    listname at example.com listname

    which maps listname at example.com to the local name listname which in
    turn is aliased to "|/usr/lib64/mailman/mail/mailman post listname".

    listname is a local name and Postfix appends the name of the local host
    (myhostname) for the log message.

    I think you could change it by doing both of the following:

    Make sure lists.example.com is in Postfix mydestination so postfix
    thinks it's a local domain.

    Patch Mailman/MTA/Postfix.py so it appends '@lists.example.com' to all
    the virtual mappings so instead of

    listname at example.com listname
    etc.

    in virtual-mailman, you have

    listname at example.com listname at lists.example.com
    etc.

    Note that I have never done exactly this, so I'm not totally certain it
    will do what you want, but I think it will. I also think it probably
    isn't worth maintaining a non-standard patch to do it, but only you
    can answer that for yourself.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 10, 2010 at 10:47 am

    On 2010-05-09 5:29 PM, Mark Sapiro wrote:
    Note that I have never done exactly this, so I'm not totally certain it
    will do what you want, but I think it will. I also think it probably
    isn't worth maintaining a non-standard patch to do it, but only you
    can answer that for yourself.
    I wouldn't mind adding the local domain in postfix, but definitely don't
    want to mess with patching MM myself and maintaining it. It's really
    only a cosmetic problem anyway that most likely no one else will ever
    see (how many people ever look at full headers?)...

    That said, any chance that MM3 can/will provide a way to do this?
    Something like a DEFAULT_LIST_HOST option?
  • Mark Sapiro at May 10, 2010 at 11:20 pm

    Tanstaafl wrote:
    I wouldn't mind adding the local domain in postfix, but definitely don't
    want to mess with patching MM myself and maintaining it. It's really
    only a cosmetic problem anyway that most likely no one else will ever
    see (how many people ever look at full headers?)...

    That said, any chance that MM3 can/will provide a way to do this?
    Something like a DEFAULT_LIST_HOST option?

    It turns out there was a Bug/Patch at
    <https://bugs.launchpad.net/mailman/+bug/328907> which is related to
    this. I've fixed that for MM 2.1.14 with the attached patch which
    allows you to specify VIRTUAL_MAILMAN_LOCAL_HOST in mm_cfg.py, and if
    you do, it will be appended to the local addresses in virtual-mailman.

    As far as MM 3 is concerned, it uses a different delivery method for
    Mailman based on LMTP, so this probably isn't applicable.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan

    -------------- next part --------------
    An embedded and charset-unspecified text was scrubbed...
    Name: patch.txt
    URL: <http://mail.python.org/pipermail/mailman-users/attachments/20100510/7d7f6610/attachment.txt>
  • Tanstaafl at May 11, 2010 at 10:28 am

    On 2010-05-10 7:20 PM, Mark Sapiro wrote:
    It turns out there was a Bug/Patch at
    <https://bugs.launchpad.net/mailman/+bug/328907> which is related to
    this. I've fixed that for MM 2.1.14 with the attached patch which
    allows you to specify VIRTUAL_MAILMAN_LOCAL_HOST in mm_cfg.py, and if
    you do, it will be appended to the local addresses in virtual-mailman.
    Great! Assuming you meant VIRTUAL_MAILMAN_LOCAL_DOMAIN (that's what the
    patch refers to), I have two questions (sorry ;( hopefully these will be
    the last on this topic)...

    In order to accomplish my goal, of lists working as
    listname at example.com, but the local domain in the mail headers showing
    as listname at lists.example.com instead of the postfix host name of
    listname at smtp.example.com,

    1. Would I set

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists'

    or

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists.example.com'

    Maybe the comments in mm_cfg.py for this option should provide an
    example for something other than just plain 'localhost'?

    and

    2. Does this require any mods to postfix/main.cf?

    Thanks again Mark!
  • Mark Sapiro at May 11, 2010 at 2:41 pm

    Tanstaafl wrote:
    On 2010-05-10 7:20 PM, Mark Sapiro wrote:
    It turns out there was a Bug/Patch at
    <https://bugs.launchpad.net/mailman/+bug/328907> which is related to
    this. I've fixed that for MM 2.1.14 with the attached patch which
    allows you to specify VIRTUAL_MAILMAN_LOCAL_HOST in mm_cfg.py, and if
    you do, it will be appended to the local addresses in virtual-mailman.
    Great! Assuming you meant VIRTUAL_MAILMAN_LOCAL_DOMAIN (that's what the
    patch refers to),

    Yes, that's what I meant. Sorry.

    I have two questions (sorry ;( hopefully these will be
    the last on this topic)...

    In order to accomplish my goal, of lists working as
    listname at example.com, but the local domain in the mail headers showing
    as listname at lists.example.com instead of the postfix host name of
    listname at smtp.example.com,

    1. Would I set

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists'

    or

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists.example.com'

    Maybe the comments in mm_cfg.py for this option should provide an
    example for something other than just plain 'localhost'?

    All of these would depend on Postfix. If you set

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists'

    you will get virtual maps like

    listname at example.com listname at lists

    and if you set

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists.example.com'

    you will get virtual maps like

    listname at example.com listname at lists.example.com

    and if you set

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'i_dont_know_what_im_doing'

    you will get virtual maps like

    listname at example.com listname at i_dont_know_what_im_doing

    I would hope that that would be clear from the comment added to
    Defaults.py(.in). I'll add a bit more to try to clarify it.


    and

    2. Does this require any mods to postfix/main.cf?

    Probably. What I think you want is

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists.example.com'

    plus whatever is necessary in Postfix to ensure that Postfix treats
    lists.example.com as a local domain, i.e. it must directly or
    indirectly be in mydestination.

    If you were to put

    VIRTUAL_MAILMAN_LOCAL_DOMAIN = 'lists'

    in mm_cfg.py, I'm gussing that Postfix would append mydomain and try to
    deliver to listname at lists.smtp.example.com in your case which would
    probably fail, unless you also added lists to mydestination in which
    case, Postfix might be able to deliver to listname at lists and would
    identify it as such in logs and Received: headers.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 4, 2010 at 4:09 pm
    Splitting this off since it's a separate issue...
    On 2010-05-03 6:24 PM, Mark Sapiro wrote:
    On 5/3/2010 2:05 PM, Tanstaafl wrote:
    On 2010-05-03 12:32 PM, Mark Sapiro wrote:
    What about web server changes for the lists.example.com vs.
    myhost.example.com change (there may not be any), and DNS for the
    lists.example.com domain?
    I've already got the DNS setup... but this question made me realize,
    there isn't any vhost file set up for mailman access, and its been a
    long time since I originally set this up (with some help from someone
    else who apparently only knew a little more than I did - ;) ...

    The current list management pages are at the address:

    https://myhost.example.com/mailman/...

    I looked at /etc/apache2/modules.d/50_mailman.conf, but it doesn't show
    anything about my hostname, so, what controls the root directory?
    There is a ScriptAlias for mailman. If it is in a global section of
    httpd.conf, it's OK as is.
    It isn't... :(
    If it is in a VirtualHost block for myhost.example.com, it will have
    to be moved/added to a VirtualHost block for lists.example.com.
    It isn't... :(

    I've also traced every virtual host file, starting with httpd.conf, and
    everything in /etc/apache2/vhosts.d/, and I don't see anything providing
    a virtual host block for mailman.
    Likewise for any pipermail Alias and any Directory blocks relating
    to Mailman directories.
    Where would I find these?

    <sigh>
  • Mark Sapiro at May 4, 2010 at 5:44 pm

    Tanstaafl wrote:
    On 2010-05-03 6:24 PM, Mark Sapiro wrote:
    On 5/3/2010 2:05 PM, Tanstaafl wrote:

    I looked at /etc/apache2/modules.d/50_mailman.conf, but it doesn't show
    anything about my hostname, so, what controls the root directory?
    There is a ScriptAlias for mailman. If it is in a global section of
    httpd.conf, it's OK as is.
    It isn't... :(

    Isn't there something like

    ScriptAlias /mailman/ "/path/to/mailman/cgi-bin/"

    and

    Alias /pipermail/ "/path/to/mailman/archives/public/"

    in something like /etc/apache2/conf.d/50_mailman.conf?

    That should be all you need.


    [...]
    I've also traced every virtual host file, starting with httpd.conf, and
    everything in /etc/apache2/vhosts.d/, and I don't see anything providing
    a virtual host block for mailman.

    Typical Apache configuration directives for Mailman include the above
    ScriptAlias and Alias directives plus something like

    <Directory "/path/to/mailman/archives/public">
    Options +FollowSymLinks
    Order allow,deny
    Allow from all
    </Directory>

    In your case, I would expect to find this in
    /etc/apache2/conf.d/50_mailman.conf

    Since that file would be included globally and not within a VirtualHost
    block for a specific host like myhost.example.com, everything should
    be OK as is.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Tanstaafl at May 5, 2010 at 11:20 am

    On 2010-05-04 1:44 PM, Mark Sapiro wrote:
    Isn't there something like

    ScriptAlias /mailman/ "/path/to/mailman/cgi-bin/"

    and

    Alias /pipermail/ "/path/to/mailman/archives/public/"

    in something like /etc/apache2/conf.d/50_mailman.conf?

    That should be all you need.
    Ah, right, I forgot about that one... yep, everything looks right so
    that answers that...

    Thanks again for all of your help Mark.

    --

    Charles
  • Tanstaafl at May 3, 2010 at 9:23 pm

    On 2010-05-03 5:05 PM, mailman-users-request at python.org wrote:
    May 3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC:
    from=<listname-bounces at myhost.example.com>, size34, nrcpt=4 (queue
    active)
    ^^^^^^
    NOTE: ^^^^^^ where did that come from?
    Sorry, that wrapped weird...

    May 3 13:17:46 myhost postfix/qmgr[3930]: 265E36285BC:
    from=<listname-bounces at myhost.example.com>, size34,
    ^^^^^^
    NOTE: ^^^^^^ where did that come from?

    --

    Charles

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedMay 2, '10 at 7:41p
activeMay 11, '10 at 2:41p
posts23
users2
websitelist.org

2 users in discussion

Tanstaafl: 13 posts Mark Sapiro: 10 posts

People

Translate

site design / logo © 2022 Grokbase