Quantcast
Channel: iRedMail
Viewing all articles
Browse latest Browse all 14118

Problem with setting up email alias with PostgreSQL

$
0
0

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Linux/BSD distribution name and version: Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-43-generic x86_64; Digital Ocean VPS 1 GB memory plan)
- Related log if you're reporting an issue: N/A
====

I have created an account, let's call it user@example.com, that works. Now, I am trying to create an alias for the same domain that goes to an external email account, let's say from alias@example.com to example@gmail.com (the actual destination is a Google Apps group that works, so it is effectively Gmail).

I followed the instructions to add a mail alias account for SQL:

INSERT INTO alias (address, goto, domain, created) VALUES ('alias@example.com', 'example@gmail.com', 'example.com', NOW());

However, when I sent an email to alias@example.com, I did not receive it at example@gmail.com (or rather, the Google Apps account that it should have been forwarded to). I did not receive a notification about a failure to send the email either (the test was done from user@example.com, as well as another Gmail account that successfully sent to user@example.com in an earlier test).

Running this in psql:

SELECT * FROM alias WHERE address='alias@example.com';

gives me:

      address      |        goto       | name | moderators | accesspolicy |   domain    | islist |          created           |      modified       |       expired       | active 
-------------------+-------------------+------+------------+--------------+-------------+--------+----------------------------+---------------------+---------------------+--------
 alias@example.com | example@gmail.com |      |            |              | example.com |      0 | 2015-02-20 13:30:05.663376 | 1970-01-01 00:00:00 | 9999-12-31 00:00:00 |      1

Running this:

postmap -q 'alias@example.com' pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf

gives me:

example@gmail.com

I tried a variant of the workaround used by gigi2683 as described in Email alias in IredMail, i.e., since I could not find receive_override_options in /etc/postfix/main.cf, I edited /etc/postfix/master.cf to change this:

127.0.0.1:10025 inet n  -   -   -   -  smtpd
    -o content_filter=
    -o mynetworks_style=host
    -o mynetworks=127.0.0.0/8
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o strict_rfc821_envelopes=yes
    -o smtp_tls_security_level=none
    -o smtpd_tls_security_level=none
    -o smtpd_restriction_classes=
    -o smtpd_delay_reject=no
    -o smtpd_client_restrictions=permit_mynetworks,reject
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o smtpd_end_of_data_restrictions=
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
    -o smtpd_client_connection_count_limit=0
    -o smtpd_client_connection_rate_limit=0
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings

to:

127.0.0.1:10025 inet n  -   -   -   -  smtpd
    -o content_filter=
    -o mynetworks_style=host
    -o mynetworks=127.0.0.0/8
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o strict_rfc821_envelopes=yes
    -o smtp_tls_security_level=none
    -o smtpd_tls_security_level=none
    -o smtpd_restriction_classes=
    -o smtpd_delay_reject=no
    -o smtpd_client_restrictions=permit_mynetworks,reject
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o smtpd_end_of_data_restrictions=
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
    -o smtpd_client_connection_count_limit=0
    -o smtpd_client_connection_rate_limit=0
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,#no_address_mappings

then restarted postfix, but to no avail.

What should I do to fix this problem? Thanks!

EDIT:
I also tried changing the accesspolicy field in vmail.alias to public, but it made no difference.


Viewing all articles
Browse latest Browse all 14118

Trending Articles