Jump to content

[Inactive] Processing incoming emails with a script


Recommended Posts

Posted

The purpose of my account "mail2ftp" is to provide free email-to-FTP service: users can send emails to the email address <mail2ftp @ mail2ftp.heliohost.org> on that account, I had an email forwarder set up in cPanel with forwarding to a pipe:

|/home/mail2ftp/public_html/server/mail2ftp.pl

Incoming emails were processed by that script. After migration today from tommy (cPanel) to johnny (Plesk), the forwarder disappeared, and when I try to set up forwarding to that pipe, Plesk (unlike cPanel) complains "You specified invalid email address: |/home/mail2ftp/public_html/server/mail2ftp.pl."

I tried to set up forwarding as a filter in RoundCube web-mail, same error message.

How can I set up forwarding to a pipe? Or can admin set up this forwarding?

Posted
8 hours ago, Lena said:

/home/mail2ftp/public_html/server/mail2ftp.pl."

One of the changes on Plesk is your home directory is your main domain, not your username. So try this

/home/mail2ftp.heliohost.org/public_html/server/mail2ftp.pl

 

Posted

Also "You specified invalid email address: |/home/mail2ftp.heliohost.org/public_html/server/mail2ftp.pl."

Posted

Same without the pipe character "|".

Posted

Again the same error message:
 

Quote

 

You specified invalid email address: |/home/mail2ftp.heliohost.org/public_html/server/mail2ftp.pl.

Specify email addresses. You can type each address on a new line, or separate addresses with white spaces, commas, or semicolons.

 

while trying to set up forwarding on https://johnny.heliohost.org:8443/smb/email-address/edit/id/64 (Plesk - Mail - mail2ftp()mail2ftp.heliohost.org - Forwarding). Instead of being piped to the script, a test email appeared in that mailbox (accessible via Roundcube web-mail), twice for some reason. I tried to find that mailbox (file or dir) among files accessible for CGI scripts on my account - unsuccessfully.

Posted

50 min after the test email message I mentioned above (one line "help" in plain text message body, Subject ignored), I received an email reply from the script, so piping worked. I don't know why the delay (the delay is not because of receiving mailserver, I whitelisted johnny IP-address there). Forwarding isn't visible in Plesk. A copy of the incoming email message is kept in the mailbox, but that's no problem.

johnny.heliohost.org  resolves to 65.19.141.67, but PTR for that IP-address doesn't resolve:

dig -x 65.19.141.67 @8.8.8.8 
...
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 23760
...
dig +trace -x 65.19.141.67 
...
67.141.19.65.in-addr.arpa. 86400 IN	CNAME	67.subnet64.141.19.65.in-addr.arpa.
subnet64.141.19.65.in-addr.arpa. 86400 IN NS	ns2.heliohost.org.
subnet64.141.19.65.in-addr.arpa. 86400 IN NS	ns1.heliohost.org.
;; Received 129 bytes from 216.66.1.2#53(ns4.he.net) in 36 ms

dig 67.141.19.65.in-addr.arpa. ptr @ns1.heliohost.org
...
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 13410
...
dig 67.141.19.65.in-addr.arpa. ptr @ns2.heliohost.org
...
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 51684
...

This is bad for emails from johnny.

Thank you.

Posted

Reverse DNS for Johnny has been fixed

root@johnny [/home/krydos]# dig +noall +answer -x 65.19.141.67
67.141.19.65.in-addr.arpa. 86242 IN     CNAME   67.subnet64.141.19.65.in-addr.arpa.
67.subnet64.141.19.65.in-addr.arpa. 14400 IN PTR johnny.heliohost.org.

Thanks for pointing it out.

Posted

Reverse IPv6 has been added as well

root@johnny [/home/krydos]# dig +noall +answer -x 2001:470:1:1ee::2009
9.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.e.e.1.0.1.0.0.0.0.7.4.0.1.0.0.2.ip6.arpa. 14400 IN PTR johnny.heliohost.org.

 

Posted

Thank you.

Everything worked, but suddenly all my CGI scripts stopped to work. For example, http://mail2ftp.heliohost.org/env.pl gives "500 Internal Server Error", in the log: "End of script output before headers: env.pl". It worked yesterday, I didn't touch that script file, its permissions remain rwx r-x r-x, .htaccess contains:

AddHandler cgi-script .pl

I couldn't find anything suspicious in Plesk. "CGI support" allowed and remains checked. In Apache settings I added in Handlers: "cgi-script .pl" - that didn't help. May be some protection was tripped on my account? I cannot guess why.

Even simpler CGI script http://mail2ftp.heliohost.org/testperl.pl also doesn't work, same 500 Internal Server Error, same in log "End of script output before headers: testperl.pl".

Sorry to bother you.

  • 1 year later...
Posted
On 12/31/2022 at 8:29 AM, Krydos said:

It looks like mail piping is something that Plesk can do, but it requires root access to set up.

After restoration of Johnny, please set up mail piping again: Johnny, account mail2ftp, piping of emails to the email address <mail2ftp @ mail2ftp.heliohost.org> to |/home/mail2ftp.heliohost.org/public_html/server/mail2ftp.pl

Also, when I try to login to Roundcube webmail, I get error message "unsuccessful connection with IMAP server".

Posted

Does it work now?

Note: During my testing I changed the password of mail2ftp@mail2ftp.heliohost.org email address so I could look at the inbox. You can change it back to what it was before now.

  • Krydos changed the title to Processing incoming emails with a script
Guest
This topic is now closed to further replies.
×
×
  • Create New...