Forward/Redirect email fetched via fetchmail to gmail
2
votes
1
answer
3447
views
I am on a mac using terminal. I am trying to redirect email from a work email to gmail (the work email only allows IMAP and gmail can only fetch from POP - hence the workaround).
I have successfully configured fetchmail to fetch the mail from the work email.
I would now like to REDIRECT it to gmail, such that when it arrives it appears to arrive from (and I can reply to) the *original* sender.
I have tried both procmail and ssmtp with following configurations. For BOTH, the email does arrive in my gmail inbox however it appears to come from ME myusername@gmail.com rather than the original sender.
Any suggestions? I am *very* new at this. Welcome suggestions using procmail or ssmtp (or if it will work anything else!)
**procmail set up**
.fetchmailrc file:
set no bouncemail
poll outlook.office365.com with protocol imap
port 993
auth password
user user@domain.com password password
ssl
sslfingerprint ""
sslcertpath /Users/myuser/.certs
keep
no rewrite
mda "/usr/local/bin/procmail -f %F -d %T";
.procmailrc file
VERBOSE=yes
:0
! myusername@gmail.com
(with sendmail configured to send from my gmail, as per my answer here: https://unix.stackexchange.com/questions/369842/using-procmail-to-forward-to-gmail/369854#369854)
**ssmtp set up**
/opt/local/etc/ssmtp/ssmtp.conf file
root=FIXME@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=localhost
UseTLS=Yes
UseSTARTTLS=Yes
AuthUser=FIXME@gmail.com
AuthPass=Hunter2
FromLineOverride=yes
(have also tried without root line, and with rewriteDomain=gmail.com)
.fetchmailrc file, same as above except mda line is now:
mda "/opt/local/sbin/ssmtp FIXME@gmail.com"
Asked by Amanda
(33 rep)
Jun 9, 2017, 03:41 PM
Last activity: Oct 4, 2019, 08:02 PM
Last activity: Oct 4, 2019, 08:02 PM