Virtual Users And Domains With Postfix, Courier And MySQL

Discussion in 'HOWTO-Related Questions' started by wmrwl, Sep 18, 2006.

  1. wmrwl

    wmrwl Member

    All of the mysql_virtual-*.cf files have 10.0.03 as the host.

    mail.err is completely empty

    I will post syslog and mail.info
    ________
    Cumshot Vids
    ________
    Breakup advice forum
     
    Last edited: Apr 22, 2011
  2. grasomega

    grasomega Member

    As far as see, this line should give us some clue:

    Sep 22 15:08:35 myboxname postfix/smtp[2572]: connect to 127.0.0.1[127.0.0.1]: Connection refused (port 10024)

    Is your amavisd working? If yes, please check that the password for the database is correct.
    If everything checks, set in main.cf
    content_filter =
    It should disable amavis for postfix for the moment and see if it works.

    grasomega
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Why don't you simply use the same settings as in the tutorial (e.g. 127.0.0.1 instead of 10.0.0.3)?
     
  4. grasomega

    grasomega Member

    I think I got it:

    In /etc/my.cnf put a # in front of the 'bind_address' line, so that the server would connect to all interfaces.
    Then, follow the tutorial bit by bit.

    Falko: he needs to acces the mysql server not only from localhost.

    grasomega
     
  5. wmrwl

    wmrwl Member

    If I comment out the bind_address line, will I still be able to connect to this machine from other machines on the network?
    ________
    Vaporizer
    ________
    CHEAP REPLICA DOUBLE EAGLE AUTOMATIC ELECTRIC
     
    Last edited: Apr 22, 2011
  6. grasomega

    grasomega Member

    As far as I know, if you don't specify anything, it will connect on any available interface, including 127.0.0.1 and the network card.
    If you have more than one network card and want to use only one to allow access to the database, use iptables to limit the access.

    grasomega
     
  7. wmrwl

    wmrwl Member

    I have commented it out and tested my connections with the other machines and it seems that they are still able to properly connect. I am now going to go back through the HOWTO and change everything to 127.0.0.1, but I noticed the following in the HOWTO:

    Now we have to tell Postfix where it can find all the information in the database. Therefore we have to create six text files. You will notice that I tell Postfix to connect to MySQL on the IP address 127.0.0.1 instead of localhost. This is because Postfix is running in a chroot jail and does not have access to the MySQL socket which it would try to connect if I told Postfix to use localhost. If I use 127.0.0.1 Postfix uses TCP networking to connect to MySQL which is no problem even in a chroot jail (the alternative would be to move the MySQL socket into the chroot jail which causes some other problems).

    If I am reading this correctly, it means that if this line is commented out, then postfix can't connect. Is that right?
     
  8. wmrwl

    wmrwl Member

    I think you're right - i think it might have something to do the amavis. I commented out the line in main.cf and tried to send another test email. I got this in my mail.log:

    Code:
    Sep 23 17:14:56 back1 postfix/smtp[2404]: EC3C8234290: to=<admin@[I]domain[/I].com>, relay=none, delay=1430, status=deferred (connect to 127.0.0.1[127.0.0.1]: Connection refused)
    Sep 23 17:15:47 back1 postfix/smtpd[2406]: connect from bay0-omc1-s30.bay0.hotmail.com[65.54.246.102]
    Sep 23 17:15:47 back1 postfix/smtpd[2406]: E0D74234293: client=bay0-omc1-s30.bay0.hotmail.com[65.54.246.102]
    Sep 23 17:15:48 back1 postfix/cleanup[2413]: E0D74234293: message-id=<[email protected]>
    Sep 23 17:15:48 back1 postfix/qmgr[2403]: E0D74234293: from=<[I]myemail[/I]@hotmail.com>, size=1305, nrcpt=1 (queue active)
    Sep 23 17:15:48 back1 postfix/smtpd[2406]: disconnect from bay0-omc1-s30.bay0.hotmail.com[65.54.246.102]
    Sep 23 17:15:48 back1 postfix/virtual[2414]: fatal: gethostbyname: Success
    Sep 23 17:15:49 back1 postfix/qmgr[2403]: warning: premature end-of-input on private/virtual socket while reading input attribute name
    Sep 23 17:15:49 back1 postfix/qmgr[2403]: warning: private/virtual socket: malformed response
    Sep 23 17:15:49 back1 postfix/qmgr[2403]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
    Sep 23 17:15:49 back1 postfix/master[2398]: warning: process /usr/lib/postfix/virtual pid 2414 exit status 1
    Sep 23 17:15:49 back1 postfix/master[2398]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling
    
     
  9. wmrwl

    wmrwl Member

    OK so I changed everything from 10.0.0.3 to 127.0.0.1 (following the HOWTO) and I am still getting the same error above in mail.log.

    I also uncommented bind_address in /etc/mysql/my.cnf and put 127.0.0.1 (which broke the connections from the other machines on the network, but I wanted to try it to rule that out).

    I am now getting these messages in mail.err:
    Code:
    Sep 23 17:15:48 back1 postfix/virtual[2414]: fatal: gethostbyname: Success
    Sep 23 17:48:16 back1 postfix/virtual[2455]: fatal: gethostbyname: Success
    Sep 23 18:21:36 back1 postfix/virtual[2478]: fatal: gethostbyname: Success
    Sep 23 19:28:16 back1 postfix/virtual[2513]: fatal: gethostbyname: Success
    Sep 23 19:40:19 back1 postfix/virtual[2672]: fatal: gethostbyname: Success
    Sep 23 19:42:38 back1 postfix/virtual[2792]: fatal: gethostbyname: Success
    
     
  10. grasomega

    grasomega Member

    No, it means that because it works chrooted, postfix would not be aware of the mysql socket, if the addressing would be to localhost. Using TCP/IP networking, it can reach it and 127.0.0.1 is the address.

    Don't bother, just don't put localhost where it says 127.0.0.1 in the tutorial :)

    grasomega

    edit:

    The errors you are getting now seem related exactly to the above issue.
     
    Last edited: Sep 24, 2006
  11. wmrwl

    wmrwl Member

    But I am still getting these errors even when I have bind_address = 127.0.0.1.

    I uncommented bind_address in /etc/mysql/my.cnf and put 127.0.0.1 (which broke the connections from the other machines on the network) and it still gives me the last errors I posted. I have 127.0.0.1 everywhere, as suggested in the tutorial.

    In main.cf I have content_filter = (to disable amavis from filtering mail.
    In /etc/mysql/my.cnf I have bind_address = 127.0.0.1
    I have 127.0.0.1 everywhere as suggested in the tutorial and my mail.err and mail.log are the same as I last posted.
    ________
    FAKE WEED
     
    Last edited: Mar 30, 2011
  12. grasomega

    grasomega Member

  13. wmrwl

    wmrwl Member

    I think I found the problem.

    The command "hostname -f" returns:
    hostname: Unknown Host

    How do i fix this? I am assuming it should return my FQDN - right?

    Thanks!
    ________
    Ship Sale
    ________
    Ass live
     
    Last edited: Apr 22, 2011
  14. grasomega

    grasomega Member

  15. wmrwl

    wmrwl Member

    OK it looks like the hostname solved that particular issue. Thanks! We're getting a lot closer here.

    Now mail.err is empty and mail.log says:
    Code:
    Sep 27 03:42:19 mail postfix/smtpd[2274]: connect from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    Sep 27 03:42:20 mail postfix/smtpd[2274]: warning: h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]: SASL LOGIN authentication failed
    Sep 27 03:42:20 mail postfix/smtpd[2274]: lost connection after AUTH from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    Sep 27 03:42:20 mail postfix/smtpd[2274]: disconnect from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    
    I checked the sasl configs and they looked ok to me, judging from the HOWTO.
     
  16. tommytomato

    tommytomato New Member

    I read this whole post and followed all the steps

    If I change anything at after following the tutorial the system stops sending and reciving mail.

    Only thing I see that is different to other's is my hostname which is ( rockinghamgateway.com ) instead of ( mail.rockinghamgateway.com )
    would that make a difference :confused:

    I've added my user to the mysql database called ( mail ) and I'm using the email address of the user as login and my password when trying to conntect to the email server from XP-Outlook Express or Mozilla from FC5

    I get this error
    [​IMG]

    I've added the ports 25 and 110 to my router and made it point to the IP of the email server.

    my last two logs from /var/log/mail.warn
    Code:
    Sep 28 19:07:30 localhost postfix/trivial-rewrite[2606]: warning: do not list domain rockinghamgateway.com in BOTH mydestination and virtual_mailbox_domains
    Sep 28 19:13:28 localhost postfix/trivial-rewrite[2628]: warning: do not list domain rockinghamgateway.com in BOTH mydestination and virtual_mailbox_domains
    So I changed that and the system stops sending and reciving email

    my /var/mail/mail.err

    Code:
    Sep 28 18:51:06 localhost dccproc[2572]: socket(UDP): Address family not supported by protocol
    Sep 28 19:07:29 localhost dccproc[2602]: socket(UDP): Address family not supported by protocol
    
    apart from that I dont know what else to say but can any one help please.



    TT
     
    Last edited: Sep 28, 2006
  17. wmrwl

    wmrwl Member

    TT,

    I dont see how this relates to my topic. I am running Debian and you are running FC5 and your errors are unrelated to mine. You might want to start a new thread and post your main.cf and your master.cf
    This wont make a difference - just be sure to use the proper hostname in OE. Just use rockinghamgateway.com instead of mail.rockinghamgateway.com.

    Does anyone have any idea about my new SASL auth problem?
     
    Last edited: Sep 28, 2006
  18. tommytomato

    tommytomato New Member

    No :) I'm running Debian as my email server, I have a DUEL BOOT system that has XP and FC5

    TT
     
  19. wmrwl

    wmrwl Member

    OK so I did some more investigating and decided to add log_level: 7 to /etc/postfix/sasl/smtpd.conf which gave me a little more detail in mail.log:

    Code:
    Sep 28 01:50:34 mail postfix/smtpd[3421]: connect from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    Sep 28 01:50:34 mail postfix/smtpd[3421]: warning: SASL authentication problem: unknown password verifier
    Sep 28 01:50:34 mail postfix/smtpd[3421]: warning: h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]: SASL LOGIN authentication failed
    Sep 28 01:50:34 mail postfix/smtpd[3421]: lost connection after AUTH from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    Sep 28 01:50:34 mail postfix/smtpd[3421]: disconnect from h-[I]myipaddress[/I].nycmny.covad.net[[I]myipaddress[/I]]
    
     
  20. wmrwl

    wmrwl Member

    Is it possible that my SASL problems are related to the permissions of /etc/postfix/sasl/smtpd.conf

    The "ls -l" command for /var/spool/postfix/var/run/saslauthd/
    (mail:~# ls -l /var/spool/postfix/var/run/saslauthd/) shows the following permissions:

    Code:
    total 4
    srwxrwxrwx  1 root root 0 Sep 28 01:47 mux
    -rw-------  1 root root 0 Sep 28 01:47 mux.accept
    -rw-------  1 root root 5 Sep 28 01:47 saslauthd.pid
    
    During step 5 of the HOWTO where it states to mkdir -p /var/spool/postfix/var/run/saslauthd I was logged in as root.

    What does everyone think?
     

Share This Page