Page 37 of 51 FirstFirst ... 27353637383947 ... LastLast
Results 361 to 370 of 506

Thread: Howto: set up a mail server in Ubuntu

  1. #361
    Join Date
    Nov 2010
    Beans
    1

    Re: Howto: set up a mail server in Ubuntu

    First of all I'd like to thank so much for flurdy's great tutorial and all the other help from the posts in this thread!

    I've on very specific and short question left: Is it possible to allow IMAP and/or POP3 protocol specifically for each user?
    It may happen that I don't want some user to use space on my server and for that only allow him to use the POP3-protocol.

    I'd really appreciate some help :-)

  2. #362
    Join Date
    Apr 2009
    Location
    Saitama, Japan
    Beans
    132
    Distro
    Ubuntu 10.04 Lucid Lynx

    mass email script

    I've noticed clamav has issue an update recommendation version of 96.5. We are currently at 9.6.3. Has anyone updated their clamav app, if so can you provided a run down on how you upgrade and reconfigure the mail server to scan your emails? I failed to make it work.
    Last edited by duceduc; December 23rd, 2010 at 06:56 AM.

  3. #363
    Join Date
    Dec 2008
    Beans
    252

    Re: Howto: set up a mail server in Ubuntu

    As someone who is considering coming from a Windows Mail Server to Linux, this looks a great guide.

    Couple of questions :

    can inbound mail be filtered and stopped using a simple if "EHLO/HELO doesn't contain . " drop and blacklist

    Can we do IMAP Filtering, check headers, body and subject and then move specific matching mail to a users IMAP / SubFolder ?

    Last one. Is there an option for a simple GUI for the logs ?

    Thanks

  4. #364
    Join Date
    Jan 2011
    Beans
    10

    Re: Howto: set up a mail server in Ubuntu

    Quote Originally Posted by Villu View Post
    Thanks for a great tutorial, Flurdy!

    I have managed to complement Flurdy's tutorial such that virtual transport is swapped for maildrop and spam is automatically delivered to a spam folder.

    It is based on the excellent tutorial by Flurdy and complemented by parts of the tutorial found here: http://daemonforums.org/showthread.php?t=193

    The latter tutorial also contains methods to implement vacation messaging.

    If in doubt, check out the forementioned tutorial.

    Here's what I did:

    Complete Flurdy's tutorial and install maildrop

    uncomment in main.cf:
    Code:
    transport_maps = mysql:/etc/postfix/mysql_transport.cf
    and add
    Code:
    maildrop_destination_recipient_limit = 1
    Master.cf file should contain the following line, change the user field to virtual:
    Code:
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=virtual argv=/usr/bin/maildrop -d ${recipient}
    create mysql_transport.cf file and set the correct owner and permissions:
    Code:
    user=mail
    password=changeme
    dbname=maildb
    table=domains
    select_field=transport
    where_field=domain
    hosts=127.0.0.1
    additional_conditions = and enabled = 1
    create:
    Code:
    # cd /var/spool/mail/virtual/
    # chmod +s /usr/bin/maildrop
    # touch .mailfilter
    # chmod 600 .mailfilter
    # mkdir mailfilters
    # chmod 700 mailfilters
    # chown -R virtual:virtual .mailfilter mailfilters
    test maildrop and check logs:
    Code:
    echo "test" | maildrop -V 9 -d you@example.com
    Edit the ...virtual/.mailfilter file (haven't tested this bit):
    Code:
    # Deliver to Inbox or Spam box (create spam box if it does not exist)
    if (/^X-Spam-Flag: YES/:h)
    {
        `test -d $DEFAULT/.junkmail`
        if ($RETURNCODE == 1)
        {
            `/usr/bin/maildirmake -f junkmail $DEFAULT`
            `echo "junkmail" >> $DEFAULT/subscriptions`
        }
        exception {
            to "$DEFAULT/.junkmail"
        }
        # if all else fails, do regular delivery
        exception {
            to "$DEFAULT"
        }
    }
    Now use phpmyadmin and change domain transport field from "virtual:" to "maildrop:"

    Restart postfix, check log files and pray

    Much of the code here is curtesy of hamba from daemonforums.org

    Hope this helps!

    Cheers, Villu

    Hello,
    I've installed a mailserver followinhg Flurdy's document. Thanks Flurdy.
    Next i have followed your instructions about maildrop, but I'm unable to make it working.

    Before all, I've have a doubt:

    during the install of the mailserver the package it's not installed.

    what package do you have used: ?

    maildrop or courier-maildrop

    I've tried both with two differenent result.
    Using courier-maildrop, when i execute the test:
    echo "test" | maildrop -V 9 -d myemail@mydomain

    in the mailbox i get a mail

    as soon i change the transport in mysql from "virtual:" to "maildrop:"
    I don't get anymore mail i sent to myself.

    on the mail log there is: delivered via maildrop service

    What I noticed, under the directory: /var/spool/mail/virtual a file called "Maildir" get created and it's containing the mail i sent.


    Any idea ?

    Thanks
    regards
    federico

  5. #365
    Join Date
    Jan 2011
    Beans
    10

    Re: Howto: set up a mail server in Ubuntu

    Quote Originally Posted by Villu View Post
    Thanks for a great tutorial, Flurdy!

    I have managed to complement Flurdy's tutorial such that virtual transport is swapped for maildrop and spam is automatically delivered to a spam folder.

    It is based on the excellent tutorial by Flurdy and complemented by parts of the tutorial found here: http://daemonforums.org/showthread.php?t=193

    The latter tutorial also contains methods to implement vacation messaging.

    If in doubt, check out the forementioned tutorial.

    Here's what I did:

    Complete Flurdy's tutorial and install maildrop

    uncomment in main.cf:
    Code:
    transport_maps = mysql:/etc/postfix/mysql_transport.cf
    and add
    Code:
    maildrop_destination_recipient_limit = 1
    Master.cf file should contain the following line, change the user field to virtual:
    Code:
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=virtual argv=/usr/bin/maildrop -d ${recipient}
    create mysql_transport.cf file and set the correct owner and permissions:
    Code:
    user=mail
    password=changeme
    dbname=maildb
    table=domains
    select_field=transport
    where_field=domain
    hosts=127.0.0.1
    additional_conditions = and enabled = 1
    create:
    Code:
    # cd /var/spool/mail/virtual/
    # chmod +s /usr/bin/maildrop
    # touch .mailfilter
    # chmod 600 .mailfilter
    # mkdir mailfilters
    # chmod 700 mailfilters
    # chown -R virtual:virtual .mailfilter mailfilters
    test maildrop and check logs:
    Code:
    echo "test" | maildrop -V 9 -d you@example.com
    Edit the ...virtual/.mailfilter file (haven't tested this bit):
    Code:
    # Deliver to Inbox or Spam box (create spam box if it does not exist)
    if (/^X-Spam-Flag: YES/:h)
    {
        `test -d $DEFAULT/.junkmail`
        if ($RETURNCODE == 1)
        {
            `/usr/bin/maildirmake -f junkmail $DEFAULT`
            `echo "junkmail" >> $DEFAULT/subscriptions`
        }
        exception {
            to "$DEFAULT/.junkmail"
        }
        # if all else fails, do regular delivery
        exception {
            to "$DEFAULT"
        }
    }
    Now use phpmyadmin and change domain transport field from "virtual:" to "maildrop:"

    Restart postfix, check log files and pray

    Much of the code here is curtesy of hamba from daemonforums.org

    Hope this helps!

    Cheers, Villu
    Hello,
    I've installed a mailserver followinhg Flurdy's document. Thanks Flurdy.
    Next i have followed your instructions about maildrop, but I'm unable to make it working.

    Before all, I've have a doubt:

    during the install of the mailserver the package it's not installed.

    what package do you have used: ?

    maildrop or courier-maildrop

    I've tried both with two differenent result.
    Using courier-maildrop, when i execute the test:
    echo "test" | maildrop -V 9 -d myemail@mydomain

    in the mailbox i get a mail

    as soon i change the transport in mysql from "virtual:" to "maildrop:"
    I don't get anymore mail i sent to myself.

    on the mail log there is: delivered via maildrop service

    What I noticed, under the directory: /var/spool/mail/virtual a file called "Maildir" get created and it's containing the mail i sent.


    Any idea ?

    Thanks
    regards
    federico

  6. #366
    Join Date
    Feb 2011
    Location
    London.
    Beans
    4
    Distro
    Ubuntu

    Re: Howto: set up a mail server in Ubuntu

    I've gone through the tutorial up to where all the basics should be up and running. From the server box itself I can telnet in and send email. I can receive email. I can see my received email from a client machine in Thunderbird. But I cannot send email from Thunderbird. I get "The mail server responded: 5.7.1 <test@destination.com>: Relay access denied. Please check the message recipient test@destination.com and try again.". I'm guessing that it's not the recipient that's really causing the problem - I think that courier isn't talking nicely to postfix. I've turned on verbose debugging in postfix/smtpd and I see this sort of conversation going on:


    Code:
    EHLO [192.168.1.2]
     > unknown[80.175.115.177]: 250-bagpuss.localdomain
     > unknown[80.175.115.177]: 250-PIPELINING
     > unknown[80.175.115.177]: 250-SIZE 10240000
     match_list_match: unknown: no match
     match_list_match: 80.175.115.177: no match
     > unknown[80.175.115.177]: 250-ETRN
     > unknown[80.175.115.177]: 250-ENHANCEDSTATUSCODES
     > unknown[80.175.115.177]: 250-8BITMIME
     > unknown[80.175.115.177]: 250 DSN
     < unknown[80.175.115.177]: MAIL FROM:<sender@mynewdomain.com> SIZE=454
     extract_addr: input: <sender@mynewdomain.com>
     smtpd_check_addr: addr=sender@mynewdomain.com
     connect to subsystem private/rewrite
     send attr request = rewrite
     send attr rule = local
     send attr address = sender@mynewdomain.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 0
     private/rewrite socket: wanted attribute: address
     input attribute name: address
     input attribute value: sender@mynewdomain.com
     private/rewrite socket: wanted attribute: (list terminator)
     input attribute name: (end)
     rewrite_clnt: local: sender@mynewdomain.com -> sender@mynewdomain.com
     send attr request = resolve
     send attr sender =
     send attr address = sender@mynewdomain.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 0
     private/rewrite socket: wanted attribute: transport
     input attribute name: transport
     input attribute value: virtual
     private/rewrite socket: wanted attribute: nexthop
     input attribute name: nexthop
     input attribute value: mynewdomain.com
     private/rewrite socket: wanted attribute: recipient
     input attribute name: recipient
     input attribute value: sender@mynewdomain.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 1024
     private/rewrite socket: wanted attribute: (list terminator)
     input attribute name: (end)
     resolve_clnt: `' -> `sender@mynewdomain.com' -> transp=`virtual' host=`mynewdomain.com' rcpt=`sender@mynewdomain.com' flags= class=virtual
     ctable_locate: install entry key sender@mynewdomain.com
     extract_addr: in: <sender@mynewdomain.com>, result: sender@mynewdomain.com
     fsspace: .: block size 1024, blocks free 3696436
     smtpd_check_queue: blocks 1024 avail 3696436 min_free 0 msg_size_limit 10240000
     > unknown[80.175.115.177]: 250 2.1.0 Ok
     < unknown[80.175.115.177]: RCPT TO:<test@destination.com>
     extract_addr: input: <test@destination.com>
     smtpd_check_addr: addr=test@destination.com
     send attr request = rewrite
     send attr rule = local
     send attr address = test@destination.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 0
     private/rewrite socket: wanted attribute: address
     input attribute name: address
     input attribute value: test@destination.com
     private/rewrite socket: wanted attribute: (list terminator)
     input attribute name: (end)
     rewrite_clnt: local: test@destination.com -> test@destination.com
     send attr request = resolve
     send attr sender =
     send attr address = test@destination.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 0
     private/rewrite socket: wanted attribute: transport
     input attribute name: transport
     input attribute value: smtp
     private/rewrite socket: wanted attribute: nexthop
     input attribute name: nexthop
     input attribute value: techie.com
     private/rewrite socket: wanted attribute: recipient
     input attribute name: recipient
     input attribute value: test@destination.com
     input attribute value: test@destination.com
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 4096
     private/rewrite socket: wanted attribute: (list terminator)
     input attribute name: (end)
     resolve_clnt: `' -> `test@destination.com' -> transp=`smtp' host=`techie.com' rcpt=`test@destination.com' flags= class=default
     ctable_locate: install entry key test@destination.com
     extract_addr: in: <test@destination.com>, result: test@destination.com
     send attr request = rewrite
     send attr rule = local
     send attr address = double-bounce
     private/rewrite socket: wanted attribute: flags
     input attribute name: flags
     input attribute value: 0
     private/rewrite socket: wanted attribute: address
     input attribute name: address
     input attribute value: double-bounce@mynewdomain.com
     private/rewrite socket: wanted attribute: (list terminator)
     input attribute name: (end)
     rewrite_clnt: local: double-bounce -> double-bounce@mynewdomain.com
     >>> START Recipient address RESTRICTIONS <<<
     generic_checks: name=permit_mynetworks
     permit_mynetworks: unknown 80.175.115.177
     match_hostname: unknown ~? 127.0.0.0/8
     match_hostaddr: 80.175.115.177 ~? 127.0.0.0/8
     match_hostname: unknown ~? [::ffff:127.0.0.0]/104
     match_hostaddr: 80.175.115.177 ~? [::ffff:127.0.0.0]/104
     match_hostname: unknown ~? [::1]/128
     match_hostaddr: 80.175.115.177 ~? [::1]/128
     match_list_match: unknown: no match
     match_list_match: 80.175.115.177: no match
     generic_checks: name=permit_mynetworks status=0
     generic_checks: name=reject_unauth_destination
     reject_unauth_destination: test@destination.com
     permit_auth_destination: test@destination.com
     ctable_locate: leave existing entry key test@destination.com
     NOQUEUE: reject: RCPT from unknown[80.175.115.177]: 554 5.7.1 <test@destination.com>: Relay access denied; from=<sender@mynewdomain.com> to=<test@destination.com> proto=ESMTP helo=<[192.168.1.2]>
    I think this is trying to tell me that courier isn't successfully starting a TLS session. But I'm not really sure. If not - why would that be? Your input much appreciated.

  7. #367
    Join Date
    Jan 2011
    Beans
    10

    Re: Howto: set up a mail server in Ubuntu

    [ >>> START Recipient address RESTRICTIONS <<<
    generic_checks: name=permit_mynetworks
    permit_mynetworks: unknown 80.175.115.177
    match_hostname: unknown ~? 127.0.0.0/8
    match_hostaddr: 80.175.115.177 ~? 127.0.0.0/8
    match_hostname: unknown ~? [::ffff:127.0.0.0]/104
    match_hostaddr: 80.175.115.177 ~? [::ffff:127.0.0.0]/104
    match_hostname: unknown ~? [::1]/128
    match_hostaddr: 80.175.115.177 ~? [::1]/128
    match_list_match: unknown: no match
    match_list_match: 80.175.115.177: no match
    generic_checks: name=permit_mynetworks status=0
    generic_checks: name=reject_unauth_destination
    reject_unauth_destination: test@destination.com
    permit_auth_destination: test@destination.com
    ctable_locate: leave existing entry key test@destination.com
    NOQUEUE: reject: RCPT from unknown[80.175.115.177]: 554 5.7.1 <test@destination.com>: Relay access denied; from=<sender@mynewdomain.com> to=<test@destination.com> proto=ESMTP helo=<[192.168.1.2]>[/CODE]

    I think this is trying to tell me that courier isn't successfully starting a TLS session. But I'm not really sure. If not - why would that be? Your input much appreciated.

    Hello,
    for a test purpose, i think you can just add the Ip address (80.175.115.177) or the subnet where you are coming 80.175.115.0/24 in the file /etc/postfix/main.cf and reload postfix sudo /etc/init.d/postfix reload


    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 80.175.115.177/32

    This shoudl fix your issue, since the address will be considered a local address and not blocked by the restriction. Obviously this is not a good config for a production server.

    Hope this help.
    Regards
    Federico
    Last edited by fedef63; February 28th, 2011 at 06:30 PM.

  8. #368
    Join Date
    Feb 2011
    Location
    London.
    Beans
    4
    Distro
    Ubuntu

    Re: Howto: set up a mail server in Ubuntu

    Huge thanks for this Federico - I can't tell you what a pleasure it is just to see something working. Quite right this is not enough for a production system, though.

    What I can't quite understand - cos there are a few bits where Flurdy's doc is just a tiny bit vague - having got to the minimally configured stage should I be able to use a mail client to send mail using smtp/starttls or is that only going to be possible once I've got all the sasl stuff configured up?

    Because now I don't know whether to try and debug my current setup or to push on with the next area of work in the doc.

    Many thanks, beautiful people.

  9. #369
    Join Date
    Jan 2011
    Beans
    10

    Re: Howto: set up a mail server in Ubuntu

    Hello,
    I've followed all the Flurdy's document and he did really a big work.
    I've been able to make working almost everything listed there, except SASL, since I think I've not understood what password to use. Anyhow, i do not want use SASL for users authentication. TLS/SSL would be ok and it do not require SASL.
    To answer to your question: Yes you will be able to implement smtp/starttls/ssl. Without Sasl
    Regards
    Federico

  10. #370
    Join Date
    Apr 2009
    Location
    Saitama, Japan
    Beans
    132
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: set up a mail server in Ubuntu

    fedef63:

    Did you ever got maildrop to work? If so which of the maildrop version you used? I am about to setup this up and would like to know the steps. Thanks.

Page 37 of 51 FirstFirst ... 27353637383947 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •