Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th May 2010, 06:23
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Default Postfix forwards in mysql db no longer work

Hello,

I followed this guide: http://www.howtoforge.com/virtual-us...ail-ubuntu8.10

Everything was great for quite some time. Unfortunately some packages were upgraded a month or so ago. We recently found that the forwards in the mysql db were no longer working.

Is there a know thing that changed we can adjust to resolve?
Reply With Quote
Sponsored Links
  #2  
Old 17th May 2010, 10:55
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

You should start with sending an email to a forwarded mail address, and while doing that, tail the log files for any errors.
Reply With Quote
  #3  
Old 17th May 2010, 17:00
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Default

Unfortunately the log didn't reveal too much other than it can't find the user.

May 17 10:57:26 AlbPostfix02 postfix/virtual[11702]: 21068128053: to=<test@ibombhills.com>, relay=virtual, delay=0.04, delays=0.02/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "test@ibombhills.com")
Reply With Quote
  #4  
Old 18th May 2010, 09:13
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

Well, at least you now know that postfix can't find the user .. next step is to check and see, where postfix would get the user data from, and if that user "test" is actually there.

according to the how-to, it should be in the database "mail", table "forwardings".

does postfix throw any error when you start it?
Reply With Quote
  #5  
Old 18th May 2010, 21:03
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Default

No errors when starting Postfix. Restarting has no errors.

Here is what is in the mysql-virtual_forwardings.cf
user = mail_admin
password = SQL4maiL!3412
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1

All the user info is correct. I created a mysql query using the above, replacing the %s with the forward address, and it returns the destination without any issues. It seems the query it sends is not formed properly, or it does not send one.

The normal mailboxes are functioning properly as well.

I am trying to get logging on now to see if it submits the query.
Reply With Quote
  #6  
Old 18th May 2010, 21:35
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Default

Query goes through just as expected.

Running the identical query returns the row properly. So that part is all working, but postfix still says the user does not exist and send the NDR.

I am not sure where the processing goes after this to look next.
Reply With Quote
  #7  
Old 19th May 2010, 09:13
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

On the machine that runs postfix, try this:

Code:
mysql -h 127.0.0.1 -u mail_admin -p mail -e "SELECT destination FROM forwardings WHERE source='test@ibombhills.com'"
enter your password and check if yo get output.

(this way we query the db with the credentials postfix uses, to see if those are correct)
Reply With Quote
  #8  
Old 20th May 2010, 06:16
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Default

Looks good.


root@AlbPostfix02:/home/dat# mysql -h 127.0.0.1 -u mail_admin -p mail -e "SELECT destination FROM forwardings WHERE source='test@ibombhills.com'"
Enter password:
+--------------------------+
| destination |
+--------------------------+
| Bombhills@ibombhills.com |
+--------------------------+
Reply With Quote
  #9  
Old 20th May 2010, 09:04
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

hmm strange, isn't there any other error in the postfix log, just above the

Code:
May 17 10:57:26 AlbPostfix02 postfix/virtual[11702]: 21068128053: to=<test@ibombhills.com>, relay=virtual, delay=0.04, delays=0.02/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "test@ibombhills.com")
Line, maybe some error about not being able to use mysql or smth?
because if this is the only error, postfix can't find the user, but can query the database (although, we ASSUME postfix can talk with mysql, we don't know for sure)
Reply With Quote
  #10  
Old 20th May 2010, 15:51
Moten Moten is offline
Member
 
Join Date: Oct 2008
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
 
Default

Nothing I see, but here is the stuff round it so you can have a look.


Code:
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11699]: connect from quarantine.CompanyX.com[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11699]: 21068128053: client=quarantine.CompanyX.com[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/cleanup[11701]: 21068128053: message-id=<AANLkTimP-Cg2y_OeHXhLEesYIAkozZZPEqKf4dIEEL-i@mail.gmail.com>
May 17 10:57:26 AlbPostfix02 postfix/qmgr[4786]: 21068128053: from=<CompanyXsupport@gmail.com>, size=3555, nrcpt=1 (queue active)
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11699]: disconnect from quarantine.CompanyX.com[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11546]: warning: 192.168.5.67: address not listed for hostname quarantine.CompanyX.com
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11546]: connect from unknown[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/virtual[11702]: 21068128053: to=<test@ibombhills.com>, relay=virtual, delay=0.04, delays=0.02/0/0/0.02, dsn=5.1.1, status=bounced (unknown $
May 17 10:57:26 AlbPostfix02 postfix/cleanup[11548]: 2B48C128085: message-id=<20100517145726.2B48C128085@Albpostfix02.CompanyX.com>
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11546]: 2DE61128088: client=unknown[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/cleanup[11701]: 2DE61128088: message-id=<00c201caf5d1$44378660$cca69320$@net>
May 17 10:57:26 AlbPostfix02 postfix/qmgr[4786]: 2B48C128085: from=<>, size=5439, nrcpt=1 (queue active)
May 17 10:57:26 AlbPostfix02 postfix/bounce[11844]: 21068128053: sender non-delivery notification: 2B48C128085
May 17 10:57:26 AlbPostfix02 postfix/qmgr[4786]: 2DE61128088: from=<phayes@CompanyY.net>, size=183360, nrcpt=1 (queue active)
May 17 10:57:26 AlbPostfix02 postfix/qmgr[4786]: 21068128053: removed
May 17 10:57:26 AlbPostfix02 postfix/smtpd[11546]: disconnect from unknown[192.168.5.67]
May 17 10:57:26 AlbPostfix02 postfix/virtual[11702]: 2DE61128088: to=<nglasser@CompanyY.net>, relay=virtual, delay=0.07, delays=0.04/0/0/0.03, dsn=2.0.0, status=sent (delivered to m$
May 17 10:57:26 AlbPostfix02 postfix/qmgr[4786]: 2DE61128088: removed
May 17 10:57:27 AlbPostfix02 postfix/smtp[11796]: 2B48C128085: to=<CompanyXsupport@gmail.com>, relay=gmail-smtp-in.l.google.com[209.85.221.38]:25, delay=1.6, delays=0.05/0/0.2$
May 17 10:57:27 AlbPostfix02 postfix/qmgr[4786]: 2B48C128085: removed
Let me know if you see anything there.

Postfix can communicate as everything else works. Here are a few of the other configs:

mysql-virtual_mailboxes.cf

user = mail_admin
password = SQL4maiL!3412
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1


mysql-virtual_domains.cf

user = mail_admin
password = SQL4maiL!3412
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1


I thought this went without saying, but I should mention as well that the passwords posted here are in no way real. Apparently someone thinks we would be posting them on the web. Thanks anyway for the warning.

Last edited by Moten; 20th May 2010 at 15:52. Reason: sp
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail server using Postfix, Dovecot, Mysql... Postfix virtual maps doesn't work?? tarasbuljba HOWTO-Related Questions 33 28th May 2010 14:33
Sending emails with custom FROM email address merisor Installation/Configuration 4 8th February 2010 16:27
Help configure Postfix to use alt port 465 or 587 BoloMarkIII Installation/Configuration 10 16th March 2009 17:57
i dont recive any mail of any domain chua_jose Installation/Configuration 18 10th November 2008 18:55
postfix - MySQL connection problem epo Installation/Configuration 7 4th August 2006 20:49


All times are GMT +2. The time now is 22:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.