Learn about Centmin Mod LEMP Stack today
Register Now

Email Postfix problems

Discussion in 'Install & Upgrades or Pre-Install Questions' started by cloud9, Jun 17, 2016.

Tags:
  1. cloud9

    cloud9 Premium Member Premium Member

    140
    54
    28
    Oct 6, 2015
    England
    Ratings:
    +75
    Local Time:
    4:23 PM
    1.11.x
    10.x
    I appear to have postfix installed and running - but IPB4 doesnt send any emails out (using test email) when setting IPB4 to php for emails ?

    Never had anything to do with postfix so all help welcome :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,175
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,138
    Local Time:
    1:23 AM
    Nginx 1.13.x
    MariaDB 5.5
    Who's your web host ? some web hosts block outgoing smtp email ports until you contact them to request unblocking i.e. Vultr does this and require you to provide ID verification to unblock you.

    As to email delivery, ensure SPF/TXT DNS records are setup properly too.

    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such things as SPF/TXT and DNS records. You're best to ask your web host and/or domain registrar and follow below instructions and check out thread at Email - error in PTR, mails goes to gmail Spam folder

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    Generally, to insure email sent from your Centmin Mod LEMP server's postfix MTA doesn't end up in email recipient's spam box, you need to at least have proper DNS level configurations for
    1. SPF / TXT record setup in DNS with your DNS provider. SPF / TXT record is a DNS text record so how you add it will depend on your DNS provider. Some info here, here and here. Also SPF guides from some Domain/DNS providers such as Namecheap.com, Godaddy.com, and check out SPF Wizard - SPF Generator DNS tool. Ensure both your site's domain name and server's main hostname from Getting Started Guide step 1 have valid SPF TXT records
    2. Reverse PTR record, you will need to ask your web host for that. Some web hosts and VPS providers use SolusVM control panels and allow you to setup a PTR record yourself. Basically it points your server's IP to your domain name. So when a reverse lookup on the IP is made, it resolves to your domain name. For instance the PTR record for this forum's IP = 173.230.147.144 resolves to community.centminmod.com when you do a reverse IP lookup at IP Address Lookup (IPv4 & IPv6). I use Linode.com for my forum hosting and their control panel has the relevant PTR record support for reverse dns.

    IP Blacklist Check



    Also check if your web site and server IP addresses are in spam blacklists using services like:
    Straight from Amazon SES best practices guide, you should also check the URL links that you use in your emails against blacklists as well, because some ISPs will block email with blacklisted links. URIBL.com and SURBL.org are two very useful sites that you can use to determine whether your links are blacklisted. Remember to check any links provided to you by a third party or any link shorteners, which obfuscate your domain or links.

    Transactional Email Providers



    For forum, CMS etc outbound email and best email deliverability, best to use a 3rd party SMTP transactional email provider. Discussion of provider options can be read at Email - Mandrill users will be required to have a paid monthly MailChimp account. I use Amazon SES for this forum's emails.

    SPF Setup Guides


    SPF Wizards



    You can use SPF wizards to try and get the correct settings

    SPF Testing Tools


     
    • Like Like x 1
  3. tjk

    tjk Member

    74
    16
    8
    Jun 27, 2015
    Ratings:
    +25
    Local Time:
    11:23 AM
    Use a service to deliver your email, Amazon SES, Sparkpost, SendGrid, etc, all/most have free tiers of 50k to 100k emails a month.
     
  4. cloud9

    cloud9 Premium Member Premium Member

    140
    54
    28
    Oct 6, 2015
    England
    Ratings:
    +75
    Local Time:
    4:23 PM
    1.11.x
    10.x
    It doesnt work with spark post either

    SPF all correct, A records and TXT records all ok, CSF and Hosts all good (Its my servers in a datacenter) all ok, cant see any config problems, no error logs either, One VPS i have is fine, this new one (same setup, centminmod, mariadb nginx etc) works

    I will continue looking
     
  5. cloud9

    cloud9 Premium Member Premium Member

    140
    54
    28
    Oct 6, 2015
    England
    Ratings:
    +75
    Local Time:
    4:23 PM
    1.11.x
    10.x
    Ok, fixed, down to human error :(

    I had edited the /etc/postfix/main.cf file - but obviously didn't save it

    Two edits to get mail working for my standard centminmod server

    Code:
    #mydomain = domain.tld
    mydomain = MYDOMAIN.co.uk
    Added my domain above

    And under receiving mail changed the config to

    Code:
    inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    #inet_interfaces = localhost