Find the answer to your Linux question:
Results 1 to 3 of 3
Good morning, I recently purchased a vps, at which I'm moving my domains. I'm looking for a secure mail server that allows me to use virtual users and aliases, so ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2014
    Posts
    2

    Problems with the mail server on VPS. (postfix dovecot)


    Good morning, I recently purchased a vps, at which I'm moving my domains.
    I'm looking for a secure mail server that allows me to use virtual users and aliases, so I found a tutorial that I'm following written by lelutin.ca (I can't post the url u)
    Would also be satisfied with another solution that meets my requirements

    Reached the point "Testing mail retrieval with Dovecot" Postfix works well, but dovecot rejects all connections.
    I've been modifying some parameters, but without success.

    See if someone can help me out, I would be grateful. Meantime I'm without email.
    Of course, I will respond with any information required.

  2. #2
    Just Joined!
    Join Date
    Jul 2014
    Posts
    22
    First, I do like your combination of Postfix & Dovecot. I use it as well. However, what OS are you using?? First... Here's a good walk through I've used.

    https://www.digitalocean.com/communi...r-with-dovecot

    Also, here's something you may want to check for.

    If you have this line in your main.cf remove it.

    smtpd_sender_restrictions = ..., reject_unauth_destination, ...

    Otherwise you need to setup authorized destinations. I'm not that well versed enough with these apps to know more. I set it up and leave it.

    Good luck, if you have any more questions I'll see what I can do.

  3. #3
    Just Joined!
    Join Date
    Feb 2014
    Posts
    2
    Hi, sorry to answer so late. Between the holidays and stuff I couldn't answer before.
    First, thanks to WhyNotKeithberg for replying.
    Since I posted the above message to now, I have restored the VPS with a clean image of Debian 7 to start over step by step. I don't think it's that difficult to set up a secure mail server for multiple domains and virtual alias & users.
    I've been following a more modern guide of digitalocean. And especially postfix documentation.
    I focused in configuring postfix only, only a user in a domain. When it work, I'll add the others domains and users.
    My configuration is as follows:

    DNS Records:
    Code:
    main.example.com    A    70.70.70.70
    mail.main.example.com    A    70.70.70.70
    main.example.com    MX    mail.main.example.com    10
    hostname -f
    Code:
    main.example.com
    /etc/hosts
    Code:
    127.0.0.1 localhost.localdomain localhost
    70.70.70.70 main.example.com main
    /etc/hostname
    Code:
    main
    /etc/aliases
    Code:
    root: hostmaster@main.example.com
    /etc/postfix/main.cf
    Code:
    command_directory = /usr/sbin
    daemon_directory = /usr/lib/postfix
    data_directory = /var/lib/postfix
    mail_owner = postfix
    default_privs = nobody
    myhostname = mail.main.example.com
    mydomain = main.example.com
    myorigin = $mydomain
    inet_interfaces = all
    proxy_interfaces =
    mydestination = $myhostname, $mydomain, localhost.localdomain, localhost.$mydomain, localhost
    local_recipient_maps =  $alias_maps
    unknown_local_recipient_reject_code = 550
    mynetworks = 127.0.0.0/8
    relay_domains =
    relayhost =
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    home_mailbox = Maildir/
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    debugger_command =
    	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    	 ddd $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail
    newaliases_path = /usr/bin/newaliases
    mailq_path = /usr/bin/mailq
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix/examples
    readme_directory = /usr/share/doc/postfix
    inet_protocols = ipv4
    #cert for *.main.example.com
    smtpd_tls_cert_file=/etc/ssl/certs/wildcard.main.example.com.pem
    smtpd_tls_key_file=/etc/ssl/private/main.example.com.key
    smtpd_use_tls=yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_tls_security_level=may
    smtpd_tls_protocols = !SSLv2, !SSLv3
    virtual_mailbox_domains = mail.main.example.com, main.example.com
    virtual_mailbox_base = /var/mail/vhosts/
    virtual_mailbox_maps = hash:/etc/postfix/vmailbox
    virtual_minimum_uid = 1000
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    virtual_alias_maps = pcre:/etc/postfix/virtual
    /etc/postfix/master.cf
    Code:
    smtp      inet  n       -       -       -       -       smtpd
    submission inet n       -       -       -       -       smtpd
      -o syslog_name=postfix/submission
      -o smtpd_tls_wrappermode=no
      -o smtpd_tls_security_level=encrypt
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
      -o milter_macro_daemon_name=ORIGINATING
      -o smtpd_sasl_type=dovecot
      -o smtpd_sasl_path=private/auth
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    relay     unix  -       -       -       -       -       smtp
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       1       scache
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix	-	n	n	-	2	pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    /etc/postfix/virtual
    Code:
    # GLOBAL ALIAS - RFC2142 COMPLIANT
    #
    /^news@(.+$)/ usenet@$1
    /^www@(.+$)/ webmaster@$1
    /^abuse@(.+$)/ hostmaster@$1
    /^admin@(.+$)/ hostmaster@$1
    /^ftp@(.+$)/ hostmaster@$1
    /^noc@(.+$)/ hostmaster@$1
    /^postmaster@(.+$)/ hostmaster@$1
    /^security@(.+$)/ hostmaster@$1
    /^usenet@(.+$)/ hostmaster@$1
    /^uucp@(.+$)/ hostmaster@$1
    /^webmaster@(.+$)/ hostmaster@$1
    /^hostmaster@(?!main\.example\.com).+$/ hostmaster@main.example.com
    /etc/postfix/vmailbox.db (Note .db)
    Code:
    # DOMAIN main.example.com
    hostmaster@main.example.com main.example.com/hostmaster/

  4. $spacer_open
    $spacer_close

Posting Permissions

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