FAQ
Hillo,

I try to integrate my Postfix with Mailman.
I use tip from FAQ here http://wiki.list.org/x/ZoCj
I have error message
bin/genaliases
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ...
[file ...]
I remove '-r' and try again.
result here
bin/genaliases
sed: 1: "s/(^[^#][^ \t]+[ \t]+). ...": \1 not defined in the RE

I am not expert in sed. Can anyone help me?

PS. Sorry for my English.

Search Discussions

  • Mark Sapiro at Dec 23, 2010 at 6:27 pm

    Konstantin Vasilyev wrote:
    I try to integrate my Postfix with Mailman.
    I use tip from FAQ here http://wiki.list.org/x/ZoCj
    I have error message
    bin/genaliases
    sed: illegal option -- r
    usage: sed script [-Ealn] [-i extension] [file ...]
    sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ...
    [file ...]
    I remove '-r' and try again.
    result here
    bin/genaliases
    sed: 1: "s/(^[^#][^ \t]+[ \t]+). ...": \1 not defined in the RE

    I am not expert in sed. Can anyone help me?

    The -r option is for GNU sed and says use extended regexps. It looks
    like your sed wants -E instead. Try replacing -r with -E.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Konstantin Vasilyev at Dec 27, 2010 at 8:41 am
    Hi Mark

    Thank you for your reply. But error is still here:

    # bin/genaliases
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 14:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 15:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 16:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 17:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 18:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 19:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 20:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 21:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 22:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 23:
    expected format: key whitespace value
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 26:
    expected format: key whitespace value

    --
    With best regards,
    Konstantin Vasilyev





    23.12.2010 21:27, Mark Sapiro ?????:
    Konstantin Vasilyev wrote:
    I try to integrate my Postfix with Mailman.
    I use tip from FAQ here http://wiki.list.org/x/ZoCj
    I have error message
    bin/genaliases
    sed: illegal option -- r
    usage: sed script [-Ealn] [-i extension] [file ...]
    sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ...
    [file ...]
    I remove '-r' and try again.
    result here
    bin/genaliases
    sed: 1: "s/(^[^#][^ \t]+[ \t]+). ...": \1 not defined in the RE

    I am not expert in sed. Can anyone help me?
    The -r option is for GNU sed and says use extended regexps. It looks
    like your sed wants -E instead. Try replacing -r with -E.
  • Mark Sapiro at Dec 27, 2010 at 8:56 pm

    On 12/27/2010 12:41 AM, Konstantin Vasilyev wrote:
    Hi Mark

    Thank you for your reply. But error is still here:

    # bin/genaliases
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 14:
    expected format: key whitespace value

    This is a different error. sed is now running and creating the
    transport-mailman file, but it is not correct so there is something
    wrong with the sed command or the way your sed processes it.

    Post the exact contents of your virtual_to_transport file and at least
    one of the resultant lines in the transport-mailman file.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Konstantin Vasilyev at Dec 28, 2010 at 7:39 am
    Hi
    Here is requested content
    # less virtual_to_transport
    #!/bin/sh
    /usr/bin/sed -E -e 's/(^[^#][^ \t]+[ \t]+).+$/\1local/' $1 >
    /usr/local/mailman/data/transport-mailman
    /usr/local/sbin/postmap /usr/local/mailman/data/transport-mailman

    # less aliases
    # This file is generated by Mailman, and is kept in sync with the
    # binary hash file aliases.db. YOU SHOULD NOT MANUALLY EDIT THIS FILE
    # unless you know what you're doing, and can keep the two files properly
    # in sync. If you screw it up, you're on your own.

    # The ultimate loop stopper address
    mailman-loop: /usr/local/mailman/data/owner-bounces.mbox

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman: "|/usr/local/mailman/mail/mailman post mailman"
    mailman-admin: "|/usr/local/mailman/mail/mailman admin mailman"
    mailman-bounces: "|/usr/local/mailman/mail/mailman bounces mailman"
    mailman-confirm: "|/usr/local/mailman/mail/mailman confirm mailman"
    mailman-join: "|/usr/local/mailman/mail/mailman join mailman"
    mailman-leave: "|/usr/local/mailman/mail/mailman leave mailman"
    mailman-owner: "|/usr/local/mailman/mail/mailman owner mailman"
    mailman-request: "|/usr/local/mailman/mail/mailman request mailman"
    mailman-subscribe: "|/usr/local/mailman/mail/mailman subscribe mailman"
    mailman-unsubscribe: "|/usr/local/mailman/mail/mailman unsubscribe mailman"
    # STANZA END: mailman

    # less virtual-mailman
    # This file is generated by Mailman, and is kept in sync with the binary
    hash
    # file virtual-mailman.db. YOU SHOULD NOT MANUALLY EDIT THIS FILE
    unless you
    # know what you're doing, and can keep the two files properly in sync.
    If you
    # screw it up, you're on your own.
    #
    # Note that you should already have this virtual domain set up properly in
    # your Postfix installation. See README.POSTFIX for details.

    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com mailman-loop
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetrix.com mailman
    mailman-admin at cellnetrix.com mailman-admin
    mailman-bounces at cellnetrix.com mailman-bounces
    mailman-confirm at cellnetrix.com mailman-confirm
    mailman-join at cellnetrix.com mailman-join
    mailman-leave at cellnetrix.com mailman-leave
    mailman-owner at cellnetrix.com mailman-owner
    mailman-request at cellnetrix.com mailman-request
    mailman-subscribe at cellnetrix.com mailman-subscribe
    mailman-unsubscribe at cellnetrix.com mailman-unsubscribe
    # STANZA END: mailman

    # less transport-mailman
    # This file is generated by Mailman, and is kept in sync with the binary
    hash
    # file virtual-mailman.db. YOU SHOULD NOT MANUALLY EDIT THIS FILE
    unless you
    # know what you're doing, and can keep the two files properly in sync.
    If you
    # screw it up, you're on your own.
    #
    # Note that you should already have this virtual domain set up properly in
    # your Postfix installation. See README.POSTFIX for details.

    # LOOP ADDRESSES START
    mailman-loop at cellnetlocal
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetlocal
    mailman-admin at cellnetlocal
    mailman-bounces at cellnetlocal
    mailman-confirm at cellnetlocal
    mailman-join at cellnetlocal
    mailman-leave at cellnetlocal
    mailman-owner at cellnetlocal
    mailman-requestlocal
    mailman-subscribe at cellnetlocal
    mailman-unsubscribe at cellnetlocal
    # STANZA END: mailman



    27.12.2010 23:56, Mark Sapiro ?????:
    On 12/27/2010 12:41 AM, Konstantin Vasilyev wrote:
    Hi Mark

    Thank you for your reply. But error is still here:

    # bin/genaliases
    postmap: warning: /usr/local/mailman/data/transport-mailman, line 14:
    expected format: key whitespace value
    This is a different error. sed is now running and creating the
    transport-mailman file, but it is not correct so there is something
    wrong with the sed command or the way your sed processes it.

    Post the exact contents of your virtual_to_transport file and at least
    one of the resultant lines in the transport-mailman file.
  • Mark Sapiro at Dec 28, 2010 at 8:08 pm

    Konstantin Vasilyev wrote:
    Here is requested content
    # less virtual_to_transport
    #!/bin/sh
    /usr/bin/sed -E -e 's/(^[^#][^ \t]+[ \t]+).+$/\1local/' $1 >
    /usr/local/mailman/data/transport-mailman
    /usr/local/sbin/postmap /usr/local/mailman/data/transport-mailman [...]
    # less virtual-mailman [...]
    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com mailman-loop
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetrix.com mailman
    mailman-admin at cellnetrix.com mailman-admin
    mailman-bounces at cellnetrix.com mailman-bounces
    mailman-confirm at cellnetrix.com mailman-confirm
    mailman-join at cellnetrix.com mailman-join
    mailman-leave at cellnetrix.com mailman-leave
    mailman-owner at cellnetrix.com mailman-owner
    mailman-request at cellnetrix.com mailman-request
    mailman-subscribe at cellnetrix.com mailman-subscribe
    mailman-unsubscribe at cellnetrix.com mailman-unsubscribe
    # STANZA END: mailman

    # less transport-mailman [...]
    # LOOP ADDRESSES START
    mailman-loop at cellnetlocal
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetlocal
    mailman-admin at cellnetlocal
    mailman-bounces at cellnetlocal
    mailman-confirm at cellnetlocal
    mailman-join at cellnetlocal
    mailman-leave at cellnetlocal
    mailman-owner at cellnetlocal
    mailman-requestlocal
    mailman-subscribe at cellnetlocal
    mailman-unsubscribe at cellnetlocal
    # STANZA END: mailman
    It appears that your sed does not recognize the '\t' escape as meaning
    a 'tab' character, but rather recognizes it as a literal 't'. This
    causes that portion of the pattern in parentheses to be treated as
    (^[^#][^ t]+[ t]+) which in turn matches non-comment lines through the
    first string of one or more 't' characters instead of matching through
    the first string of whitespace. Thus you end up with the above instead
    of

    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com local
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetrix.com local
    mailman-admin at cellnetrix.com local
    mailman-bounces at cellnetrix.com local
    mailman-confirm at cellnetrix.com local
    mailman-join at cellnetrix.com local
    mailman-leave at cellnetrix.com local
    mailman-owner at cellnetrix.com local
    mailman-request at cellnetrix.com local
    mailman-subscribe at cellnetrix.com local
    mailman-unsubscribe at cellnetrix.com local
    # STANZA END: mailman

    Fortunately, the whitespace in virtual-mailman is all spaces and no
    tabs so you can change the expression in the sed command to

    -e 's/(^[^#][^ ]+[ ]+).+$/\1local/'

    (i.e., just drop the two '\t's and it should work.

    --
    Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Konstantin Vasilyev at Dec 29, 2010 at 8:52 am
    Hi
    First of all thank you Mark for you attention.
    I edited my sed command and this did the trick.

    # less transport-mailman
    # This file is generated by Mailman, and is kept in sync with the binary
    hash
    # file virtual-mailman.db. YOU SHOULD NOT MANUALLY EDIT THIS FILE
    unless you
    # know what you're doing, and can keep the two files properly in sync.
    If you
    # screw it up, you're on your own.
    #
    # Note that you should already have this virtual domain set up properly in
    # your Postfix installation. See README.POSTFIX for details.

    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com mailman-loop
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Wed Dec 29 10:59:55 2010
    mailman at cellnetrix.com local
    mailman-admin at cellnetrix.com local
    mailman-bounces at cellnetrix.com local
    mailman-confirm at cellnetrix.com local
    mailman-join at cellnetrix.com local
    mailman-leave at cellnetrix.com local
    mailman-owner at cellnetrix.com local
    mailman-request at cellnetrix.com local
    mailman-subscribe at cellnetrix.com local
    mailman-unsubscribe at cellnetrix.com local
    # STANZA END: mailman

    But now I have another error in maillog
    postfix/smtpd[46087]: NOQUEUE: reject: RCPT from
    unknown[192.168.2.199]: 550 5.1.1 <mailman at cellnetrix.com>: Recipient
    address rejected: User unknown in virtual mailbox table;
    from=<admin at cellnetrix.com> to=<mailman at cellnetrix.com> proto=ESMTP
    helo=<[192.168.2.199]>
    Here is my postconf -n

    # postconf -n
    alias_maps = hash:/etc/aliases, hash:/usr/local/mailman/data/aliases
    command_directory = /usr/local/sbin
    config_directory = /usr/local/etc/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/local/libexec/postfix
    debug_peer_level = 2
    html_directory = no
    inet_interfaces = 192.168.2.2, localhost, 192.168.3.2
    local_recipient_maps = $alias_maps
    mail_owner = postfix
    mail_spool_directory = /var/mail
    mailbox_size_limit = 2147483648
    mailq_path = /usr/local/bin/mailq
    manpage_directory = /usr/local/man
    message_size_limit = 20971520
    mydestination = localhost
    myhostname = cellnetrix.com
    mynetworks = 192.168.5.0/24,192.168.2.0/24,192.168.3.0/24
    mynetworks_style = subnet
    newaliases_path = /usr/local/bin/newaliases
    queue_directory = /var/spool/postfix
    recipient_bcc_maps = hash:/usr/local/etc/postfix/recipient_bcc
    sample_directory = /usr/local/etc/postfix
    sender_bcc_maps = hash:/usr/local/etc/postfix/sender_bcc
    sendmail_path = /usr/local/sbin/sendmail
    setgid_group = maildrop
    smtpd_sender_restrictions = permit_mynetworks reject_unknown_sender_domain
    transport_maps = hash:/usr/local/etc/postfix/transport,
    hash:/usr/local/mailman/data/transport-mailman
    unknown_local_recipient_reject_code = 550
    virtual_alias_maps = hash:/usr/local/etc/postfix/virtual
    virtual_gid_maps = static:125
    virtual_mailbox_base = /var/mail/vhosts
    virtual_mailbox_domains = my-sim.ru cellnetrix.com autoreply.cellnetrix.com
    virtual_mailbox_limit = 0
    virtual_mailbox_maps = hash:/usr/local/etc/postfix/vmailbox
    virtual_minimum_uid = 100
    virtual_uid_maps = static:125

    What am I doing wrong?

    --
    With best regards,
    Konstantin Vasilyev





    28.12.2010 23:08, Mark Sapiro ?????:
    Konstantin Vasilyev wrote:
    Here is requested content
    # less virtual_to_transport
    #!/bin/sh
    /usr/bin/sed -E -e 's/(^[^#][^ \t]+[ \t]+).+$/\1local/' $1 >
    /usr/local/mailman/data/transport-mailman
    /usr/local/sbin/postmap /usr/local/mailman/data/transport-mailman [...]
    # less virtual-mailman [...]
    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com mailman-loop
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetrix.com mailman
    mailman-admin at cellnetrix.com mailman-admin
    mailman-bounces at cellnetrix.com mailman-bounces
    mailman-confirm at cellnetrix.com mailman-confirm
    mailman-join at cellnetrix.com mailman-join
    mailman-leave at cellnetrix.com mailman-leave
    mailman-owner at cellnetrix.com mailman-owner
    mailman-request at cellnetrix.com mailman-request
    mailman-subscribe at cellnetrix.com mailman-subscribe
    mailman-unsubscribe at cellnetrix.com mailman-unsubscribe
    # STANZA END: mailman

    # less transport-mailman [...]
    # LOOP ADDRESSES START
    mailman-loop at cellnetlocal
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetlocal
    mailman-admin at cellnetlocal
    mailman-bounces at cellnetlocal
    mailman-confirm at cellnetlocal
    mailman-join at cellnetlocal
    mailman-leave at cellnetlocal
    mailman-owner at cellnetlocal
    mailman-requestlocal
    mailman-subscribe at cellnetlocal
    mailman-unsubscribe at cellnetlocal
    # STANZA END: mailman
    It appears that your sed does not recognize the '\t' escape as meaning
    a 'tab' character, but rather recognizes it as a literal 't'. This
    causes that portion of the pattern in parentheses to be treated as
    (^[^#][^ t]+[ t]+) which in turn matches non-comment lines through the
    first string of one or more 't' characters instead of matching through
    the first string of whitespace. Thus you end up with the above instead
    of

    # LOOP ADDRESSES START
    mailman-loop at cellnetrix.com local
    # LOOP ADDRESSES END

    # STANZA START: mailman
    # CREATED: Mon Dec 27 11:34:25 2010
    mailman at cellnetrix.com local
    mailman-admin at cellnetrix.com local
    mailman-bounces at cellnetrix.com local
    mailman-confirm at cellnetrix.com local
    mailman-join at cellnetrix.com local
    mailman-leave at cellnetrix.com local
    mailman-owner at cellnetrix.com local
    mailman-request at cellnetrix.com local
    mailman-subscribe at cellnetrix.com local
    mailman-unsubscribe at cellnetrix.com local
    # STANZA END: mailman

    Fortunately, the whitespace in virtual-mailman is all spaces and no
    tabs so you can change the expression in the sed command to

    -e 's/(^[^#][^ ]+[ ]+).+$/\1local/'

    (i.e., just drop the two '\t's and it should work.
  • Mark Sapiro at Dec 29, 2010 at 3:57 pm

    Konstantin Vasilyev wrote:
    But now I have another error in maillog
    postfix/smtpd[46087]: NOQUEUE: reject: RCPT from
    unknown[192.168.2.199]: 550 5.1.1 <mailman at cellnetrix.com>: Recipient
    address rejected: User unknown in virtual mailbox table;
    from=<admin at cellnetrix.com> to=<mailman at cellnetrix.com> proto=ESMTP
    helo=<[192.168.2.199]>

    Which says that Postfix is using the virtual transport for this address.

    Here is my postconf -n

    # postconf -n
    alias_maps = hash:/etc/aliases, hash:/usr/local/mailman/data/aliases
    Good.

    [...]
    transport_maps = hash:/usr/local/etc/postfix/transport,
    hash:/usr/local/mailman/data/transport-mailman
    Good. But, did you reload Postfix after adding the above? If so, I
    don't know what the problem might be. But, see below.


    [...]
    What am I doing wrong?

    As I say above, if you reloaded Postfix after adding
    hash:/usr/local/mailman/data/transport-mailman to transport_maps, I
    don't know why this doesn't work, but, based on your Postfix
    configuration, I don't know why you think you need to do this
    transport_maps thing at all.

    I think your Postfix will work if you do the following:

    1) remove the

    POSTFIX_MAP_CMD = '/path/to/data/virtual_to_transport'

    line from mm_cfg.py.

    2) run Mailman's bin/genaliases to create virtual-mailman.db

    3) add "hash:/usr/local/mailman/data/virtual-mailman" to Postfix
    main.cf virtual_alias_maps.

    4) remove "hash:/usr/local/mailman/data/transport-mailman" from Postfix
    main.cf transport_maps.

    5)reload Postfix.

    At this point, Postfix should deliver mail to Mailman. You can then
    remove /usr/local/mailman/data/transport-mailman* as those files are
    no longer used.

    Note, you should also add

    recipient_delimiter = +

    to Postfix main.cf so that Mailman's VERP like addresses will work.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedDec 23, '10 at 2:30p
activeDec 29, '10 at 3:57p
posts8
users2
websitelist.org

People

Translate

site design / logo © 2022 Grokbase