From 3e443d4875bbc37723872b2014b944ed31a29577 Mon Sep 17 00:00:00 2001 From: Adam Klaff Date: Mon, 21 Aug 2023 17:13:48 -0700 Subject: [PATCH 1/3] Remove Dockerfile label --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index bc3687d..c3ec166 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.14.2 -LABEL org.opencontainers.image.source = "https://github.com/HaschekSolutions/opentrashmail" +# LABEL org.opencontainers.image.source = "https://github.com/HaschekSolutions/opentrashmail" RUN apk add --no-cache python2 socat wget php7-fileinfo php7-session curl git php php-curl nginx php-openssl php-mbstring php-json php-gd php-dom php-fpm #RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer From 200dd2d8c6027aba0324484a25feb64bc0722ad0 Mon Sep 17 00:00:00 2001 From: Adam Klaff Date: Mon, 21 Aug 2023 17:16:07 -0700 Subject: [PATCH 2/3] 4 digit year, add guid, remove 5 article limit --- web/rss.php | 83 ++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/web/rss.php b/web/rss.php index fd0e80f..a7e10d8 100644 --- a/web/rss.php +++ b/web/rss.php @@ -1,102 +1,101 @@ - - - RSS for '.$email.' - https://'.DOMAIN.'/#'.$email.' - RSS Feed for email address '.$email.' - '.date(DATE_RFC822,time()).' + + RSS for ' . $email . ' + https://' . DOMAIN . '/#' . $email . ' + RSS Feed for email address ' . $email . ' + ' . date(DateTime::RFC2822, time()) . ' - RSS for '.$email.' + RSS for ' . $email . ' https://raw.githubusercontent.com/HaschekSolutions/opentrashmail/master/web/imgs/logo_300.png https://github.com/HaschekSolutions/opentrashmail '; $emaildata = getEmailsOfEmail($email); -foreach($emaildata as $id=>$d) -{ - $data = getEmail($email,$id); +foreach ($emaildata as $id => $d) { + $data = getEmail($email, $id); //var_dump($data); - $time = substr($id,0,-3); - $date = date("Y-m-d H:i",$time); + $time = substr($id, 0, -3); + $date = date("Y-m-d H:i", $time); $att_text = array(); $encl = array(); - if(is_array($data['parsed']['attachments'])) - foreach($data['parsed']['attachments'] as $filename) - { - $filepath = ROOT.DS.'..'.DS.'data'.DS.$email.DS.'attachments'.DS.$filename; - $parts = explode('-',$filename); + if (is_array($data['parsed']['attachments'])) + foreach ($data['parsed']['attachments'] as $filename) { + $filepath = ROOT . DS . '..' . DS . 'data' . DS . $email . DS . 'attachments' . DS . $filename; + $parts = explode('-', $filename); $fid = $parts[0]; $fn = $parts[1]; - $url = 'https://'.DOMAIN.'/api.php?a=attachment&email='.$email.'&id='.$fid.'&filename='.$fn; + $url = 'https://' . DOMAIN . '/api.php?a=attachment&email=' . $email . '&id=' . $fid . '&filename=' . $fn; //$encl[] = ''; $att_text[] = "$fn"; } - $rss.=' + $rss .= ' - <![CDATA['.$data['parsed']['subject'].']]> - '.date(DATE_RFC822,$time).' - https://'.DOMAIN.'/#'.$email.' + <![CDATA[' . $data['parsed']['subject'] . ']]> + ' . date(DateTime::RFC2822, $time) . ' + https://' . DOMAIN . '/#' . $email . ' + https://' . DOMAIN . '/api.php?a=load&email=' . $email . '&id=' . $id . '&raw=true - Email to: '.(is_array($data['rcpts'])?htmlentities(implode(',',$data['rcpts'])):htmlentities($email)).'
- '.((count($att_text)>0)?'Attachments:
'.array2ul($att_text).'
':'').' - View raw email
+ Email from: ' . htmlentities($data['from']) . '
+ Email to: ' . (is_array($data['rcpts']) ? htmlentities(implode(',', $data['rcpts'])) : htmlentities($email)) . '
+ ' . ((count($att_text) > 0) ? 'Attachments:
' . array2ul($att_text) . '
' : '') . ' + View raw email

---------

- '.($data['parsed']['htmlbody']?$data['parsed']['htmlbody']:nl2br(htmlentities($data['parsed']['body']))).' + ' . ($data['parsed']['htmlbody'] ? $data['parsed']['htmlbody'] : nl2br(htmlentities($data['parsed']['body']))) . ' ]]>
- './*((count($encl)>0)?implode('
',$encl):'').*/' + ' ./*((count($encl)>0)?implode('
',$encl):'').*/ '
'; - if(++$i>5) break; + //if (++$i > 5) break; } -$rss.='
+$rss .= '
'; echo $rss; -function array2ul($array) { +function array2ul($array) +{ $out = ""; - return $out; -} \ No newline at end of file + return $out; +} From c05a9c329f10214129cf6ef64d023fe98cd13f7b Mon Sep 17 00:00:00 2001 From: Adam Klaff Date: Mon, 21 Aug 2023 17:31:34 -0700 Subject: [PATCH 3/3] Update Dockerfile --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c3ec166..8e4d5f6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.14.2 -# LABEL org.opencontainers.image.source = "https://github.com/HaschekSolutions/opentrashmail" +LABEL org.opencontainers.image.source = "https://github.com/HaschekSolutions/opentrashmail" RUN apk add --no-cache python2 socat wget php7-fileinfo php7-session curl git php php-curl nginx php-openssl php-mbstring php-json php-gd php-dom php-fpm #RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer @@ -27,4 +27,4 @@ VOLUME /var/www/opentrashmail/data EXPOSE 80 25 #CMD ["/bin/ash"] -ENTRYPOINT ["/etc/start.sh"] \ No newline at end of file +ENTRYPOINT ["/etc/start.sh"]