Can't send emails with Postfix

Discussion in 'Server Operation' started by fernandoch, Nov 8, 2019.

  1. fernandoch

    fernandoch Member HowtoForge Supporter

    Hello,
    I got hacked and my server started to send spam emails as shown here
    https://www.howtoforge.com/community/threads/postfix-spam-attack.83152/
    I fixed it and started Postfix again but I get a status bounced
    Code:
    Nov  8 07:51:21 nsXXX95 postfix/error[20755]: 94CE3160056: to=<[email protected]>, relay=none, delay=0.08, delays=0.04/0.02/0/0.02, dsn=5.0.0, status=bounced (gmail.com)
    How can I get more log details and what do you suggest to do?
    Thanks
    Note: I changed the email in here for obvious reasons but it is a valid email.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Is your servers IP-address blacklisted? Check for example with mxtoolbox.com.
    Maybe
    Code:
    grep 94CE3160056 /var/log/mail.log
    shows more info related to that bounced e-mail?
     
  3. fernandoch

    fernandoch Member HowtoForge Supporter

    I checked with Blacklist check with the link you gave me and all green, but not sure it checks gmail.

    Code:
    root@nsXXX95:~# grep 94CE3160056 /var/log/mail.log
    Nov  8 07:51:21 nsXXX95 postfix/pickup[18979]: 94CE3160056: uid=0 from=<[email protected]>
    Nov  8 07:51:21 nsXXX95 postfix/cleanup[20753]: 94CE3160056: message-id=<[email protected]>
    Nov  8 07:51:21 nsXXX95 postfix/qmgr[6794]: 94CE3160056: from=<[email protected]>, size=388, nrcpt=1 (queue active)
    Nov  8 07:51:21 nsXXX95 postfix/error[20755]: 94CE3160056: to=<[email protected]>, relay=none, delay=0.08, delays=0.04/0.02/0/0.02, dsn=5.0.0, status=bounced (gmail.com)
    Nov  8 07:51:21 nsXXX95 postfix/bounce[20756]: 94CE3160056: sender non-delivery notification: A2C861630A1
    Nov  8 07:51:21 nsXXX95 postfix/qmgr[6794]: 94CE3160056: removed
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Check what you can see from
    Code:
    # postcat /var/spool/postfix/deferred/A/A2C861630A1
    
    if that e-mail still is in mail queue.
    Otherwise, check what happened to that non-delivery notification:
    Code:
    grep  A2C861630A1 /var/log/mail.log
    It should got to some mailbox.
     
  5. fernandoch

    fernandoch Member HowtoForge Supporter

    Here it is:
    Code:
    root@nsXXX95:/tmp/logs# postcat /var/spool/postfix/deferred/A/A2C861630A1
    postcat: fatal: open /var/spool/postfix/deferred/A/A2C861630A1: No such file or directory
    Code:
    root@nsXXX95:/tmp/logs# grep  A2C861630A1 /var/log/mail.log
    Nov  8 07:51:21 nsXXX95 postfix/cleanup[20753]: A2C861630A1: message-id=<[email protected]>
    Nov  8 07:51:21 nsXXX95 postfix/bounce[20756]: 94CE3160056: sender non-delivery notification: A2C861630A1
    Nov  8 07:51:21 nsXXX95 postfix/qmgr[6794]: A2C861630A1: from=<>, size=2236, nrcpt=1 (queue active)
    Nov  8 07:51:21 nsXXX95 postfix/local[20757]: A2C861630A1: to=<[email protected]>, relay=local, delay=0.05, delays=0/0.03/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
    Nov  8 07:51:21 nsXXX95 postfix/qmgr[6794]: A2C861630A1: removed
     
  6. fernandoch

    fernandoch Member HowtoForge Supporter

    How to check if my IP is blacklisted by Google?
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I have no idea. Google, like other big e-mail providers, seem to keep secret what blacklists they use and for what reason mails are put into SPAM-folder.
    Have you checked all log files? See ls -lht /var/log | head for the latest after you try that file attaching.
    Have you read the mailbox for [email protected]-5-196-73.eu ?
     
  8. Steini86

    Steini86 Active Member

  9. fernandoch

    fernandoch Member HowtoForge Supporter

    I am not attaching a file, just trying a
    Code:
    echo "Test mail from postfix" | mail -s "Test Postfix" [email protected]
    I type mail and it says
    Code:
    No mail for root
     
  10. fernandoch

    fernandoch Member HowtoForge Supporter

  11. fernandoch

    fernandoch Member HowtoForge Supporter

    Still can't send emails from the server.
    Any ideas?
     
  12. fernandoch

    fernandoch Member HowtoForge Supporter

    OK, I made it work.
    Just purged everything postfix and mailutils and reinstalled.
    It now works...
     
    till likes this.

Share This Page