1

Topic: Mailing list - feature

==== Provide basic information to help troubleshoot ====
- iRedMail version: 1.6
- Linux/BSD distribution name and version: 7.2
- Any related log? Log is helpful for troubleshooting.
====

It is pretty common in many mailing solutions to have sub DLs in a DL. When we try to add a DL under one DL, it doesn't work.

Please check if it is possible to have this feature in admin panel.

Thanks in advance!

Regards,

Pine Mail

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Mailing list - feature

PineMail11 wrote:

It is pretty common in many mailing solutions to have sub DLs in a DL. When we try to add a DL under one DL, it doesn't work.
Please check if it is possible to have this feature in admin panel.

Postfix doesn't support this feature, you cannot add mail list/alias as member of another mail list.

P.S. DL == Distribution List or Mail List?

3

Re: Mailing list - feature

Yes it is for Mailing List.

Is there any workaround to achieve it.

Thanks in advance.

Regards,

Pine Mail Admin

4

Re: Mailing list - feature

No idea yet, sorry.

5 (edited by maxB 2011-10-14 18:28:49)

Re: Mailing list - feature

I would like to point that feature out, too.

I think it's essential to have Aliases as a member of another alias. I ran into a bunch of problems while migrating to a mailserver with iRedAdmin-Pro. And some mails were not delivered and are lost because I realized it too late that the system didn't adopt the members of several aliases (or mailing lists).

That's quite disappointing ...

Edit: postfixadmin - which you're comparing your software to - by the way supports aliases in aliases.

6

Re: Mailing list - feature

maxB wrote:

have Aliases as a member of another alias

It depends on MySQL/LDAP lookups in Postfix, not depend on iRedAdmin-Pro or PostfixAdmin.

Still no plan for this feature, sorry.

7

Re: Mailing list - feature

ZhangHuangbin wrote:
maxB wrote:

have Aliases as a member of another alias

It depends on MySQL/LDAP lookups in Postfix, not depend on iRedAdmin-Pro or PostfixAdmin.

Still no plan for this feature, sorry.

Then I don't get why postfixadmin is able to realize this feature?!

8

Re: Mailing list - feature

maxB wrote:

Then I don't get why postfixadmin is able to realize this feature?!

As i said, it depends on MySQL/LDAP lookups in Postfix.
Would you mind sharing with us the output of command "postconf -n"? And file content of mysql lookup files in Postfix setting "virtual_alias_maps", virtual_mailbox_maps.

9 (edited by maxB 2011-10-17 13:21:06)

Re: Mailing list - feature

Of course!

Here's the content of the command "postconf -n":

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = some.domain.com
myhostname = some.domain.com
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = some.domain.com
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domai                                                   ns $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_doma                                                   ins $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
relayhost =
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted                                                   _recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, re                                                   ject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/ssl/certs/mail_buschhochzwei_de.ca-bundle
smtpd_tls_cert_file = /etc/ssl/certs/mail_buschhochzwei_de.crt
smtpd_tls_key_file = /etc/ssl/private/mail_buschhochzwei_de.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/c                                                   atchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:1000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 1000
virtual_transport = dovecot
virtual_uid_maps = static:1000

/etc/postfix/mysql/virtual_alias_maps.cf:

user        = vmail
password    = SOMEPASSWORD
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.active=1 AND domain.backupmx=0 AND domain.active=1

/etc/postfix/mysql/domain_alias_maps.cf:

user        = vmail
password    = SOMEPASSWORD
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AN
D alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0

/etc/postfix/mysql/catchall_maps.cf:

user        = vmail
password    = SOMEPASSWORD
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,domain WHERE alias.address='%d' AND alias.address=domain.domain AND alias.active=1 AND domain.active=1 AND domain.backupmx=0

/etc/postfix/mysql/domain_alias_catchall_maps.cf:

user        = vmail
password    = SOMEPASSWORD
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=alias_domain.target_domain AND alias_domain.target_domain=domain.domain AND alias.active=1 AN
D alias_domain.active=1

/etc/postfix/mysql/virtual_mailbox_maps.cf:

user        = vmail
password    = SOMEPASSWORD
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT CONCAT(mailbox.storagenode, '/', mailbox.maildir) FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.active=1 AND mailbox.enabledeliver=1 AND domain.domain = mailbox.domain AND doma
in.active=1

It would be very nice if there's any workaround for this problem!

10

Re: Mailing list - feature

Seems you're using standard mysql queries in iRedMail. Then how did you know PostfixAdmin supports this feature (add mail alias as alias member)?

11 (edited by maxB 2011-10-17 13:22:53)

Re: Mailing list - feature

Ah, you wanted the configration of the mailserver with PostfixAdmin. So, here it is:

postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 3d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
delay_warning_time = 4h
disable_vrfy_command = yes
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
maximal_backoff_time = 8000s
maximal_queue_lifetime = 3d
message_size_limit = 200000000
minimal_backoff_time = 1000s
mydestination = some.domain.com, localhost, localhost.localdomain
myhostname = some.domain.com
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_helo_timeout = 60s
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/mysql_virtual_transport_maps.cf
unknown_local_recipient_reject_code = 450
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_domain_catchall_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/mysql/mysql_virtual_alias_domain_mailbox_maps.cf
virtual_uid_maps = static:5000

mysql_virtual_alias_maps.cf:

user = postfix
password = SOMEPASSWORD
hosts = 127.0.0.1
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'

mysql_virtual_alias_maps.cf:

user = postfix
password = SOMEPASSWORD
hosts = 127.0.0.1
dbname = postfix
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.a
ctive = 1 AND alias_domain.active='1'

mysql_virtual_alias_domain_catchall_maps.cf:

user = postfix
password = SOMEPASSWORD
hosts = 127.0.0.1
dbname = postfix
query  = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active
 = 1 AND alias_domain.active='1'

mysql_virtual_mailbox_maps.cf:

user = postfix
password = SOMEPASSWORD
hosts = 127.0.0.1
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'

mysql_virtual_alias_domain_mailbox_maps.cf:

user = postfix
password = SOMEPASSWORD
hosts = 127.0.0.1
dbname = postfix
query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND
 mailbox.active = 1 AND alias_domain.active='1'

These settings are used on a productive server I wanted to migrate from to another server with iRedMail installed. On the old one we're using PostfixAdmin for administrating the e-mail-accounts of our customers.

12

Re: Mailing list - feature

Thanks for your sharing.

Could you please show me output of below commands:

# cd /etc/postfix/mysql/
# for i in $(ls); do echo "${i}"; postmap -q "NORMAL_ALIAS_ACCOUNT" mysql:./${1}; done
# for i in $(ls); do echo "${i}"; postmap -q "ALIAS_ACCOUNT WHICH WAS AN ALIAS MEMBER" mysql:./${i}; done

Also, please:
- show me SQL table structure of below tables: alias, mailbox.
- Show me records of this alias account with MySQL command 'SELECT'.

I found that you have "query = SELECT goto FROM alias,alias_domain WHERE ..." in mysql_virtual_alias_maps.cf, you didn't use "alias.goto"?

13 (edited by maxB 2011-10-17 21:40:45)

Re: Mailing list - feature

Thanks for your reply!

The first loop throws several errors ("postmap: fatal: read ./: Is a directory"). I guess that's because you wrote "./{1}" instead of "./{i}" - so in the following there's the output for booth loops.

# for i in $(ls); do echo "${i}"; postmap -q "NORMAL_ALIAS_ACCOUNT" mysql:./${i}; done
mysql_virtual_alias_domain_catchall_maps.cf
mysql_virtual_alias_domain_mailbox_maps.cf
mysql_virtual_alias_domain_maps.cf
mysql_virtual_alias_maps.cf
mysql_virtual_domains_maps.cf
mysql_virtual_mailbox_limit_maps.cf
mysql_virtual_mailbox_maps.cf
mysql_virtual_transport_maps.cf
# for i in $(ls); do echo "${i}"; postmap -q "ALIAS_ACCOUNT WHICH WAS AN ALIAS MEMBER" mysql:./${i}; done
mysql_virtual_alias_domain_catchall_maps.cf
mysql_virtual_alias_domain_mailbox_maps.cf
mysql_virtual_alias_domain_maps.cf
mysql_virtual_alias_maps.cf
mysql_virtual_domains_maps.cf
mysql_virtual_mailbox_limit_maps.cf
mysql_virtual_mailbox_maps.cf
mysql_virtual_transport_maps.cf

Obviously that's just a list of all configuration files within the directory - because I didn't work with postmap yet I don't know what a logical output would look like.

Here's the structure for table "alias":

 show columns from alias;
+----------+--------------+------+-----+---------------------+-------+
| Field    | Type         | Null | Key | Default             | Extra |
+----------+--------------+------+-----+---------------------+-------+
| address  | varchar(255) | NO   | PRI | NULL                |       |
| goto     | text         | NO   |     | NULL                |       |
| domain   | varchar(255) | NO   | MUL | NULL                |       |
| created  | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active   | tinyint(1)   | NO   |     | 1                   |       |
+----------+--------------+------+-----+---------------------+-------+

And this is the "mailbox" structure:

 show columns from mailbox;
+------------+--------------+------+-----+---------------------+-------+
| Field      | Type         | Null | Key | Default             | Extra |
+------------+--------------+------+-----+---------------------+-------+
| username   | varchar(255) | NO   | PRI | NULL                |       |
| password   | varchar(255) | NO   |     | NULL                |       |
| name       | varchar(255) | NO   |     | NULL                |       |
| maildir    | varchar(255) | NO   |     | NULL                |       |
| quota      | bigint(20)   | NO   |     | 0                   |       |
| local_part | varchar(255) | NO   |     | NULL                |       |
| domain     | varchar(255) | NO   | MUL | NULL                |       |
| created    | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified   | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active     | tinyint(1)   | NO   |     | 1                   |       |
+------------+--------------+------+-----+---------------------+-------+

Here's the output for a SELECT from the "alias" table (please take notice of the comments at the very right of the following output):

+----------------------+------------------------------------------------------------------+--------------+---------------------+---------------------+--------+
| address              | goto                                                             | domain       | created             | modified            | active |
+----------------------+------------------------------------------------------------------+--------------+---------------------+---------------------+--------+
| info@some1.de        | vertrieb@some1.de                                                | some1.de     | 2010-12-14 23:36:33 | 2010-12-16 12:57:37 |      1 | # THIS IS SOME ALIAS FORWARDING MAIL TO THE INITIAL ONE
| info@some2.de        | info@some1.de                                                    | some2.de     | 2010-12-13 15:12:58 | 2010-12-13 15:12:58 |      1 | # THIS AND ALL THE OTHERS FORWARDING TO info@some1.de AND FURTHER TO vertrieb@some1.de 
| service@some2.de     | info@some1.de                                                    | some2.de     | 2010-12-13 15:13:08 | 2010-12-13 15:13:08 |      1 |
| info@some1.eu        | info@some1.de                                                    | some1.eu     | 2010-12-13 17:28:55 | 2010-12-13 17:28:55 |      1 |
| fragen@some1.eu      | info@some1.de                                                    | some1.eu     | 2010-12-13 17:29:02 | 2010-12-13 17:29:02 |      1 |
| service@some1.de     | info@some1.de                                                    | some1.de     | 2010-12-14 23:38:10 | 2010-12-14 23:38:10 |      1 |
| vertrieb@some1.de    | mb1@some1.de,mb2@some1.de,mb3@some1.de,mb4@some1.de              | some1.de     | 2010-12-14 23:42:26 | 2011-03-14 11:38:50 |      1 | # THIS IS THE INITIAL ALIAS WITH FOUR MEMBERS (MAILBOXES)
| fragen@some1.de      | info@some1.de                                                    | some1.de     | 2010-12-14 23:47:43 | 2010-12-14 23:47:43 |      1 |
+----------------------+------------------------------------------------------------------+--------------+---------------------+---------------------+--------+
ZhangHuangbin wrote:

I found that you have "query = SELECT goto FROM alias,alias_domain WHERE ..." in mysql_virtual_alias_maps.cf, you didn't use "alias.goto"?

The query doesn't need to contain the table name, because the column "goto" only exists in the table "alias". I agree with you, that "alias.goto" would be the nice way ...

14

Re: Mailing list - feature

It's surprise to me, i didn't use it this way before.

If this PostfixAdmin style alias works, it should work with iRedMail too, because iRedMail uses same SQL structure and same SQL lookups.

Please try to add alias as alias member with MySQL command line or phpMyAdmin, i will test it later and fix it in iRedAdmin-Pro (MySQL edition).

15 (edited by maxB 2011-10-18 16:13:48)

Re: Mailing list - feature

ZhangHuangbin wrote:

Please try to add alias as alias member with MySQL command line or phpMyAdmin, i will test it later and fix it in iRedAdmin-Pro (MySQL edition).

I tested setting up sub aliases with PhpMyAdmin and it works perfect. I created a new alias maillinglist@domain.com with three mailboxes as members (two on the server and one mailbox at GoogleMail) and created one submailinglist@domain.com - an e-mail to submailinglist@domain.com was send to all the three members - great!

Is there any hotfix that I can implement or will you publish one as soon as possible?