Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail -Ubuntu 8.04

Discussion in 'HOWTO-Related Questions' started by c4rdinal, May 27, 2008.

  1. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /home/vmail
    ?
     
  2. Morons

    Morons Member

    root@geekscraft:~# ls -la /home/vmail
    total 20
    drwxr-xr-x 2 vmail vmail 4096 2008-08-12 09:47 .
    drwxrwx--- 17 root root 4096 2008-08-12 09:47 ..
    -rw-r--r-- 1 vmail vmail 220 2008-08-12 09:47 .bash_logout
    -rw-r--r-- 1 vmail vmail 2940 2008-08-12 09:47 .bashrc
    -rw-r--r-- 1 vmail vmail 586 2008-08-12 09:47 .profile
     
  3. Éverton Vieira

    Éverton Vieira New Member

    I followed the same how-to : http://www.howtoforge.com/virtual-us...ail-ubuntu8.04

    My problem is that I can login in the webmail and in outlook express and send e-mails to address like gmail, hotmail, yahoo, etc.

    But when i try the other way, to send form gmail to my server for example, the message is not delyvered.

    I just can see this in the logs:

    Aug 12 11:31:06 servermail pop3d-ssl: LOGIN, [email protected], ip=[::ffff:200.129.167.34], port=[49394]
    Aug 12 11:31:06 servermail pop3d-ssl: LOGOUT, [email protected], ip=[::ffff:200.129.167.34], port=[49394], top=0, retr=0, rcvd=12, sent=39, time=0
    Aug 12 15:35:10 servermail postfix/anvil[5784]: statistics: max connection rate 1/60s for (smtp:200.189.174.197) at Aug 12 11:30:58
    Aug 12 15:35:10 servermail postfix/anvil[5784]: statistics: max connection count 1 for (smtp:200.189.174.197) at Aug 12 11:30:58
    Aug 12 15:35:10 servermail postfix/anvil[5784]: statistics: max cache size 1 at Aug 12 11:30:58
    Aug 12 15:37:17 servermail postfix/smtpd[5816]: connect from rv-out-0506.google.com[209.85.198.237]
    Aug 12 15:37:17 servermail postfix/smtpd[5816]: lost connection after CONNECT from rv-out-0506.google.com[209.85.198.237]
    Aug 12 15:37:17 servermail postfix/smtpd[5816]: disconnect from rv-out-0506.google.com[209.85.198.237]

    Why does this happen?

    I increase the max connections in master.cf but i still getting this conect disconect message...

    Anyone?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    chmod 775 /home
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Are there any other errors in your mail log?
    Are the MX records for your domains correct?
     
  6. Éverton Vieira

    Éverton Vieira New Member

    No,

    There are just that kind of error:


    "connect from", "lost connection after CONNECT" and "disconnect from"

    From all the domais that I've tested (hotmail, gmail, yahoo)

    I think my dns is ok

    servermail IN A IP
    smtp IN CNAME servermail.domain.br.
    pop IN CNAME servermail.domain.br.
    @ IN MX 5 servermail.domain.br.
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Does servermail.domain.br point to the right IP address?
     
  8. Éverton Vieira

    Éverton Vieira New Member

    Yeah...Absolutely
     
  9. falko

    falko Super Moderator Howtoforge Staff

  10. superman

    superman New Member

    Spam filter not working.

    Hi there

    I followed the HOWTO step by step and mail is working fine, but for some reason there is spam coming through.

    Here is the mail.log I looks like the mail is scanned, just not being blocked.

    Aug 18 09:48:50 roux amavis[5229]: (05229-02) Passed CLEAN, [195.***.***.***] [195.***.***.***] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: Prne4IFT5coy, Hits: 5.065, size: 23086, queued_as: 157DE23840A, 5427 ms
    Aug 18 09:48:50 roux postfix/smtp[5473]: 03A65238254: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.1, delays=0.67/0/0/5.4, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 157DE23840A)
    Aug 18 10:25:14 roux amavis[5230]: (05230-03) Passed CLEAN, [209.85.198.235] [209.85.198.235] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: l7C2G4pOz7dR, Hits: 5.113, size: 2890, queued_as: 91AD823840A, 10230 ms
    Aug 18 10:25:14 roux postfix/smtp[6167]: F2EB2238254: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=12, delays=2.1/0.01/0/10, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 91AD823840A)
    Aug 18 10:25:14 roux postfix/qmgr[5108]: F2EB2238254: removed
    Aug 18 12:44:34 roux postfix/smtpd[7406]: DA44223840B: client=localhost[127.0.0.1]
    Aug 18 12:44:34 roux postfix/cleanup[7396]: DA44223840B: message-id=<[email protected]>
    Aug 18 12:44:34 roux postfix/qmgr[7381]: DA44223840B: from=<[email protected]>, size=23641, nrcpt=1 (queue active)
    Aug 18 12:44:34 roux postfix/smtpd[7406]: disconnect from localhost[127.0.0.1]
    Aug 18 12:44:34 roux amavis[5229]: (05229-04) Passed CLEAN, [195.***.***.***] [195.***.***.***] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: maA9UEMBophe, Hits: 4.768, size: 23166, queued_as: DA44223840B, 40290 ms
    Aug 18 12:44:34 roux postfix/smtp[7397]: A3BF4238251: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=42, delays=2/0.01/0/40, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as DA44223840B)
    Aug 18 12:44:34 roux postfix/qmgr[7381]: A3BF4238251: removed
    Aug 18 12:44:34 roux postfix/virtual[7409]: DA44223840B: to=<[email protected]>, relay=virtual, delay=0.05, delays=0.01/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)



    Aug 19 08:28:27 roux amavis[5229]: (05229-06) Passed CLEAN, [196.41.6.142] [196.209.201.152] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: ITMoBFtsEc7n, Hits: 4.678, size: 21756, queued_as: 2676323840C, 8233 ms
    Aug 19 08:28:27 roux postfix/smtp[4985]: CB56B23840B: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=9.4, delays=1.1/0.01/0/8.2, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 2676323840C)
    Aug 19 08:28:27 roux postfix/qmgr[7381]: CB56B23840B: removed
    Aug 19 08:28:27 roux postfix/virtual[4995]: 2676323840C: to=<[email protected]>, relay=virtual, delay=0.13, delays=0.02/0.03/0/0.08, dsn=2.0.0, status=sent (delivered to maildir)


    Also where can I add addresses to a white list and black list? and change the score on mails that should be blocked?

    Your help will be great

    many thanks
    Superman
     
  11. Morons

    Morons Member

    Yes if you look at /etc/amavis/conf.d/20-debian_defaults (page 3 of the setup), there you can set the Hits: Carefull with this, it can become muddy! The curect setting will only tag if spam reaches 6.31.

    Anycase I would leave it like this and add postgrey to sort te common spam.
     
  12. superman

    superman New Member

    ...

    Hi there

    Thanks for the reply.

    I changed the values just to test, I made the tag to 1.0 and block to 2. and then sent a spam mail to the server.

    here is the logs, Hits was 3.8 and the mail went through 100%...

    Aug 19 17:16:32 roux amavis[12286]: (12286-01) Passed SPAMMY, [195.***.***.***] [196.209.201.152] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: hpXpeoDqAGbC, Hits: 3.852, size: 23185, queued_as: 4249B23840C, 6813 ms
    Aug 19 17:16:32 roux postfix/smtp[12467]: D5DB123840B: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=7.4, delays=0.61/0.01/0.01/6.8, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 4249B23840C)
    Aug 19 17:16:32 roux postfix/qmgr[12445]: D5DB123840B: removed
    Aug 19 17:16:32 roux postfix/virtual[12475]: 4249B23840C: to=<[email protected]>, relay=virtual, delay=0.05, delays=0.02/0.02/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
    Aug 19 17:16:32 roux postfix/qmgr[12445]: 4249B23840C: removed


    Is the something I am missing?

    Also can you tell me if there is a way to add things to a white and black list?

    many thanks for your help.

    About the postgrey how do I add that?

    Sorry but I am a bit new to this :-(
     
  13. iWarior

    iWarior New Member

    "Crazy" variable %s in MySQL query ...

    Hello, All!

    I'm working in x64 Ubuntu Server 8.04, and have very strange problem with Postfix + MySQL. I'm install and config Postfix by this HowTo: http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04

    All seems like a works:

    Code:
    # netstat -tap 
    
    [B]tcp        0      0 localhost:10024         *:*                     LISTEN      4908/amavisd (maste
    tcp        0      0 localhost:10025         *:*                     LISTEN      13043/master[/B]
    tcp        0      0 localhost:mysql         *:*                     LISTEN      10152/mysqld
    tcp        0      0 *:www                   *:*                     LISTEN      5699/apache2
    tcp        0      0 example.com:domain          *:*                     LISTEN      4849/named
    tcp        0      0 localhost:domain        *:*                     LISTEN      4849/named
    [B]tcp        0      0 *:smtp                  *:*                     LISTEN      13043/master[/B]
    tcp        0      0 localhost:953           *:*                     LISTEN      4849/named
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      5427/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      5461/couriertcpd
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      5441/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      5407/couriertcpd
    tcp6       0      0 [::]:domain             [::]:*                  LISTEN      4849/named
    I'm put all info in to mysql tables, configure *.cf-files, clam, antispam etc

    But postfix work very strange (not create mail folder, only receive mail's and so one). After long debug, i'm understand, that problem in mysql query from *.cf files – in %s variable (http://www.postfix.org/mysql_table.5.html). In this variable, in this situation, must be e-mail address of e-mail recipient (eg: [email protected]), But...

    If I'm write in mysql-virtual_mailboxes.cf

    Code:
    query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email = '%s'
    in mysql log file I see, that %s = example.com

    But, if I'm write (only for test of course :) ):

    Code:
    query = SELECT '%s'
    I'm see in %s place my [email protected]

    I'm really don't understand, whats happen, and why in the same place I have different results...:confused:

    Any ideas?..
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your mail log?
     
  15. rc1985

    rc1985 New Member

    Hello!
    Im getting this error (mail.err and mail.log) when trying to access pop3. I followed this tutorial bellow:

    http://www.howtoforge.com/virtual_users_and_domains_with_postfix_debian_etch_p1

    thanks
     
    Last edited: Nov 3, 2008
  16. superman

    superman New Member

    Hi there.

    Try to reinstall courier-imap, I had the same error and I reinstall it, sorted my issue.

    Superman
     
  17. Marc-Andre

    Marc-Andre New Member

    Forwarding doesn't work

    Hi,

    i followed the howto to the letter, but i got the last times complains from clients that they're missing some eMails. I figured out that the forwarding doesn't work as it should.

    My test case is following : i send from my gmail account to the postmaster address of my domain, which is in the forwarding table and should forward to my real address.

    In the mail.log i have that:
    Code:
    Nov 10 16:07:42 intrepid postfix/smtpd[32213]: connect from nf-out-0910.google.com[64.233.182.184]
    Nov 10 16:07:42 intrepid postfix/smtpd[32213]: 357C62E6D8: client=nf-out-0910.google.com[64.233.182.184]
    Nov 10 16:07:42 intrepid postfix/cleanup[31933]: 357C62E6D8: message-id=<[email protected]>
    Nov 10 16:07:42 intrepid postfix/qmgr[30649]: 357C62E6D8: from=<[email protected]>, size=2469, nrcpt=1 (queue active)
    Nov 10 16:07:42 intrepid amavis[31282]: (31282-14) ESMTP::10024 /var/lib/amavis/tmp/amavis-20081110T155440-31282: <[email protected]> -> <[email protected]> SIZE=2469 Received: from intrepid.sudimage.net ([127.0.0.1]) by localhost (intrepid.sudimage.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <[email protected]>; Mon, 10 Nov 2008 16:07:42 +0100 (CET)
    Nov 10 16:07:42 intrepid amavis[31282]: (31282-14) Checking: ix5cj-iZz7dw [64.233.182.184] <[email protected]> -> <[email protected]>
    Nov 10 16:07:44 intrepid postfix/smtpd[30666]: connect from localhost.localdomain[127.0.0.1]
    Nov 10 16:07:44 intrepid postfix/smtpd[30666]: 8A5142E763: client=localhost.localdomain[127.0.0.1]
    Nov 10 16:07:44 intrepid postfix/cleanup[31933]: 8A5142E763: message-id=<[email protected]>
    Nov 10 16:07:44 intrepid postfix/qmgr[30649]: 8A5142E763: from=<[email protected]>, size=2957, nrcpt=1 (queue active)
    Nov 10 16:07:44 intrepid postfix/smtpd[30666]: disconnect from localhost.localdomain[127.0.0.1]
    Nov 10 16:07:44 intrepid amavis[31282]: (31282-14) FWD via SMTP: <[email protected]> -> <[email protected]>,BODY=7BIT 250 2.6.0 Ok, id=31282-14, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 8A5142E763
    Nov 10 16:07:44 intrepid amavis[31282]: (31282-14) Passed CLEAN, [64.233.182.184] [64.233.182.184] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: ix5cj-iZz7dw, Hits: -2.599, size: 2469, queued_as: 8A5142E763, 2336 ms
    Nov 10 16:07:44 intrepid postfix/smtp[32218]: 357C62E6D8: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.4, delays=0.04/0/0/2.3, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 8A5142E763)
    Nov 10 16:07:44 intrepid postfix/qmgr[30649]: 357C62E6D8: removed
    Nov 10 16:07:44 intrepid postfix/virtual[30667]: 8A5142E763: to=<[email protected]>, relay=virtual, delay=0.03, delays=0.01/0/0/0.03, dsn=5.1.1, status=bounced (unknown user: "[email protected]")
    Nov 10 16:07:44 intrepid postfix/cleanup[31933]: 92B4B2E6D8: message-id=<[email protected]>
    Nov 10 16:07:44 intrepid postfix/bounce[32222]: 8A5142E763: sender non-delivery notification: 92B4B2E6D8
    Nov 10 16:07:44 intrepid postfix/qmgr[30649]: 92B4B2E6D8: from=<>, size=4863, nrcpt=1 (queue active)
    Nov 10 16:07:44 intrepid postfix/qmgr[30649]: 8A5142E763: removed
    Nov 10 16:07:45 intrepid postfix/smtp[32223]: 92B4B2E6D8: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[72.14.221.114]:25, delay=0.48, delays=0.01/0/0.08/0.39, dsn=2.0.0, status=sent (250 2.0.0 OK 1226329665 4si10414336fgg.4)
    Nov 10 16:07:45 intrepid postfix/qmgr[30649]: 92B4B2E6D8: removed
    It's like postfix doesn't check the forwardings table.

    Where can the error be? Everything else is working just fine.

    Thanks in advance,

    Marc-André
     
  18. falko

    falko Super Moderator Howtoforge Staff

    Is there an alias for postmaster in /etc/aliases? Please create one that sends the postmaster emails to one of your working email accounts so that you can read the bounce emails. They may tell you more about the problem.
     
  19. ikaros

    ikaros New Member

    squirrelmail via https

    What should I do to be able to access squirrelmail via https://...?
    Doing the obvious, uncommenting the last section of /etc/apach2/conf.d/squirrelmail.conf , doesn't do the trick.

    Code:
    
    [...]
    # users will prefer a simple URL like http://webmail.example.com
    #<VirtualHost 1.2.3.4>
    #  DocumentRoot /usr/share/squirrelmail
    #  ServerName webmail.example.com
    #</VirtualHost>
    
    # redirect to https when available (thanks [email protected])
    #
    #  Note: There are multiple ways to do this, and which one is suitable for
    #  your site's configuration depends. Consult the apache documentation if
    #  you're unsure, as this example might not work everywhere.
    #
    #<IfModule mod_rewrite.c>
    #  <IfModule mod_ssl.c>
    #    <Location /squirrelmail>
    #      RewriteEngine on
    #      RewriteCond %{HTTPS} !^on$ [NC]
    #      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
    #    </Location>
    #  </IfModule>
    #</IfModule>
    
    
    Maybe mod_rewrite and mod_ssl aren't installed. How do I check the installed Apache's modules?
     
    Last edited: Nov 12, 2008
  20. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    a2enmod rewrite
    a2enmod ssl
    /etc/init.d/apache2 restart
     

Share This Page