Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    39

    Webmin Postfix help part 2

    So I posted earlier this week about needing some help setting up email for a domain with postfix on webmin. So let me give more specifics. I have a server with Ubuntu 10.04.1 installed with webmin 1.580.
    I have the Postfix module installed along with Apache, BIND DNS,and Dovecot Imapp/pop3 module's.

    I have a site on hostgator but I want to host email on my server.
    So these are the steps I took.
    I pointed the A records to the ip address of my server.

    Code:
    mail	5x.xx.xxx.3x	14400

    On my server I created a new virtual domain in apache


    Code:
    Handles the name-based server mydomain.com on address *.
    Address Any
    Port 80	Server Name mydomain.com
    Document Root /home/mydomain/public_html
    In postfix I setup an account to test the mail

    Code:
    Name	Maps to...
    	test@mail.mydomain.com	test
    
    Name	Maps to...
    Now when I telnet to the port 25 for the domain I get a time out

    /# telnet mail.mydomain.com 25
    Trying 5x.xxx.xx.3x...
    telnet: Unable to connect to remote host: Connection timed out


    So then I try to ping mail.mydomain.com 25 from my local machine I do get the correct ip address so it is routing.


    So maybe somewhere I"m missing a step setting this up? Do I also have to setup anyting in the Dovecot module? or do I have to do some additional steps in Apache and postfix?


    Thanks!

  2. #2
    Join Date
    Feb 2008
    Posts
    39
    I have an update on this, Checking the mail logs I get the following errors

    Code:
    Mar 13 19:33:47 lapp postfix/master[7609]: warning: process /usr/lib/postfix/smtpd pid 24566 exit status 1                 
    Mar 13 19:33:47 lapp postfix/master[7609]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
    I'm guessing I'm missing some type of configuration setting somewhere?


    Thanks!

  3. #3
    Join Date
    Feb 2008
    Posts
    39
    Here is my postfix.conf file


    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    myorigin = $mydomain
    
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = no
    
    # TLS parameters
    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = mail.mydomain.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    mydestination = localdomain, localhost, localhost.localdomain, localhost, $mydomain, $myhostname
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    ipc_idle = 100s
    notify_classes = 
    mydomain = mail.mydomain.com
    myorigin = $mydomain
    smtpd_recipient_restrictions = reject_non_fqdn_recipient reject_unknown_recipient_domain permit_mynetworks permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_non_fqdn_hostname reject_invalid_hostname check_helo_acess pcre:/etc/postfix/helo_checks check_sender_mx_access cider:/etc/postfix/bogus_mx reject_rbl_client zen.spamhaus.org reject_rbl_client cbl.abuseat.org reject_rbl_client dnsbl-1.uceprotect.net permit
    virtual_alias_maps = hash:/etc/postfix/virtual
    inet_interfaces = all

  4. #4
    Join Date
    Feb 2008
    Posts
    39
    Similar error messsage

    Code:
    /var/log# tail -f mail.err                                                                                                                                                          
    Mar 13 20:00:12 lapp postfix/smtpd[25050]: fatal: open /etc/postfix/helo_checks: No such file or directory                                                                                    
    Mar 13 20:01:13 lapp postfix/smtpd[25077]: fatal: open /etc/postfix/helo_checks: No such file or directory                                                                                    
    Mar 13 20:02:14 lapp postfix/smtpd[25081]: fatal: open /etc/postfix/helo_checks: No such file or directory                                                                                    
    Mar 13 20:03:15 lapp postfix/smtpd[25085]: fatal: open /etc/postfix/helo_checks: No such file or directory

  5. #5
    Dude, have done this:

    Code:
    sudo /etc/init.d/postfix restart
    Short of that, the next best thing is follow the below:




    Code:
    apt-get remove postfix courier-pop courier-imap
     
    apt-get   --purge remove postfix courier-pop courier-imap
    
    apt-get autoremove
    
    apt-get remove --auto-remove
    
    apt-get autoclean
    
    reboot
    
    apt-get update
    
    apt-get upgrade
    
    apt-get dist-upgrade
    
    apt-get install postfix courier-pop courier-imap


    Code:
    Install Postfix
    In this setup I assume that your domain is yourdomain.com and it has a valid MX record setup as mail.yourdomain.com. Remember to replace yourdomain.com with your actual domain in the example codes in this howto. Also I assume that you know what an MX record is. To find out MX your type in a terminal:
    
    
    dig mx yourdomain.com
    
    
    
    
    To install postfix
    
    
    
    
    sudo apt-get install postfix
    
    
    
    Install mailx package for use as command mail utility program. 
    
    
    
    Mail command is installed with this package.
    
    
    sudo apt-get install mailutils
    
    
    Test your default setup
    
    
    Add a user before you start this.
    
    
    sudo useradd -m -s /bin/bash fmaster
    sudo passwd fmaster
    
    
    
    Test your default installation using the following code segment.
    
    
    telnet localhost 25
    
    
    
    (if that doesn't work, check to see if postfix is running)
    
    
    sudo postfix status
    
    
    
    If it is not running, start it
    
    
    
    sudo postfix start
    
    
    
    Postfix will prompt like following in the terminal so that you can use to type SMTP commands.
    
    
    Trying 127.0.0.1...
    Connected to mail.fossedu.org.
    Escape character is '^]'.
    220 localhost.localdomain ESMTP Postfix (Ubuntu)
    
    
    Type the following code segment in Postfix's prompt.
    
    
    ehlo localhost
    mail from: root@localhost
    rcpt to: fmaster@localhost
    data
    Subject: My first mail on Postfix
    
    Hi,
    Are you there?
    regards,
    Admin
    . (Type the .[dot] in a new Line and press Enter )
    quit
    
    
    Check the mailbox of fmaster
    
    
    su - fmaster
    mail
    
    
    
    When you type mail command an output like follows display in your terminal.
    
    
    Mail version 8.1.2 01/15/2001.  Type ? for help.
    "/var/mail/fmaster": 2 messages 2 new
    >N  1 root@localhost     Mon Mar  6 12:49   13/479   Just a test
     N  2 root@localhost     Mon Mar  6 12:51   15/487   My first mail
    &
    
    
    
    You will observe that mails are indexed by numbers and you can type the number of which the mail that you want to read. For example type no "2" to read the 2nd mail. The type "q" to quit. The mail will be written to a file called mbox in user's home directory. According to our example it will be /home/fmaster/mbox.
    
    All messages in an mbox type of mailbox are concatenated and stored in a single file. The beginning of each message is indicated by a line whose first five characters are "From " and a blank line is appended to the end of each message
    
    
    Setting Postfix Support for Maildir-style Mailboxes
    
    
    Maildir is a format for an e-mail spool that does not require file locking to maintain message integrity because the messages are kept in separate files with unique names. A Maildir is a directory (often named Maildir) with three subdirectories named tmp, new, and cur. The subdirectories should all reside on the same filesystem.
    
    
    Another reason to use Maildir format is that Courier IMAP/POP3 servers only work with Maildir format of mailboxes.
    
    
    Please find out more about Maildir here
    
    
    Instruct Postfix to use Maildirs instead of Mboxes:
    
    
    
     sudo postconf -e "home_mailbox = Maildir/"
    
    
    Ensure Procmail isn't used: (if the step was taken during dpkg-reconfigure, by mistake)
    
    
    
    sudo postconf -e "mailbox_command = "
    
    
    
    Restart Postfix to make changes effect.
    
    
    sudo  /etc/init.d/postfix restart
    
    
    
    Test your setup again
    
    
    
    
    Check the mailbox of fmaster
    
    
    su - fmaster
    MAIL=/home/fmaster/Maildir
    mail
    
    
    
    Installing courier IMAP and POP3
    
    
    sudo apt-get install courier-pop
    sudo apt-get install courier-imap
    
    
    
    Adding your local domains to postfix
    Add your domains to mydestination: (my destination is a value in the postfix configuration file. to view your existing setting, type sudo postconf mydestination)
    
    
    sudo postconf -e "mydestination = mail.fossedu.org, localhost.localdomain, localhost, yourdomain.com"
    
    
    (note that command above will overwrite your previous settings of mydestination, so make note of your previous entries)
    
    
    
    Add your local networks, too:
    
    
    
    Postfix comes with the localhost (127.0.0.1) entry; you may have others, here we assume your LAN is on 192.168.1.0/24. Make changes to suit your situation.
    
    
    sudo postconf -e "mynetworks = 127.0.0.0/8, 192.168.1.0/24"
    
    
    
    Make Postfix to receive mail from the Internet
    
    
    Instruct Postfix to receive on all interfaces:
    
    
    
    sudo postconf -e "inet_interfaces = all"
    
    
    (optional) Make Postfix accept IPv4, IPv6 protocols
    
    
    
    If you're not using IPv6 yet, and you're paranoid, use "ipv4" instead of "all". Again, this is to suit your own network sensibilities.
    
    
    sudo postconf -e "inet_protocols = all"
    
    
    
    Finally, restart Postfix;
    
    
    sudo  /etc/init.d/postfix restart
    
    
    Test your setup again using following code:
    
    
    netcat mail.yourdomain.com 25
    ehlo yourdomain.com
    mail from: root@yourdomain.com
    rcpt to: fmaster@yourdomain.com
    data
    Subject: My first mail for my domain
    
    Hi,
    Are you there?
    regards,
    Admin
    . (and Enter In a new Line)
    quit
    
    
    
    Check the mailbox of fmaster
    
    
    su - fmaster
    cd Maildir/new
    ls
    
    Now you will see mail has a separate file.
    
    Testing Courier POP3
    Type in a terminal:
    
    
    netcat mail.yourdomain.com 110
    Use the following example code segment for your test. Be intelligent to tweak the changes appropriately to your environment. An output like follows will display in your terminal.
    
    
    Connected to mail.yourdomain.com (208.77.188.166).
    Escape character is '^]'.
    +OK Hello there.
    
    
    Type the following code segment in the prompt provided by the Courier POP3 server. I assume that you are intelligent enough not to type the lines which starts from +OK
    
    
    user fmaster
    +OK Password required.
    pass password
    +OK logged in.
    quit
    Testing Courier IMAP
    Type in a terminal:
    
    
    netcat mail.yourdomain.com 143
    
    Use the following example code segment for your test. Be intelligent and tweak the changes appropriately to your environment. An output like follows will display in your terminal.
    
    
    * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS XCOURIEROUTBOX=INBOX.Outbox] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.
    
    Type the following code segment in the prompt provided by the Courier IMAP server.
    
    
    a login fmaster password
    a OK LOGIN Ok.
    a logout
    
    
    Local Alias database
    
    
    When mail is to be delivered locally, the local delivery agent runs each local recipient name through the aliases database. The mapping does not affect addresses in message headers. Local aliases are typically used to implement distribution lists, or to direct mail for standard aliases such as postmaster to real people. The table can also be used to map Firstname.Lastname addresses to login names.
    
    Alias lookups are enabled by default and you will see following code segment in main.cf file.
    
    
    ...
    alias_maps = hash:/etc/aliases
    ...
    
    
    Creating an alias for an account
    The following codes illustrate how you can setup an alias. This step is optional since we are going to configure virtual mail domains later in this howto. I have added this step to make sure you understand how you can do this in case it is required.
    
    
    Create a user
    
    
    sudo useradd -m -s /bin/bash sysadmin
    sudo passwd sysadmin
    
    
    Edit the alias table
    
    
    
    Open the alias file with:
    
    
    
    sudo vi /etc/aliases
    
    
    Add the following code:
    
    
    fmaster: sysadmin
    
    
    To make your changes take effect type:
    
    
    sudo newaliases
    
    
    To test your changes send a mail to fmaster and check the mail in /home/sysadmin/Maildir/new folder.
    
    Per User .forward Files
    
    Users can control their own mail delivery by specifying destinations in a file called .forward in their home directories. The syntax of these files is the same as system aliases, except that the lookup key and colon are not present.
    
    I will illustrate an example here:
    
    
    Assume that you need to forward all the mails which come to the sysadmin account to an another account. Enter the following commands:
    
    
    
    su - sysadmin
    touch .forward
    
    
    Then open the .forward file
    
    
    vi .forward
    
    
    Add the following code:
    
    
    fossedu@example.com
    
    
    
    Remember to use email address which exists in this exercise.
    
    Now send a mail to sysadmin and mail should come to 
    
    
    fossedu@example.com
    
    
    
    Postfix virtual Aliases for separate domains and Linux system accounts
    
    With this approach, every hosted domain can have its own info etc. email address. However, it still uses Linux system accounts for local mailbox deliveries.
    
    With virtual alias domains, each hosted address is aliased to a local UNIX system account or to a remote address. The example below shows how to use this mechanism for the fossedu.org and linuxelabs.com domains.
    
    Inside the main.cf file, we tell it how to handle these virtual domains:
    
    
    
    sudo postconf -e "virtual_alias_domains = fossedu.org linuxelabs.com"
    sudo postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual"
    
    
    Edit the /etc/postfix/virtual file:
    
    
    
    Add two Linux system accounts
    
    
    sudo useradd -m -s /bin/bash sigiri
    sudo useradd -m -s /bin/bash kala
    
    
    
    Set passwords for the above users.
    
    
    sudo passwd sigiri
    sudo passwd kala
    
    sudo vi /etc/postfix/virtual
    
    
    Add the following code segment:
    
    
    info@fossedu.org       sigiri
    info@linuxelabs.com    kala
    
    
    
    To create a Map Database type :
    
    
    
    sudo postmap /etc/postfix/virtual
    
    
    postmap is utility program that will convert /etc/postfix/virtual to /etc/postfix/virtual.db in Berkley DB format, so that Postfix can access the data faster.
    
    
    
    Restart Postfix to make changes take effect:
    
    
    sudo /etc/init.d/postfix restart
    Last edited by VaporCreations; 03-15-2012 at 09:32 AM.

Similar Threads

  1. True RAM of VPS webmin - Virtualmin webmin
    By khucthuydu in forum Hosting Security and Technology
    Replies: 4
    Last Post: 04-11-2010, 10:10 PM
  2. How to prevent spoofing from Postfix/local part
    By nihal2 in forum Hosting Security and Technology
    Replies: 2
    Last Post: 04-29-2009, 12:17 PM
  3. Virtualmin/Webmin, Postfix, Virtual server.. problems.
    By Devilish in forum Hosting Software and Control Panels
    Replies: 0
    Last Post: 11-05-2007, 04:01 PM
  4. Replies: 12
    Last Post: 11-27-2006, 11:29 AM
  5. I need Help with Postfix and Webmin... plz reply
    By hostbox in forum Web Hosting Lounge
    Replies: 0
    Last Post: 07-16-2003, 10:09 PM

Posting Permissions

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