Virtual alias maps question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Virtual alias maps question

Fazzina, Angelo

Hi,

 

I added a test domain for my email address only.

 

[root@mta4 postfix]# postmap -q "[hidden email]" /etc/postfix/virtual

[hidden email]

 

[root@mta4 postfix]# more main.cf|grep virtual_alias_maps

#virtual_alias_maps = mysql:/etc/postfix/files/mysql_pn.cf

virtual_alias_maps = hash:/etc/postfix/virtual mysql:/etc/postfix/files/mysql_pn.cf  regexp:/etc/postfix/maps/huskygroups regexp:/etc/postfix/maps/subaddressing

 

 

From reading the docs, addresses are evaluated in the order listed, so for me it’s Virtual, and then mysql_pn.cf.

I am and have always been in the mysql lookup. I was hoping all email sent to   [hidden email] could be redirected to [hidden email].

 

AFA the DNS side of the house I added an MX record of test.uconn.edu pointing to mta4.uits.uconn.edu

And an A record of test.uconn.edu pointing to 137.99.25.243. Not sure if that was needed at this point.

 

My Question:

I test by sending an email to  [hidden email] from T-bird with IMAP account setup on it.

The email arrives just fine, but can’t tell from the logs if it was redirecting the email to  [hidden email] or not ???!

Seems like the /etc/postfix/virtual file is not being used ? why not ?

 

Postfix logs:

 

Oct 24 14:18:54 mta4 postfix/smtpd[5440]: connect from angelo.uits.uconn.edu[137.99.80.129]

Oct 24 14:18:54 mta4 postfix/smtpd[5440]: 60C55AF: client=angelo.uits.uconn.edu[137.99.80.129], sasl_method=PLAIN, sasl_username=alf02013

Oct 24 14:18:54 mta4 postfix/cleanup[5446]: 60C55AF: warning: header Subject: map test from angelo.uits.uconn.edu[137.99.80.129]; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<[137.99.80.129]>

Oct 24 14:18:54 mta4 postfix/cleanup[5446]: 60C55AF: message-id=<[hidden email]>

Oct 24 14:18:54 mta4 opendkim[24106]: 60C55AF: DKIM-Signature field added (s=dkim1, d=mta4.uits.uconn.edu)

Oct 24 14:18:54 mta4 postfix/qmgr[19716]: 60C55AF: from=<[hidden email]>, size=688, nrcpt=1 (queue active)

Oct 24 14:18:54 mta4 postfix/smtpd[5440]: disconnect from angelo.uits.uconn.edu[137.99.80.129]

Oct 24 14:18:56 mta4 postfix/smtp[5448]: 60C55AF: to=<[hidden email]>, orig_to=<[hidden email]>, relay=uconn-mail-onmicrosoft-com.mail.protection.outlook.com[216.32.181.170]:25, delay=2.6, delays=0.17/0.01/0.27/2.1, dsn=2.6.0, status=sent (250 2.6.0 <[hidden email]> [InternalId=150079042227926, Hostname=CO1PR05MB267.namprd05.prod.outlook.com] 8990 bytes in 0.975, 8.996 KB/sec Queued mail for delivery)

Oct 24 14:18:56 mta4 postfix/qmgr[19716]: 60C55AF: removed

 

 

-ANGELO FAZZINA

 

UITS Service Manager:

Spam and Virus Prevention

Mass Mailing

G Suite/Gmail

 

[hidden email]

University of Connecticut,  UITS, SSG, Server Systems

860-486-9075

 

Reply | Threaded
Open this post in threaded view
|

RE: Virtual alias maps question

Vernon Fort

This line:

>> Oct 24 14:18:56 mta4 postfix/smtp[5448]: 60C55AF: to=<[hidden email]>, orig_to=<[hidden email]>, relay=uconn-mail-onmicrosoft-com.mail.protection.outlook.com[216.32.181.170]:25, delay=2.6, delays=0.17/0.01/0.27/2.1, dsn=2.6.0, status=sent (250 2.6.0 <[hidden email]> [InternalId=150079042227926, Hostname=CO1PR05MB267.namprd05.prod.outlook.com] 8990 bytes in 0.975, 8.996

 

The “orig_to” indicated the original to address.  The “to” indicated the new address.

 

Vernon

 

Reply | Threaded
Open this post in threaded view
|

RE: Virtual alias maps question

Fazzina, Angelo

Hi Vernon,  exactly what I am pointing out.

Why is it choosing to lookup my destination address via the mysql mapping and not use the Virtual file mapping ?

 

And I did remember to run

                Postmap /etc/postfix/virtual

 

-rw-r--r--. 1 root root 12638 Oct 24 13:37 virtual

-rw-r--r--. 1 root root 12288 Oct 24 13:37 virtual.db

 

Virtual is listed first is it not ?

 

 

virtual_alias_maps = hash:/etc/postfix/virtual mysql:/etc/postfix/files/mysql_pn.cf  regexp:/etc/postfix/maps/huskygroups regexp:/etc/postfix/maps/subaddressing

 

 

Thank you.

 

-ANGELO FAZZINA

 

UITS Service Manager:

Spam and Virus Prevention

Mass Mailing

G Suite/Gmail

 

[hidden email]

University of Connecticut,  UITS, SSG, Server Systems

860-486-9075

 

From: Vernon Fort [mailto:[hidden email]]
Sent: Tuesday, October 24, 2017 2:34 PM
To: Fazzina, Angelo <[hidden email]>; [hidden email]
Subject: RE: Virtual alias maps question

 

This line:

>> Oct 24 14:18:56 mta4 postfix/smtp[5448]: 60C55AF: to=<[hidden email]>, orig_to=<[hidden email]>, relay=uconn-mail-onmicrosoft-com.mail.protection.outlook.com[216.32.181.170]:25, delay=2.6, delays=0.17/0.01/0.27/2.1, dsn=2.6.0, status=sent (250 2.6.0 <[hidden email]> [InternalId=150079042227926, Hostname=CO1PR05MB267.namprd05.prod.outlook.com] 8990 bytes in 0.975, 8.996

 

The “orig_to” indicated the original to address.  The “to” indicated the new address.

 

Vernon

 

Reply | Threaded
Open this post in threaded view
|

RE: Virtual alias maps question

Vernon Fort
Reply | Threaded
Open this post in threaded view
|

Re: Virtual alias maps question

Wietse Venema
Keep in mind that virtual aliasing is recursive. The result of lookup
is used as input for another querry. The recursion ends when:

- The result contains the query itself.

- The query produces no result.

Thus, you may want to specify:

/etc/postfix/virtual:
    [hidden email]        [hidden email]
    [hidden email]   [hidden email]

        Wietse
Reply | Threaded
Open this post in threaded view
|

RE: Virtual alias maps question

Fazzina, Angelo
Hi again,
Thanks, that was helpful, and got me on the right track.
I am pretty confident it's working now.   "test.uconn.edu" is not in the virtual_alias_domains list BTW.


/etc/postfix/virtual =
[hidden email]  [hidden email]
[hidden email] [hidden email]

/etc/postfix/relay_recipients =
[hidden email] OK


/etc/main.cf =
relay_domains = test.uconn.edu $mydestination

relay_recipient_maps = hash:/etc/postfix/relay_recipients

virtual_alias_maps = hash:/etc/postfix/virtual mysql:/etc/postfix/files/mysql_pn.cf  regexp:/etc/postfix/maps/huskygroups regexp:/etc/postfix/maps/subaddressing


From these logs I think the only way it could have did the mapping is seeing  [hidden email] goes to [hidden email] which goes to my alf02013 account. So I think the virtual file is being read correctly now. Yippee !

                Not to mention I double checked there is nothing in the Mysql DB that matches  ang*@test.*


Oct 24 16:08:10 mta4 postfix/smtpd[13690]: connect from angelo.uits.uconn.edu[137.99.80.129]
Oct 24 16:08:10 mta4 postfix/smtpd[13690]: 38DAFAF: client=angelo.uits.uconn.edu[137.99.80.129], sasl_method=PLAIN, sasl_username=alf02013
Oct 24 16:08:10 mta4 postfix/cleanup[13696]: 38DAFAF: warning: header Subject: newest from angelo.uits.uconn.edu[137.99.80.129]; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<[137.99.80.129]>
Oct 24 16:08:10 mta4 postfix/cleanup[13696]: 38DAFAF: message-id=<[hidden email]>
Oct 24 16:08:10 mta4 opendkim[24106]: 38DAFAF: DKIM-Signature field added (s=dkim1, d=mta4.uits.uconn.edu)
Oct 24 16:08:10 mta4 postfix/qmgr[13580]: 38DAFAF: from=<[hidden email]>, size=670, nrcpt=1 (queue active)
Oct 24 16:08:10 mta4 postfix/smtpd[13690]: disconnect from angelo.uits.uconn.edu[137.99.80.129]
Oct 24 16:08:11 mta4 postfix/smtp[13698]: 38DAFAF: to=<[hidden email]>, orig_to=<[hidden email]>, relay=uconn-mail-onmicrosoft-com.mail.protection.outlook.com[216.32.181.170]:25, delay=1.4, delays=0.1/0.01/0.25/1, dsn=2.6.0, status=sent (250 2.6.0 <[hidden email]> [InternalId=154245160503103, Hostname=BN1PR05MB262.namprd05.prod.outlook.com] 8911 bytes in 0.257, 33.757 KB/sec Queued mail for delivery)
Oct 24 16:08:11 mta4 postfix/qmgr[13580]: 38DAFAF: removed




-ANGELO FAZZINA

UITS Service Manager:
Spam and Virus Prevention
Mass Mailing
G Suite/Gmail

[hidden email]
University of Connecticut,  UITS, SSG, Server Systems
860-486-9075

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Wietse Venema
Sent: Tuesday, October 24, 2017 3:41 PM
To: Postfix users <[hidden email]>
Subject: Re: Virtual alias maps question

Keep in mind that virtual aliasing is recursive. The result of lookup
is used as input for another querry. The recursion ends when:

- The result contains the query itself.

- The query produces no result.

Thus, you may want to specify:

/etc/postfix/virtual:
    [hidden email]        [hidden email]
    [hidden email]   [hidden email]

        Wietse