The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exim return-path

Discussion in 'General Discussion' started by SHSaeed, Sep 21, 2002.

  1. SHSaeed

    SHSaeed Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    I was wondering if anyone knows how to make it so that users can set return-path in emails that are sent from scripts. Currently all return-paths are set to nobody@ourserver.com.
     
  2. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    You cannot change this unless you make the user nobody a trusted exim user, this is indeed not recommended at all. I would not even try to do it ;)
     
  3. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Another solution is to use the -f option in php mail().
     
  4. SHSaeed

    SHSaeed Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    16
    We have this customer that is complaining because he says the undelivered emails are routed to nobody and not back to him so he and his users doesn't know what emails that have failed to deliver. I was thinking about setting up a script that checked the failed delivery emails and forwards them to the right person instead of messing with Exim. What do you guys think?
     
  5. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    [quote:af653a66fd][i:af653a66fd]Originally posted by moronhead[/i:af653a66fd]

    Another solution is to use the -f option in php mail().[/quote:af653a66fd]

    explain that? I would like some details on that one.
     
  6. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    [quote:0b6abd6c1b][i:0b6abd6c1b]Originally posted by (SH)Saeed[/i:0b6abd6c1b]
    We have this customer that is complaining because he says the undelivered emails are routed to nobody and not back to him so he and his users doesn't know what emails that have failed to deliver. I was thinking about setting up a script that checked the failed delivery emails and forwards them to the right person instead of messing with Exim. What do you guys think?[/quote:0b6abd6c1b]

    Since the -f flag that Moronhead talked about can't be set when safe_mode is on (afaik), I've written an Exim filter which could do the trick:

    http://html.conclase.net/cp/scripts/2somebody.txt

    Your comments are very welcome.
     
  7. SHSaeed

    SHSaeed Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    16
    The file is password protected. Anyways, we had a customized PHP script created for our company that logs into the returned mail account and forwards all reurned emails to their senders. Works pretty good.
     
  8. mrprez

    mrprez Well-Known Member

    Joined:
    Jun 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    16
    Which directory would this filter go in?

    John
     
  9. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    In my servers the .forward file for user &nobody& is inside the root directory. Check if /.forward exists, and if it contains the address where nobody's mail goes, then that is it.
     
  10. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Has anybody tested this filter, and does it work as it should?
     
  11. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Juanra,

    I just put your .forward file on my server and it appears to be working. Thank you very much!!
     
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    [quote:8630d30c97][i:8630d30c97]Originally posted by Juanra[/i:8630d30c97]

    [quote:8630d30c97][i:8630d30c97]Originally posted by (SH)Saeed[/i:8630d30c97]
    We have this customer that is complaining because he says the undelivered emails are routed to nobody and not back to him so he and his users doesn't know what emails that have failed to deliver. I was thinking about setting up a script that checked the failed delivery emails and forwards them to the right person instead of messing with Exim. What do you guys think?[/quote:8630d30c97]

    Since the -f flag that Moronhead talked about can't be set when safe_mode is on (afaik), I've written an Exim filter which could do the trick:

    http://html.conclase.net/cp/scripts/2somebody.txt

    Your comments are very welcome.[/quote:8630d30c97]


    Juanra, I put in the new .forward but I'm getting some errors.

    defer (-11): error in forward file: missing or malformed local part (expected word or &&&) in &if first_delivery then&
    Return to Mail Queue

    Any idea? I followed the instructions to the letter.
     
  13. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    DUP
     
  14. picasso

    picasso Member

    Joined:
    Oct 23, 2002
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Did you miss out & or has an extra & somewhere in the file?

    It should be in this part of the script.
    ---
    else deliver &nobody&
    endif
    else
    deliver &nobody&
    endif
    else
    deliver &nobody&
    endif
    ----

    Otherwise you should not get the error.
     
  15. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    &nobody& should be replaced by a default nobody address, this way:

    Instead of:
    deliver &nobody&

    write (for example):
    deliver admin@yourdomain.com

    without the angle brackets. &deliver &nobody&& appears four times in the filter.
     
  16. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Thanks Juanra - That's what was wrong.
     
  17. tcwebguy

    tcwebguy Active Member

    Joined:
    Sep 28, 2001
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Checking for .forward

    Earlier, you mentioned checking to see if .forward exists.

    How do you check for this?
     
  18. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    In a sssh session
    cd /
    ls -l .foward

    and check in /root as well
     
Loading...

Share This Page