Contactus form generated mail, rejected by Postfix

Discussion in 'Installation/Configuration' started by snowweb, Sep 14, 2020.

  1. snowweb

    snowweb Member

    I have a customer with website and their contact us form's mail seems to be blocked by postfix. I'm seeing the following delayed mail in the mailqueue:
    There are around 20 of them.
    I have an alias setup for webmaster@ for the customers domain, which forwards to a mailbox on their domain but since I saw this issue, I disabled it and created a webmaster mailbox, but still mail was not being accepted.
    The form collects the users email via an input box and uses that input as the from address in the email (at least that is what is how the mail is addressed by the php of the web page). I did suspect that the blocked emails might be due to the customer testing their contact us form and putting "[email protected]" for the email address, rather than their own actual email, however, I tried their form myself and grepped the mail.log for my email address and didn't find it, so is it possible that webmaster@ is being set by the .vhost file?

    This is what we're seeing in the mail.log:
    Any thoughts on this would be greatly appreciated!
     
  2. snowweb

    snowweb Member

    I just thought to check the contents of the mail queue emails. This is what I see:
    For this email:
    #mailq
    #postcat -vq 8073C401929
    So the "From" field is as encoded in the form, but seen by postfix is the "sender" which is somehow encoded as "webmaster@customers-site.com" but I'd like to know where that address is coming from as I don't see it in the php script. Does apache set this from out of the vhost directive?

    At the bottom of the quoted message above, it mentions that it was delivered to admin@... but it wasn't. Never arrived. Also, if it was, why is it still in the deferred queue?
     
    Last edited: Sep 14, 2020
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    mailq should show reason why mail is not yet delivered.
     
  4. snowweb

    snowweb Member

    Hi Taleman, I was re-editing my post above yours at same time you replied! Perhaps you could take another look please? I went into detail of the mailqueue and quoted a more useful example. Thanks.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    That's set in the php config of the site, either the fcgi starter file or the fpm pool file. This is done to prevent spam sending trough php mail() function.
     
    snowweb likes this.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You should find the reason in the mail.log file.
     
  7. recin

    recin Active Member

  8. snowweb

    snowweb Member

    I thought so too, but nothing is showing up with:
    (and it is still in the queue). I checked also /var/log/mail.err and /var/log/syslog I don't see it anywhere.
    I just checked again that sales@... does exist and is enabled. It does and it's an alias pointing at another mailbox on the same server.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Run:

    postqueue -f

    command to force delivery of all mails in the queue. then check mail.log to get the errors in case they still don't get delivered.
     
    snowweb likes this.
  10. snowweb

    snowweb Member

    Hi Till. Actually, I was doing "postfix flush" before checking the log, but I just tried postqueue -f also, but still nothing. Is it possible that mails from PHP are logged somewhere else?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    No

    You must see something in mail.log when you riún that command.
     

Share This Page