Can not send emails using latest image

Issue #384 resolved
Ilya Zolotukhin created an issue

I had a Docker container running for a long time and it worked like a charm.

I decided to move email server to another machine, removed the old one, pulled the latest version and ran it.

Can not send emails to my Gmail accounts using a new image.

Please, let me know if I should attach any logs

Comments (7)

  1. Scott MacDonald

    New server, new IP -- is Google blocking the IP?

    Is there a software firewall installed on this "other" machine? If so, ports 80 and 443 need to be opened to acquire LE certificates and renew them.

    Are all necessary ports being exposed and are they listening?

    Are the DNS records correctly configured? Are you using SPF or DKIM to prevent unauthorized hosts from sending email using the domain name configured on this "other" machine?

  2. SH repo owner

    Also delivery logs are located at /log/delivery/del/... and it should contain what is actualy wrong and if it is container error or gmail is simply refusing emails due some invalid settings like Scott describes...

  3. Ilya Zolotukhin reporter

    Hi Scott, thanks for your reply.

    How do I know that Google is blocking an ip? (I also tried to sent emails to other mail server and it didn't work)

    I'm using this run command:

    docker run \
        -d \
        --restart=always \
        -p 25:25 \
        -p 110:110 \
        -p 143:143 \
        -p 443:443 \
        -p 465:465 \
        -p 587:587 \
        -p 993:993 \
        -p 995:995 \
        -e "DISABLE_CLAMAV=TRUE" \
        -v /etc/localtime:/etc/localtime:ro \
        -v /data/mailserver:/data \
        --name "mailserver" \
        -t analogic/poste.io
    

    No, I don't use anything like SPF or DKIM, that is a fresh machine with only Docker + docker-compose installed

    So, I also tried to run the server with empty /data volume, renewed the LE certificates.

    Here is a debug message from the log

    2018-07-04T04:16:09.867Z [1] [DEBUG] [outbound] running send_email hooks
    2018-07-04T04:16:09.867Z [1] [DEBUG] [outbound] Sending mail: 1530542165279_1530677769721_11_602_q9Fsib_16_mail.[myserver].com
    2018-07-04T04:16:09.868Z [1] [DEBUG] [outbound] running get_mx hooks
    2018-07-04T04:16:09.868Z [1] [DEBUG] [outbound] running get_mx hook in relay plugin
    2018-07-04T04:16:09.868Z [1] [DEBUG] [outbound] hook=get_mx plugin=relay function=force_routing params=[recepient] retval=CONT msg=""
    2018-07-04T04:16:09.868Z [1] [DEBUG] [outbound] running get_mx hook in rcpt_database plugin
    2018-07-04T04:16:09.869Z [1] [DEBUG] [outbound] hook=get_mx plugin=rcpt_database function=hook_get_mx params=[recepient] retval=CONT msg=""
    2018-07-04T04:16:09.870Z [1] [DEBUG] [outbound] running get_mx hook in queue/lmtp plugin
    2018-07-04T04:16:09.870Z [1] [DEBUG] [outbound] hook=get_mx plugin=queue/lmtp function=hook_get_mx params=[recepient] retval=CONT msg=""
    2018-07-04T04:16:09.906Z [1] [INFO] [outbound] Looking up A records for: aspmx.l.google.com
    2018-07-04T04:16:09.907Z [1] [INFO] [outbound] Attempting to deliver to: 74.125.24.26:25 (0) (3)
    2018-07-04T04:16:39.908Z [1] [INFO] [outbound] Looking up A records for: alt2.aspmx.l.google.com
    2018-07-04T04:16:39.909Z [1] [INFO] [outbound] Attempting to deliver to: 108.177.104.26:25 (0) (3)
    2018-07-04T04:17:09.910Z [1] [INFO] [outbound] Looking up A records for: alt1.aspmx.l.google.com
    2018-07-04T04:17:09.911Z [1] [INFO] [outbound] Attempting to deliver to: 74.125.195.26:25 (0) (3)
    2018-07-04T04:17:39.912Z [1] [INFO] [outbound] Looking up A records for: alt4.aspmx.l.google.com
    2018-07-04T04:17:39.913Z [1] [INFO] [outbound] Attempting to deliver to: 173.194.219.26:25 (0) (3)
    2018-07-04T04:18:09.914Z [1] [INFO] [outbound] Looking up A records for: alt3.aspmx.l.google.com
    2018-07-04T04:18:09.915Z [1] [INFO] [outbound] Attempting to deliver to: 74.125.126.27:25 (0) (3)
    2018-07-04T04:18:39.916Z [1] [DEBUG] [outbound] running deferred hooks
    2018-07-04T04:18:39.916Z [1] [INFO] [outbound] Temp failing 1530542165279_1530677769721_11_602_q9Fsib_16_mail.[myserver].com for 131072 seconds: Tried all MXs
    
  4. Scott MacDonald

    What do you see in the delivery log for July 4th? Delivery logs are located in /log/delivery/del/. Seems that something is preventing communication. From this server are you able to telnet on port 25 to any of the MX records you listed from the debug log?

    You've opened/exposed port 25 from docker but could this port be blocked upstream by the VPS/VM provider or the Internet Provider?

    Are the two machines you have hosted with the same provider??

  5. Ilya Zolotukhin reporter

    Thanks, Scott,

    I've moved mail server to Digital Ocean, and looks like they block email delivery by default telnet does not work either.

    Created a ticket for that.

    Will update the thread if the problem will be related to DO.

  6. Log in to comment