Specific email is not being fetched over imap

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Specific email is not being fetched over imap

Post by donlee10 »

Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

Hi there,

i'm fairly new to Hesk, only have been playing with it for a few days. i really like it.
Got one issue, where emails from specific sender with WAV attachment are not being fetched into hesk for some reason.
I added wav extension into allowed extension. Also when I send email with wav file to the one that is supposed to be fetched. The ticket gets created.
But for some reason, when the email arrives from specific sender - theres no sign of it in hesk. ( it is an automated email from voip provider, recorded voicemail via email)

I've checked the server logs and can't see any errors.

Hope you can help.
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Re: Specific email is not being fetched over imap

Post by donlee10 »

I turned debug on and tried to fetch those mails manually and this is what i get

the one with wav that i sent from my mail got fetched. But the other one from voip company did not

#!/usr/bin/php -q
Connected to the IMAP server "{outlook.office365.com:993/imap/ssl}".
Unread messages found: 2
Ticket 75E-47J-47LH created/updated.


Ticket NOT inserted - may be duplicate, blocked or an error.


Disconnected from the IMAP server.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Specific email is not being fetched over imap

Post by Klemen »

If the email comes from a "noreply" email address Hesk will ignore it.

To change this behavior:
1. open your "inc/pipe_functions.inc.php" file in a powerful text editor, such as Notepad++ (do not use Microsoft notepad)
2. find

Code: Select all

function hesk_isReturnedEmail($tmpvar)
{
3. just below that code add

Code: Select all

    if (strtolower($tmpvar['email']) == 'test@example.com')
    {
        return false;
    }
Change test@example.com to the "From" email address form your voip company
4. save, upload and test
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Re: Specific email is not being fetched over imap

Post by donlee10 »

Thank you for your reply, i have tested it and still no ticket created.
the code looks like this now

// Try to detect "delivery failed" and "noreply" emails - ignore if detected
if ( hesk_isReturnedEmail($tmpvar) )
{
if (strtolower($tmpvar['email']) == 'noreply@****.co.uk')
{
return false;
}
return hesk_cleanExit();
}

by the way i am not using email piping, only imap fetching.
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Specific email is not being fetched over imap

Post by Klemen »

Looks to me like you modified the wrong part of the code.

See my original reply again, the modification should go below this exact code

Code: Select all

function hesk_isReturnedEmail($tmpvar)
{
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Re: Specific email is not being fetched over imap

Post by donlee10 »

my bad, all good now. Many thanks Klemen
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Re: Specific email is not being fetched over imap

Post by donlee10 »

HI Klemen,

this has stopped working in the latest version
https://imgur.com/1cROthl
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

Re: Specific email is not being fetched over imap

Post by Klemen »

The code should go into function hesk_isDoNotReplyEmail now.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
donlee10
Posts: 12
Joined: Thu Dec 16, 2021 3:12 pm

Re: Specific email is not being fetched over imap

Post by donlee10 »

Thanks again
Post Reply