Find the answer to your Linux question:
Results 1 to 6 of 6
Hello, I've been trying for 3 months to set up a mail server. I'm really desperate for this since i need this functionality for a couple of my sites that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Alex Stan's Avatar
    Join Date
    Aug 2006
    Location
    Hamilton, Ontario
    Posts
    90

    Help, Mail server, mail gets blocked


    Hello,

    I've been trying for 3 months to set up a mail server. I'm really desperate for this since i need this functionality for a couple of my sites that i host.

    The server is at my home, with a few ports forwarded.

    I recently followed the how to forge tutorial on a clean Ubuntu 7.10. I choose Postfix as my mail transfer agent, since Wikipedia claimed it was more bug free. As far I saw every daemon was working, except i couldn't send stuff. Every mail i tried to send to gmail(i used that primarily) was receiving a connection error.

    I think it's one of 2 problems:
    1. My ISP is blocking port 25, but i don't see why, since i disabled the firewall from my modem already. Good idea for that would be to switch ISPs.
    2. My mail gets treated like spam. I have no idea what to do then.

    Since my mail server didn't work i used google apps for your domain for a few email addresses. So i wonder if gmail could be used as a gateway for all my mail. In that case i need to know how to set PHP(the mail function) do that.

    I don't know much about this area(mail transfer) but i usually learn fast. Thank you for all your help.

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    what are you using as your mta, sendmail, postfix, exim,.....?

    also what the the logs say for your above mta?

  3. #3
    Just Joined! Alex Stan's Avatar
    Join Date
    Aug 2006
    Location
    Hamilton, Ontario
    Posts
    90
    Sorry, i forgot to include that. I'm using Postfix. It says in the tutorial though.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    from a command prompt, do (unless your log is differernt)
    #tail -f /var/log/mail.info

    then try to send an email and see what postfix says. copy and paste that part from the postfix log here.

  6. #5
    Just Joined! Alex Stan's Avatar
    Join Date
    Aug 2006
    Location
    Hamilton, Ontario
    Posts
    90
    Hello

    I'm sorry i didn't reply faster. I was busy studying for a few exams.

    I get tons of these:
    Code:
    Jan 23 12:38:07 server postfix/smtp[32605]: connect to gmail-smtp-in.l.google.com[64.233.167.27]: Connection timed out (port 25)
    I searched some more how to forge and i found a guide on how to set postfix to relay the mail to another server. So i could use that as a basis for the gmail relay thing. It also says there that most dynamic ip's are blacklisted by the mail servers(i do have a dynamic ip)
    Set Up Postfix For Relaying Emails Through Another Mailserver | HowtoForge - Linux Howtos and Tutorials

    So there's nothing more i could do for that.
    I need to fix my other problems now, like for some reason i can't connect to the smtp and the imap servers with a client, the only way i could send mail was with a command in a ssh session. I'm using Thunderbird and i'm getting connection timed out.

    PS: if i do manage to make the relay work i would like to first clean the mail queue so my users don't get like 20 mails at once. How do i do that?

  7. #6
    Just Joined! Alex Stan's Avatar
    Join Date
    Aug 2006
    Location
    Hamilton, Ontario
    Posts
    90
    Sigh... This i very annoying

    For the gateway, I used a combination of these 2 guides:
    Set Up Postfix For Relaying Emails Through Another Mailserver | HowtoForge - Linux Howtos and Tutorials
    » Postfix Gmail SMTP Relay

    my main.cf:
    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 = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    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
    
    #auth
    smtp_sasl_auth_enable=yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    
    relayhost = [smtp.gmail.com]:587
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
    smtp_sasl_security_options = noanonymous
    smtp_sasl_tls_security_options = noanonymous
    smtp_tks_note_starttls_offer = yes
    tls_random_source = dev:/dev/urandom
    smtp_tls_scert_verifydepth = 5
    #smtp_tls_key_file=/etc/postfix/smtp.key
    #smtp_tls_cert_file=/etc/postfix/smtp.pem
    smtpd_tls_ask_ccert = yes
    smtpd_tls_req_ccert =no
    smtp_tls_enforce_peername = no
    
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = server.hypertriangle.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = server.hypertriangle.com, localhost, localhost.localdomain
    relayhost = 
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    virtual_alias_domains = 
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_mailbox_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    sasl_passwd (i'm using google apps for your domain, that's why there's hypertriangle instead of gmail(i tested that account)):
    Code:
     gmail-smtp.l.google.com user@hypertriangle.com:password
    smtp.gmail.com user@hypertriangle.com:password
    But the mail is not using the gateway and it's not going through normally either(from tail):
    Code:
    Jan 23 13:26:34 server postfix/cleanup[1237]: 2CFA1918C3A: message-id=<20080123182634.2CFA1918C3A@server.hypertriangle.com>
    Jan 23 13:26:34 server postfix/qmgr[1229]: 2CFA1918C3A: from=<root@server.hypertriangle.com>, size=312, nrcpt=1 (queue active)
    Jan 23 13:26:35 server postfix/smtpd[1244]: connect from localhost.localdomain[127.0.0.1]
    Jan 23 13:26:35 server postfix/smtpd[1244]: C85E6918C39: client=localhost.localdomain[127.0.0.1]
    Jan 23 13:26:35 server postfix/cleanup[1237]: C85E6918C39: message-id=<20080123182634.2CFA1918C3A@server.hypertriangle.com>
    Jan 23 13:26:35 server postfix/qmgr[1229]: C85E6918C39: from=<root@server.hypertriangle.com>, size=797, nrcpt=1 (queue active)
    Jan 23 13:26:35 server amavis[18388]: (18388-03) Passed CLEAN, <root@server.hypertriangle.com> -> <mynormalemailaddress>, Message-ID: <20080123182634.2CFA1918C3A@server.hypertriangle.com>, mail_id: ElIJCDhVHGpc, Hits: 2.48, queued_as: C85E6918C39, 1675 ms
    Jan 23 13:26:35 server postfix/smtp[1240]: 2CFA1918C3A: to=<mynormalemailaddress>, relay=127.0.0.1[127.0.0.1]:10024, delay=5, delays=3.3/0.01/0.01/1.7, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=18388-03, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C85E6918C39)
    Jan 23 13:26:35 server postfix/qmgr[1229]: 2CFA1918C3A: removed
    Jan 23 13:26:35 server postfix/smtpd[1244]: disconnect from localhost.localdomain[127.0.0.1]
    Jan 23 13:27:05 server postfix/smtp[1246]: connect to gmail-smtp-in.l.google.com[64.233.167.114]: Connection timed out (port 25)
    Jan 23 13:27:35 server postfix/smtp[1246]: connect to gmail-smtp-in.l.google.com[64.233.167.27]: Connection timed out (port 25)

Posting Permissions

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